Aller au contenu

POST /v1/invoices/{id}/duplicate

POST
/v1/invoices/{id}/duplicate
curl --request POST \
--url https://api.asap.cool/v1/invoices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/duplicate \
--header 'Authorization: Bearer <token>'
id
required
string format: uuid

Source document identifier.

New draft created from the source.

Media type application/json

Public projection of a [Document]. content_hash/prev_hash are surfaced as lowercase hex so clients can verify the NF203 seal.

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
Example generated
{
"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"
}

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"
}

Source 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"
}

Document type cannot be duplicated.

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"
}