POST /v1/invoices/{id}/payments
const url = 'https://api.asap.cool/v1/invoices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/payments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"amount":1,"method":"example","paid_at":"example","reference":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.asap.cool/v1/invoices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/payments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "amount": 1, "method": "example", "paid_at": "example", "reference": "example" }'Authorizations
Section intitulée « Authorizations »Parameters
Section intitulée « Parameters »Path Parameters
Section intitulée « Path Parameters »Document identifier.
Request Body required
Section intitulée « Request Body required »Body of POST /v1/invoices/{id}/payments. org_id is never accepted here.
object
Amount received, in cents (strictly positive).
Payment method (free-form), e.g. "virement".
Settlement date (YYYY-MM-DD); defaults to now when omitted.
Free-form payment reference.
Example generated
{ "amount": 1, "method": "example", "paid_at": "example", "reference": "example"}Responses
Section intitulée « Responses »Payment recorded; balance/status recomputed.
The recomputed balance/status returned after a record or delete.
object
The recorded payment (present on record, absent on delete).
object
Amount received, in cents.
RFC3339 creation timestamp.
Document the payment settles.
Stable identifier.
Payment method (free-form).
RFC3339 settlement timestamp.
Free-form payment reference.
total_ttc - total_paid, in cents (negative on overpayment).
Document status after the automatic paid/sent transition.
Sum of all payments against the document, in cents.
Example generated
{ "payment": { "amount": 1, "created_at": "example", "document_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "method": "example", "paid_at": "example", "reference": "example" }, "remaining_due": 1, "status": "example", "total_paid": 1}No active org.
Generic error body returned by API handlers when they fail. code is a
stable machine-readable token; message is human-friendly and meant for
surfacing to end users.
object
Stable machine token (e.g. invalid_credentials).
Offending request field for validation errors, when known.
Human-readable message.
Example generated
{ "code": "example", "field": "example", "message": "example"}Missing invoice:write scope.
Generic error body returned by API handlers when they fail. code is a
stable machine-readable token; message is human-friendly and meant for
surfacing to end users.
object
Stable machine token (e.g. invalid_credentials).
Offending request field for validation errors, when known.
Human-readable message.
Example generated
{ "code": "example", "field": "example", "message": "example"}Not found or cross-org.
Generic error body returned by API handlers when they fail. code is a
stable machine-readable token; message is human-friendly and meant for
surfacing to end users.
object
Stable machine token (e.g. invalid_credentials).
Offending request field for validation errors, when known.
Human-readable message.
Example generated
{ "code": "example", "field": "example", "message": "example"}Invalid amount/date, or the document is not payable (quote/draft/terminal).
Generic error body returned by API handlers when they fail. code is a
stable machine-readable token; message is human-friendly and meant for
surfacing to end users.
object
Stable machine token (e.g. invalid_credentials).
Offending request field for validation errors, when known.
Human-readable message.
Example generated
{ "code": "example", "field": "example", "message": "example"}