POST /v1/invoices/inbound/{id}/status
const url = 'https://api.asap.cool/v1/invoices/inbound/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/status';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"action":"approve","reason":"example","reason_code":"TX_TVA_ERR"}'};
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/inbound/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/status \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "action": "approve", "reason": "example", "reason_code": "TX_TVA_ERR" }'Authorizations
Section intitulée « Authorizations »Parameters
Section intitulée « Parameters »Path Parameters
Section intitulée « Path Parameters »Inbound record identifier.
Request Bodyrequired
Section intitulée « Request Bodyrequired »Body of POST /v1/invoices/inbound/{id}/status.
object
The decision.
Motive, mandatory for refuse and dispute (at most 1000
characters); ignored for the other actions.
Responses
Section intitulée « Responses »Decision recorded; its submission to the platform is queued.
Public projection of an [InboundRecord].
Light by design: the structured CII XML and the integrity digest are not surfaced; the readable PDF is referenced by its object-store key.
object
Size in bytes of the stored object, when known.
RFC3339 creation timestamp.
Invoice currency code (BT-5), when parsed.
Payment due date as ISO YYYY-MM-DD (BT-9), when parsed.
Stable identifier.
RFC3339 import timestamp, when set.
Invoice number extracted from the CII (BT-1), when parsed.
Issue date as ISO YYYY-MM-DD (BT-2), when parsed.
CII parse outcome: 'parsed', 'parse_failed', 'pdf_only' (a PDF
with no embedded CII) or 'pending'.
Origin of the PDF the /pdf route serves.
Object-store key of the readable PDF, when stored.
RFC3339 reception timestamp (as reported by the PA), when known.
What the org decided about the invoice.
Motive of a refusal or dispute.
Coded motive (MDT-113, AFNOR XP Z12-012) of a refusal or dispute; absent on decisions taken before the code was required.
Seller name extracted from the CII (BT-27), when parsed.
SIREN of the sender, when provided.
Failure code when submission_state is error: not_connected,
rejected or enqueue_failed.
Whether the decision has reached the platform.
RFC3339 time the platform accepted the decision.
Total amount without VAT in cents (BT-109), when parsed.
Grand total with VAT in cents (BT-112), when parsed.
Total VAT amount in cents (BT-110), when parsed.
PA-assigned transmission id.
Example
{ "pdf_origin": "received", "received_lifecycle": "received", "submission_state": "none"}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"}The action does not follow from the invoice’s state, or the previous decision is still being sent.
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 or oversized reason, or missing reason code.
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"}