Create Payment
POST/api/purchase-invoices/:purchaseInvoiceId/payments
Record a payment against a purchase invoice.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Required: payment_type_id, amount. Payment date defaults to today if omitted. Amount must not exceed the remaining balance. Negative amounts are allowed for refunds (cannot exceed total paid).
Returns 422 when the invoice is a committed-spend (provisional) bill — payments are recorded against real supplier invoices only.
Approval policy:
While the bill-payment approval policy is enabled a payment must fit what remains of the bill's approved amount: an unapproved bill, a bill whose request is still pending, or a payment larger than the approved remainder returns 422 with code approval_required (or approval_pending while the request awaits approval). Refunds (negative amounts) are not gated.
Under a bill-payment approval policy the payment's currency_id must match the bill's currency; otherwise the request is refused with 422 approval_currency_mismatch.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.