Purchase

Insert a payment for a purchase

Record a payment made against a purchase order. Each call adds one payment; there is no upsert here, so calling it again adds another payment rather than editing an existing one. The response is the created payment.

The payment rolls up into the purchase: the purchase's paid total increases by this amount and its payment_status is recomputed (NOT_PAID → PARTIALLY_PAID → FULLY_PAID, or OVER_PAID if payments exceed the total). Fetch the purchase again to observe the new totals. If your company is integrated with QuickBooks Online, the payment is also recorded against the linked bill, paid from the deposit account you supply or, when you supply none, from the company's Purchase Deposit Account.

A 404 is returned if the purchase does not exist or is not in your company, and a 403 if the authenticated user cannot view it under their team restrictions. A DRAFT purchase is rejected with a 400.

Required permission: purchases_permissions_make_payments. The authenticated user must also be allowed to view purchases under their team restrictions.

post/public/v1/purchases/{id}/payments

Request

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

Path parameters

idstring required

The purchase's ID — the id returned by the list and show purchase endpoints.

Request body

payment_method_idstring required

ID of the payment method this payment was made with (e.g. cash, check, ACH). Must reference an existing payment method in your company.

amountnumber required

Amount of the payment in the purchase's currency, rounded to 2 decimal places. Adds to the purchase's paid total; exceeding the purchase total leaves it OVER_PAID.

payment_datetimestring required

The datetime the payment was made, as a full ISO8601 datetime (e.g. 2026-08-18T00:00:00Z).

descriptionstring required

A free-text note describing the payment.

quickbooks_deposit_account_idstring

QuickBooks Online deposit account ID: the account the payment is made from. Optional. Mutually exclusive with quickbooks_deposit_account_name — sending both is rejected. When your company is connected to QuickBooks Online and you send neither, the payment is made from the company's Purchase Deposit Account (Settings → QuickBooks); when that account is missing, not active or not of an allowed type, the request is rejected with a base error naming it — send an account then. With no Purchase Deposit Account set, sending neither is rejected on both deposit account fields. When your company is not connected to QuickBooks Online, sending this is rejected. The account must be active and of type "Bank" or "Credit Card".

quickbooks_deposit_account_namestring

QuickBooks Online deposit account name. Optional. Mutually exclusive with quickbooks_deposit_account_id — sending both is rejected. Omit both to use the company's Purchase Deposit Account (see quickbooks_deposit_account_id). A name containing : is a sub-account's full name (Parent:Child) and matches that account exactly; it must itself be active and of type "Bank" or "Credit Card". Any other name matches among active "Bank" and "Credit Card" accounts: a top-level account with that name (its full name) wins; otherwise the one sub-account with that short name. A short name shared by several such sub-accounts is rejected with a message listing their full names — send the full name instead. When the top-level account with that name is inactive or of another type and a sub-account shares its name, the request is rejected with a message naming that sub-account's full name, rather than paying from it. When your company is not connected to QuickBooks Online, sending this is rejected.

Response

A single payment

Example response

{
  "data": {
    "company": {
      "id": "3f128a34-cc59-4b49-8883-23bf10e59c6c",
      "name": "Retailer 1"
    }
  }
}

Changes

No recorded changes to this operation across all 17 revisions of this API.