POST /v1/invoices
const url = 'https://api.asap.cool/v1/invoices';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"contact_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","delivery_address":"example","deposit_request_percentage":"example","description":"example","discount_terms":"example","due_date":"example","execution_timeline":"example","items":[{"description":"example","details":"example","kind":"example","position":1,"quantity":"example","unit":"example","unit_price":1,"vat_rate":"example"}],"notes":"example","operation_nature":"example","payment_method":"example","payment_plan":{"count":1,"kind":"example","percentage":"example"},"payment_terms":"example","service_date":"example","title":"example","type":"example","validity_date":"example","vat_exigibility":"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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "contact_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "delivery_address": "example", "deposit_request_percentage": "example", "description": "example", "discount_terms": "example", "due_date": "example", "execution_timeline": "example", "items": [ { "description": "example", "details": "example", "kind": "example", "position": 1, "quantity": "example", "unit": "example", "unit_price": 1, "vat_rate": "example" } ], "notes": "example", "operation_nature": "example", "payment_method": "example", "payment_plan": { "count": 1, "kind": "example", "percentage": "example" }, "payment_terms": "example", "service_date": "example", "title": "example", "type": "example", "validity_date": "example", "vat_exigibility": "example" }'Authorizations
Section intitulée « Authorizations »Request Bodyrequired
Section intitulée « Request Bodyrequired »Body of POST /v1/invoices. org_id is never accepted here.
object
Target contact id.
Delivery address (JSONB).
Deposit requested at order time, percentage token ([0, 100]).
Quote-oriented mention.
Long description.
Early-settlement discount mention (art. L441-9). When omitted, the org
default (invoice.settings.default_discount_terms) is applied.
Due date (YYYY-MM-DD).
Delivery / execution timeline (free-form). Quote-oriented mention.
Line items (at least one).
One line item in a create request.
object
Line description.
Long description printed under the label. Optional free text.
product (default) or discount. A discount nets its unit_price off
the document; it must carry the VAT rate of a line it reduces and cannot
exceed the subtotal at that rate.
Ordering position within the document (defaults to array index).
Quantity (decimal token, strictly positive). Ignored on a discount
line, which is always stored with -1.
Unit-of-measure code (UN/ECE Rec 20, e.g. C62). Optional; defaults to
C62 at render/CII time when absent.
Unit price excluding VAT, in cents (>= 0). On a discount line this is
the discounted amount, strictly positive — the sign is never supplied by
the client.
VAT rate as a percentage token ([0, 100]).
Free-form notes.
Operation nature (biens/services/mixte).
Payment method.
Quote payment plan driving post-signature auto-billing. Omitted = a
single facture (none).
object
Number of equal installments (>= 2). Required for installments;
ignored otherwise.
Plan kind: none | deposit_then_balance | installments.
Deposit share of the quote TTC as a decimal token in the strict
]0, 100[. Required for deposit_then_balance; ignored otherwise.
Payment terms.
Service/delivery date (YYYY-MM-DD).
Title.
Document kind (devis/facture/avoir/acompte).
Validity date (YYYY-MM-DD).
VAT chargeability basis (debits/encaissements).
Examplegenerated
{ "contact_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "delivery_address": "example", "deposit_request_percentage": "example", "description": "example", "discount_terms": "example", "due_date": "example", "execution_timeline": "example", "items": [ { "description": "example", "details": "example", "kind": "example", "position": 1, "quantity": "example", "unit": "example", "unit_price": 1, "vat_rate": "example" } ], "notes": "example", "operation_nature": "example", "payment_method": "example", "payment_plan": { "count": 1, "kind": "example", "percentage": "example" }, "payment_terms": "example", "service_date": "example", "title": "example", "type": "example", "validity_date": "example", "vat_exigibility": "example"}Responses
Section intitulée « Responses »Draft document created.
Public projection of a [Document]. content_hash/prev_hash are
surfaced as lowercase hex so clients can verify the NF203 seal.
object
Deposit share as a percentage of the parent quote.
Invoice this credit note offsets (1 max per invoice).
Frozen billable client snapshot (set at finalization).
Logical reference to a contact.
Displayable contact name (R5): the frozen client snapshot for a
finalized document, or a live join on the contact for a draft. None
when the contact no longer exists.
NF203 content hash (hex), set only at finalization.
Source quote when this invoice was converted from one.
RFC3339 creation timestamp.
Structured reason code for a credit note (avoir); None when absent.
Free-text detail accompanying the credit-note reason.
Delivery address (JSONB).
Deposit requested at order time, percentage (decimal token). Quote-oriented mention.
Long description.
Early-settlement discount mention (art. L441-9).
Due date (YYYY-MM-DD).
Delivery / execution timeline (free-form). Quote-oriented mention.
Finalization timestamp; non-null means the document is immutable.
Stable identifier.
Issue date (YYYY-MM-DD).
Line items (present on get/create/finalize, omitted on list).
Public projection of a [DocumentItem].
object
Line description.
Long description printed under the label. None when the line has none.
Stable identifier.
product (a billed line) or discount (a discount netted off the
document). A discount always reads back with quantity = "-1" and a
positive unit_price.
Ordering position within the document.
Quantity (decimal token).
Line total excluding VAT, in cents.
Line total including VAT, in cents.
Unit-of-measure code (UN/ECE Rec 20, e.g. C62). None for legacy
rows.
Unit price excluding VAT, in cents.
VAT rate as a percentage token.
RFC3339 timestamp of the last lifecycle update.
Human-readable reason for a negative lifecycle status.
Last observed regulatory lifecycle token.
Free-form notes.
Sequential number, set only at finalization.
Operation nature.
Parent quote for a deposit invoice.
Payment method.
Payment-plan JSON payload ({"percentage":"30"}/{"count":3}), null
for the none plan.
Quote payment-plan discriminant (none/deposit_then_balance/
installments) driving post-signature auto-billing.
Payment terms.
NF203 previous-link hash (hex).
Factur-X render lifecycle (pending/rendering/ready/failed).
The PDF is downloadable via GET /v1/invoices/{id}/pdf only when
this is ready (R8).
RFC3339 timestamp of the effective transition to sent, read-only;
None before any send.
Service/delivery date (YYYY-MM-DD).
Lifecycle status.
Title.
Total excluding VAT, in cents.
Total including VAT, in cents.
Total VAT, in cents.
PA-assigned transmission id, set once the invoice is transmitted.
E-invoicing transmission status toward the recipient’s PA
(not_required/pending/sending/sent/failed).
Document kind (devis/facture/avoir/acompte).
RFC3339 last-update timestamp.
Validity date (YYYY-MM-DD).
VAT chargeability basis.
Examplegenerated
{ "acompte_percentage": "example", "avoir_for_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "client_snapshot": "example", "contact_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "contact_name": "example", "content_hash": "example", "converted_from_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "created_at": "example", "credit_reason_code": "example", "credit_reason_text": "example", "delivery_address": "example", "deposit_request_percentage": "example", "description": "example", "discount_terms": "example", "due_date": "example", "execution_timeline": "example", "finalized_at": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "issue_date": "example", "items": [ { "description": "example", "details": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "kind": "example", "position": 1, "quantity": "example", "total_ht": 1, "total_ttc": 1, "unit": "example", "unit_price": 1, "vat_rate": "example" } ], "lifecycle_at": "example", "lifecycle_reason": "example", "lifecycle_status": "example", "notes": "example", "number": "example", "operation_nature": "example", "parent_devis_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "payment_method": "example", "payment_plan_config": "example", "payment_plan_kind": "example", "payment_terms": "example", "prev_hash": "example", "render_status": "example", "sent_at": "example", "service_date": "example", "status": "example", "title": "example", "total_ht": 1, "total_ttc": 1, "total_tva": 1, "transmission_id": "example", "transmission_status": "example", "type": "example", "updated_at": "example", "validity_date": "example", "vat_exigibility": "example"}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.
Examplegenerated
{ "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.
Examplegenerated
{ "code": "example", "field": "example", "message": "example"}Invalid document payload.
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.
Examplegenerated
{ "code": "example", "field": "example", "message": "example"}