Skip to content
On this page

AdvancedFeatures

Credit notes and invoice templates

List credit notes for the authenticated organization

GET /api/v1/credit-notes

Requires authentication (Bearer token) and the X-Organization-Id header.

Returns paginated credit notes filtered by organization_id, eager-loading the customer and original invoice relationships.

Parameters

Name In Type Required Description
per_page query string no

Responses

Status Description
200 For non-paginated data, return as before

Example request

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

Requires authentication (Bearer token) and the X-Organization-Id header.

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)

Request body

Field Type Required Description
invoice_id integer yes
amount number yes
reason string yes
credit_type string no
credit_note_type_code string no

Responses

Status Description
201 For non-paginated data, return as before
422

Example request

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}

Requires authentication (Bearer token) and the X-Organization-Id header.

Single-resource fetch mirroring the invoice/quote detail endpoints; includes items, customer and original_invoice. (#892)

Parameters

Name In Type Required Description
id path integer yes

Responses

Status Description
200 For non-paginated data, return as before

Example request

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

Requires authentication (Bearer token) and the X-Organization-Id header.

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)

Parameters

Name In Type Required Description
id path integer yes

Responses

Status Description
200

Example request

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

Requires authentication (Bearer token) and the X-Organization-Id header.

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)

Parameters

Name In Type Required Description
id path integer yes

Request body

Field Type Required Description
resend boolean no
contact_ids array no

Responses

Status Description
200 For non-paginated data, return as before
422
409

Example request

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

Requires authentication (Bearer token) and the X-Organization-Id header.

Responses

Status Description
501

Example request

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

Requires authentication (Bearer token) and the X-Organization-Id header.

Responses

Status Description
501

Example request

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

Requires authentication (Bearer token) and the X-Organization-Id header.

Parameters

Name In Type Required Description
templateId path integer yes

Responses

Status Description
501

Example request

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"

We use cookies and privacy-respecting analytics

We use essential cookies for authentication and privacy-respecting analytics (self-hosted, respects Do Not Track). No advertising or third-party tracking. Learn more in our Privacy Policy