Credit

Cancel (void) a credit. A canceled credit keeps its record and history and still appears in this API, but its status becomes CANCELED and its remaining balance can no longer be applied to invoices. The response returns the credit with its updated status.

By default the credit's existing applications to invoices (its credit uses) are left in place. Set should_delete_credit_uses to true to also remove those applications, returning the used amounts to the affected invoices and payments.

Overpayment credits (created from an invoice overpayment or a QuickBooks Online payment) cannot be canceled — void the associated payment instead, which returns an error here. Canceling an already-canceled credit returns an error, unless should_delete_credit_uses is true: that removes the applications an earlier cancel left in place, and keeps the credit's original canceled_at.

If your account syncs credits with QuickBooks Online, the cancellation is pushed to QuickBooks Online in the background; a 200 confirms the cancel in Distru, not that the QuickBooks Online side has finished. Credits do not touch inventory or state compliance (Metrc / BioTrack).

Required permission: credits_permissions_edit. The authenticated user must also have access to the credit under their team restrictions, otherwise the request returns 403.

post/public/v1/credits/{id}/cancel

Request

  • Base URL
    https://app.distru.com
  • Auth
    HTTP bearer

Path parameters

idstring required

The credit's ID (as returned in the id field of a credit).

Request body

should_delete_credit_usesboolean

When true, also removes this credit's existing applications to invoices (its credit uses), returning the used amounts to the affected invoices and payments. When false or omitted, those applications are left in place and only the remaining balance is voided. Defaults to false.

Example request

{
  "should_delete_credit_uses": false
}

Response

The canceled 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 data/creator/updated_datetime to the response with the status

    • info

      added the required property data/owner/updated_datetime to the response with the status

    • info

      added the optional property data/brand to the response with the status