POST
Pay a vendor
Company space Cannot be undone For: Buyer, Accountant · Permission: vendors.retrieve, vendor_credit_payments.create Conditions
  • payment_method must be cash. money_account_id, currency_code, paid_at and payment_date are refused: the currency is the company’s and the date is the time of the call.
  • cash_register_id is required and must be a register of the company that has a cash account linked. Exowpee does not check that the register is open.
  • When purchase_order_ids is sent, each id must be unique and must be an invoiced credit purchase of this supplier in the company.
  • The whole amount must be applied: if it exceeds what is still owed on the targeted purchases, the call is refused and nothing is recorded.
What else happens
  • Creates the supplier payment, then allocates it purchase by purchase to credit purchases of the supplier that still have a remaining amount, ordered by due date, then creation date. A purchase’s share is capped at what it still owes.
  • Creates one purchase payment per purchase it settles, linked to the supplier payment and copying its method, register and reference.
  • Recalculates the amount paid, remaining amount and payment status of each purchase it settles.
  • 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

id
string
required

Identifier of the vendor (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, vendor_id, amount, currency_code, currency_exponent, paid_at, payment_method, cash_register_id, money_account_id, reference, notes, 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: purchasePayments, purchasePayments.purchase, purchases, purchases.items, purchases.debtAdjustments, purchases.returns, purchases.pickups, purchases.deliveries, purchases.vendor.

Body

application/json
amount
number
required

Amount paid to the supplier, in major units, above zero. It is spread over the supplier's unpaid credit purchases and cannot exceed what they still owe.

payment_method
enum<string>
required

Payment method to the supplier. Required; only cash is accepted for now, paid from the cash register named in cash_register_id.

Available options:
cash
cash_register_id
string
required

Identifier of the cash register paying (27-character KSUID string). Required; it must be a register of the current company with a cash account linked.

Required string length: 27
currency_code
string

Not accepted: the currency is the company's.

paid_at
string

Not accepted: the payment time is set by the server.

payment_date
string

Not accepted: the payment time is set by the server.

money_account_id
string

Not accepted: only cash payments from a cash register are enabled for now.

reference
string | null

Free reference for the payment, for example a receipt number. Up to 255 characters.

Maximum string length: 255
notes
string | null

Free notes about the payment.

purchase_order_ids
string[] | null

Identifiers of the credit purchases to settle. Each must be an invoiced credit purchase of this supplier, listed once. When omitted, the payment goes to all the supplier's credit purchases that still owe money, soonest due date first.

Response

Resource (only with response=resource).

id

Identifier of the supplier payment (27-character KSUID string).

vendor_id

Identifier of the supplier paid.

amount
number

Total amount paid in major units (the minor-unit amount divided by 10 to the power currency_exponent), using the payment's own currency_exponent.

currency_code

Three-letter currency code (the company currency).

currency_exponent
integer

Number of decimal places of the currency (0 for XOF). An amount in minor units divided by 10 to this power gives the amount in the currency.

paid_at

Date and time of the payment (ISO 8601). Set by the server.

payment_method

How the payment was made. Only cash is accepted today.

cash_register_id

Identifier of the cash register the money came from.

money_account_id

Identifier of the money account used. Always null for payments made through the API today.

reference

Free reference supplied with the payment.

notes

Free notes supplied with the payment.

purchase_payments
array

The payments created on each purchase this payment settled. Present only when requested with include=purchasePayments.

purchases
array

The purchases this payment settled. Present only when requested with include=purchases.

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).