Record a payment
Records one payment on a sent invoice. Part payments are allowed; the invoice becomes paid when nothing is
outstanding.
The payment’s id is derived from the API client’s grant and the Idempotency-Key, so one key names one
payment for as long as the invoice exists. The same key on the same invoice answers 201 with the existing
payment and records nothing twice, also after the key’s 7 days have passed. The same key on another invoice is
422 idempotency-key-reused, at any age.
Authorizations
OAuth 2.0 client credentials. The token request also needs the audience form field (the Account ID), which OAuth tooling does not always send; see POST /v1/oauth/token.
Headers
Required on every POST, at most 255 characters. Use a new UUID for each logical operation. The first request with a key runs, and its answer (any status below 500) is stored for 7 days. A retry with the same key, method, path and body gets the stored answer again with Idempotency-Replayed: true, and nothing runs twice. The same key with a different body or path is 422 idempotency-key-reused; the same key while the first request is still running is 409 idempotency-key-in-progress. A 5xx answer is not stored, so the same key may be retried. A key belongs to the API client's grant (one environment).
255Path Parameters
The invoice's id.
Body
The payment.
Response
The payment and the invoice's new balance.
A recorded payment and the invoice's new balance.
The payment's id. The same Idempotency-Key on the same invoice always gives the same id.
The invoice's status after the payment, for example paid.
How much has been paid on the invoice in all.
How much is still owed.