POST
Adjust supplier debt
Company space For: Buyer, Accountant · Permission: purchase_debt_adjustments.create Conditions
  • The purchase must be a credit purchase whose status is pending, completed or closed.
  • The purchase must have a recognized supplier invoice (invoiced_at and invoice_total set).
  • The remaining amount of the purchase, recalculated first, must be above zero.
  • amount must be above zero and cannot exceed the remaining amount of the purchase, nor the supplier invoice total minus what was already adjusted.
  • amount cannot have more decimals than the currency exponent.
  • adjusted_at and adjustment_date are refused: the date is set by the server.
What else happens
  • Records the adjustment with the current time and the signed-in member.
  • Adds the amount to the purchase’s amount_debt_adjusted and recalculates its amount paid, remaining amount and payment status; the amount owed to the supplier goes down.
  • No accounting entry is posted by this action.
Part of Pay suppliers and adjust debt.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

purchase
string
required

Identifier of the purchase (27-character KSUID).

Query Parameters

response
enum<string>
default:none

Response mode. Default none; none answers 204 No Content.

Available options:
none,
resource
fields
string

Comma-separated JSON keys of the root resource (id is always rendered). Available: id, purchase_id, vendor_id, amount, reason, adjusted_at, created_by_user_id, created_at, updated_at.

include
string

Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: purchase, purchase.items, purchase.debtAdjustments, purchase.returns, purchase.pickups, purchase.deliveries, purchase.vendor.

Body

application/json
amount
number
required

Amount to take off the debt, in major units, above zero, with at most as many decimals as the currency exponent. It cannot exceed the remaining amount of the purchase nor the part of the supplier invoice not yet adjusted.

reason
string
required

Why the debt is reduced, for example a negotiated discount. Up to 255 characters.

Maximum string length: 255
adjusted_at
string

Not accepted: the adjustment date is set by the server to the time of the call.

adjustment_date
string

Not accepted: the adjustment date is set by the server to the time of the call.

Response

Resource (only with response=resource).

id

Identifier of the debt adjustment (27-character KSUID string).

purchase_id

Identifier of the purchase whose debt was reduced.

vendor_id

Identifier of the supplier of the purchase, copied from it when the adjustment was created.

amount
number

Amount by which the debt was reduced in major units (the minor-unit amount divided by 10 to the power currency_exponent).

reason

Reason given for the reduction, for example a negotiated discount.

adjusted_at

Date and time the adjustment was recorded (ISO 8601). Set by the server.

created_by_user_id

Identifier of the member who recorded the adjustment; null when no signed-in member was known.

purchase
object

The adjusted purchase. Present only when requested with include=purchase.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).