Create or update a credit
Changed onCreate a new credit or update an existing one through a single endpoint.
Omit id to create a new credit; include the id of an existing credit to update it. Updates are sparse: only the fields you send are changed, and any field you omit keeps its current value. On create, the credit_number and original_amount are assigned automatically — original_amount is frozen to the create-time amount and never changes afterward.
Credits created through the API are always manually-created (USER source) credits — the same as a credit you would add by hand in the Distru UI. Credits generated automatically (from a return, an invoice overpayment, or QuickBooks Online) cannot be created here, and only owner_id, brand_id, external_note and internal_note can be updated on them — their amount, customer and QuickBooks Online item cannot be set through the API. On a credit memo created in QuickBooks Online (QB_CREDIT_MEMO source) owner_id and brand_id are the only updatable fields: its notes live in QuickBooks Online and are re-imported from there on every sync. Sending any other field with its current value is accepted.
Constraints: on update the customer (company_id) cannot be changed. amount must be greater than 0 and, on update, cannot be set below the amount already applied to invoices by this credit (its used amount). owner_id must be an active user of your company. Once a credit has an owner it can be reassigned but not removed.
Credits do not touch inventory or state compliance (Metrc / BioTrack). They do interact with QuickBooks Online: if your account syncs credits with QuickBooks Online, updating an existing credit first pulls the latest credit and payment state from QuickBooks Online (so a stale local amount can be rejected), and any create or update is then pushed to QuickBooks Online in the background. A 200/201 confirms the credit was saved in Distru, not that it has finished syncing to QuickBooks Online — re-fetch the credit and read qb_sync_status to observe the sync result. owner_id and brand_id stay in Distru: an update that changes only those fields neither pulls from nor pushes to QuickBooks Online.
Required permission: credits_permissions_create to create, credits_permissions_edit to update. Creating requires a customer (company_id) the authenticated user can see under their team restrictions; a hidden one returns 403. Updating also requires access to the credit under those restrictions (a hidden credit returns 403), and an owner_id they can assign under the same restrictions.
Request
- Base URLhttps://app.distru.com
- AuthHTTP bearer
Request body
Example request
{
"amount": 100,
"company_id": "00000000-0000-0000-0000-00000000000a",
"external_note": "External note",
"internal_note": "Internal note"
}Response
The updated credit
Example response
{
"data": {
"brand": {
"id": "3f128a34-cc59-4b49-8883-23bf10e59c6c",
"name": "Retailer 1"
},
"company": {
"id": "3f128a34-cc59-4b49-8883-23bf10e59c6c",
"name": "Retailer 1"
},
"credit_uses": [
{
"payment": {
"company": {
"id": "3f128a34-cc59-4b49-8883-23bf10e59c6c",
"name": "Retailer 1"
}
}
}
],
"payment": {
"company": {
"id": "3f128a34-cc59-4b49-8883-23bf10e59c6c",
"name": "Retailer 1"
}
},
"return": {
"company": {
"id": "3f128a34-cc59-4b49-8883-23bf10e59c6c",
"name": "Retailer 1"
}
}
}
}Changes
- info
added the required property
//to the response with the status - info
added the required property
//to the response with the status - info
added the required property
//to the response with the status - info
added the required property
//to the response with the status
- info
- info
added the new optional request property
- info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status
- info