AdvancedFeatures
Credit notes and invoice templates
List credit notes for the authenticated organization#
GET /api/v1/credit-notes
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Returns paginated credit notes filtered by organization_id,
eager-loading the customer and original invoice relationships.
Paramètres#
| Nom |
Emplacement |
Type |
Requis |
Description |
per_page |
query |
string |
non |
|
Réponses#
| Statut |
Description |
| 200 |
For non-paginated data, return as before |
Exemple de requête#
curl -X GET "https://app.encryptinvoice.com/api/v1/credit-notes" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Create a credit note from an invoice#
POST /api/v1/credit-notes
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Quick-create linked to an existing invoice (invoice_id, amount, reason, optional credit_type). Optional credit_note_type_code sets the UNCL1001 type code used in the credit-note UBL at send time: FR-domestic routes (French seller and French customer) accept 261, 262, 381, 396, 502, 503; every other route accepts the Peppol BIS list 81, 83, 381, 396, 532 (422 otherwise). Omitted = 381 at send time. (#957)
Corps de la requête#
| Champ |
Type |
Requis |
Description |
invoice_id |
integer |
oui |
|
amount |
number |
oui |
|
reason |
string |
oui |
|
credit_type |
string |
non |
|
credit_note_type_code |
string |
non |
|
Réponses#
| Statut |
Description |
| 201 |
For non-paginated data, return as before |
| 422 |
|
Exemple de requête#
curl -X POST "https://app.encryptinvoice.com/api/v1/credit-notes" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"invoice_id": 1,
"amount": 1,
"reason": "string",
"credit_type": "string",
"credit_note_type_code": "string"
}'
Show a credit note with its line items#
GET /api/v1/credit-notes/{id}
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Single-resource fetch mirroring the invoice/quote detail endpoints; includes items, customer and original_invoice. (#892)
Paramètres#
| Nom |
Emplacement |
Type |
Requis |
Description |
id |
path |
integer |
oui |
|
Réponses#
| Statut |
Description |
| 200 |
For non-paginated data, return as before |
Exemple de requête#
curl -X GET "https://app.encryptinvoice.com/api/v1/credit-notes/{id}" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Download the credit-note PDF#
GET /api/v1/credit-notes/{id}/pdf
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Binary PDF, like the invoice/quote PDF endpoints. FNE (Côte d'Ivoire) organizations get the regulatory CI template with stamping/QR data automatically. (#892)
Paramètres#
| Nom |
Emplacement |
Type |
Requis |
Description |
id |
path |
integer |
oui |
|
Réponses#
Exemple de requête#
curl -X GET "https://app.encryptinvoice.com/api/v1/credit-notes/{id}/pdf" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Send the credit note to the customer#
POST /api/v1/credit-notes/{id}/send
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Delivers via the secure document portal + email. Optional recipients[] (defaults to the customer email) and message. A draft credit note is marked sent only after at least one successful delivery; total delivery failure returns 422 with per-recipient errors. (#892)
Paramètres#
| Nom |
Emplacement |
Type |
Requis |
Description |
id |
path |
integer |
oui |
|
Corps de la requête#
| Champ |
Type |
Requis |
Description |
resend |
boolean |
non |
|
contact_ids |
array |
non |
|
Réponses#
| Statut |
Description |
| 200 |
For non-paginated data, return as before |
| 422 |
|
| 409 |
|
Exemple de requête#
curl -X POST "https://app.encryptinvoice.com/api/v1/credit-notes/{id}/send" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"resend": true,
"contact_ids": []
}'
List templates#
GET /api/v1/templates
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Réponses#
Exemple de requête#
curl -X GET "https://app.encryptinvoice.com/api/v1/templates" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Create invoice template#
POST /api/v1/templates
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Réponses#
Exemple de requête#
curl -X POST "https://app.encryptinvoice.com/api/v1/templates" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Create invoice from template#
POST /api/v1/templates/{templateId}/create-invoice
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Paramètres#
| Nom |
Emplacement |
Type |
Requis |
Description |
templateId |
path |
integer |
oui |
|
Réponses#
Exemple de requête#
curl -X POST "https://app.encryptinvoice.com/api/v1/templates/{templateId}/create-invoice" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"