Aller au contenu

POST /v1/invoices/{id}/send-for-payment

POST
/v1/invoices/{id}/send-for-payment
curl --request POST \
--url https://api.asap.cool/v1/invoices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/send-for-payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "email": "example" }'

Email a finalized, payable invoice/deposit to the client with an online payment link: the same transactional invoice email as /send, plus a primary “Pay online” call to action pointing at the public /pay/{token} page. Mints (or recovers) the durable payment-link token server-side and injects its URL into the email; the client can pay by card / SEPA without an account. Like /send, it flips the document to sent and arms the reminder ladder.

Same recipient/finalized guards as /send, plus the online-collection gate: Stripe must be configured (503 stripe_disabled) and the org must have a charges-enabled connected account (409 stripe_account_required / stripe_account_not_ready); a non-payable document is 409 not_payable.

id
required
string format: uuid

Document identifier.

Optional recipient override.

Media type application/json

Optional body for POST /v1/invoices/{id}/send.

object
email

Override the recipient email for this send only. When omitted (or blank), the document’s contact email is used. Does not mutate the contact — it just retargets delivery, e.g. to correct a wrong or missing address.

string | null
Example generated
{
"email": "example"
}

Invoice emailed with a payment link; document marked sent.

Media type application/json

Body of a successful send: the updated document plus a sent flag.

object
document
required

The document after the sent transition.

object
acompte_percentage

Deposit share as a percentage of the parent quote.

string | null
avoir_for_id

Invoice this credit note offsets (1 max per invoice).

string | null format: uuid
client_snapshot

Frozen billable client snapshot (set at finalization).

contact_id
required

Logical reference to a contact.

string format: uuid
contact_name

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.

string | null
content_hash

NF203 content hash (hex), set only at finalization.

string | null
converted_from_id

Source quote when this invoice was converted from one.

string | null format: uuid
created_at
required

RFC3339 creation timestamp.

string
credit_reason_code

Structured reason code for a credit note (avoir); None when absent.

string | null
credit_reason_text

Free-text detail accompanying the credit-note reason.

string | null
delivery_address

Delivery address (JSONB).

deposit_request_percentage

Deposit requested at order time, percentage (decimal token). Quote-oriented mention.

string | null
description

Long description.

string | null
discount_terms

Early-settlement discount mention (art. L441-9).

string | null
due_date

Due date (YYYY-MM-DD).

string | null
execution_timeline

Delivery / execution timeline (free-form). Quote-oriented mention.

string | null
finalized_at

Finalization timestamp; non-null means the document is immutable.

string | null
id
required

Stable identifier.

string format: uuid
issue_date
required

Issue date (YYYY-MM-DD).

string
items

Line items (present on get/create/finalize, omitted on list).

Array<object> | null

Public projection of a [DocumentItem].

object
description
required

Line description.

string
details

Long description printed under the label. None when the line has none.

string | null
id
required

Stable identifier.

string format: uuid
position
required

Ordering position within the document.

integer format: int32
quantity
required

Quantity (decimal token).

string
total_ht
required

Line total excluding VAT, in cents.

integer format: int64
total_ttc
required

Line total including VAT, in cents.

integer format: int64
unit

Unit-of-measure code (UN/ECE Rec 20, e.g. C62). None for legacy rows.

string | null
unit_price
required

Unit price excluding VAT, in cents.

integer format: int64
vat_rate
required

VAT rate as a percentage token.

string
lifecycle_at

RFC3339 timestamp of the last lifecycle update.

string | null
lifecycle_reason

Human-readable reason for a negative lifecycle status.

string | null
lifecycle_status

Last observed regulatory lifecycle token.

string | null
notes

Free-form notes.

string | null
number

Sequential number, set only at finalization.

string | null
operation_nature

Operation nature.

string | null
parent_devis_id

Parent quote for a deposit invoice.

string | null format: uuid
payment_method

Payment method.

string | null
payment_plan_config

Payment-plan JSON payload ({"percentage":"30"}/{"count":3}), null for the none plan.

payment_plan_kind
required

Quote payment-plan discriminant (none/deposit_then_balance/ installments) driving post-signature auto-billing.

string
payment_terms

Payment terms.

string | null
prev_hash

NF203 previous-link hash (hex).

string | null
render_status
required

Factur-X render lifecycle (pending/rendering/ready/failed). The PDF is downloadable via GET /v1/invoices/{id}/pdf only when this is ready (R8).

string
sent_at

RFC3339 timestamp of the effective transition to sent, read-only; None before any send.

string | null
service_date

Service/delivery date (YYYY-MM-DD).

string | null
status
required

Lifecycle status.

string
title

Title.

string | null
total_ht
required

Total excluding VAT, in cents.

integer format: int64
total_ttc
required

Total including VAT, in cents.

integer format: int64
total_tva
required

Total VAT, in cents.

integer format: int64
transmission_id

PA-assigned transmission id, set once the invoice is transmitted.

string | null
transmission_status
required

E-invoicing transmission status toward the recipient’s PA (not_required/pending/sending/sent/failed).

string
type
required

Document kind (devis/facture/avoir/acompte).

string
updated_at
required

RFC3339 last-update timestamp.

string
validity_date

Validity date (YYYY-MM-DD).

string | null
vat_exigibility

VAT chargeability basis.

string | null
scheduled_reminders
required

Number of reminders armed by this send (the future ladder occurrences persisted): payment reminders for a billing document, or quote-expiry reminders for a quote. 0 for documents that are not chased (credit notes, no anchor date, or a fully-past ladder) or when scheduling was skipped because reminders already existed.

integer format: int32
sent
required

Always true on a 200 response.

boolean
Example generated
{
"document": {
"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",
"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"
},
"scheduled_reminders": 1,
"sent": true
}

No active org.

Media type application/json

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
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Missing invoice:write scope.

Media type application/json

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
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Not found or cross-org.

Media type application/json

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
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Not finalized, not payable, or no charges-enabled connected account.

Media type application/json

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
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

No usable recipient email (no_recipient).

Media type application/json

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
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Stripe is not configured on this instance.

Media type application/json

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
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}