API DeCA

Issuing, correcting and accessing your own recent documents.


Create document

POST
https://deca.sertecpesage.com
/api/v1/documents
Bearer

Send the complete transport details. The response is returned after the encrypted PDF has been generated and stored.

A non-null reference is unique per organization and environment. Repeating a reference with identical normalized data and metadata returns the original result within 24 hours (200), without issuing another PDF. A new creation returns 201. Different data or a reference owned by another credential returns 409 without disclosing documents. Deduplication is not guaranteed without a reference.

A reference whose result has expired returns 409 DOCUMENT_WINDOW_EXPIRED. A deleted document is not returned and its reference cannot be reused; the retry returns 404. Use the PUT endpoints for corrections.

You can request an sk_demo_ token without an account or a registered organisation. It lasts 24 hours from issuance and works only from the public IP that requested it. Changing network or IP requires another token. The demo adds demo: true, expires_at, qr_url (alias of url) and pdf_url (alias of pdf_download_url). document_locale is the language selected when requesting the token (es by default). Temporary data and PDFs are separate from the real archive and are not encrypted like real documents.

Create document › Request Body

transport_date
​string · date · required

Actual transport date in YYYY-MM-DD format; not the PDF creation timestamp.

​Shipper · required

Contractual shipper; may differ from the origin warehouse and the DeCA customer.

​Carrier · required

Carrier actually performing the transport, including subcontractors.

​TransportLocation · required
​TransportLocation · required
​Goods · required

Nature and weight of the goods, or an alternative measurement where applicable. Send exactly one measurement.

​Vehicle · required

Actual vehicle; if a trailer or semi-trailer is present, supply both trailer fields together.

reference
​string | null · minLength: 1 · maxLength: 120 · pattern: ^[A-Za-z0-9-]+(?![\s…

Optional customer reference, unique per organization and environment and printed on the PDF. Identifies retries and allows retrieval by reference. It is not released when the document is deleted.

​SpecialAuthorization

Special circulation authorization when required. Omit or send null if not applicable.

Value for testing
observations
​string | null · maxLength: 4000

Remarks requested by the parties for inclusion in the document.

​object | null

Optional JSON object, retained and returned without semantic changes. Not printed on the PDF. Maximum serialized size 16 KiB and nesting depth 8.

Create document › Responses

Idempotent retry; returns the original result without generating another PDF.

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · Required fields: uuid, reference, created_at +7 more
type = object · Required fields: uuid, reference, created_at +11 more
Properties for Variant 1:
uuid
​string · uuid · required

UUID of the issued document.

reference
​string | null · pattern: ^[A-Za-z0-9-]+(?![\s… · required

Customer reference or null.

created_at
​string · date-time · required

Original creation timestamp, in UTC.

url
​string · uri · required

Full HTTPS QR download URL including its secret. Do not log or publish it.

​object · required
pdf_download_url
​string · uri · required

Authenticated download URL; requires the owning credential's Bearer within 24 hours.

rectifies_uuid
​string | null · uuid · required

Corrected UUID, or null for an initial issue.

​CreateDocumentRequest · required
​object | null · required

The request's unchanged metadata; null if omitted.

document_locale
​string · enum · required

PDF language selected from the organization at issue time. Preserved in the result; changing the organization language does not modify existing documents. Does not change JSON fields or API error messages.

Enum values:
es
ca
gl
ca-valencia
eu
en
pt-pt
fr

Correct document

PUT
https://deca.sertecpesage.com
/api/v1/documents/{uuid}
Bearer

Identify the previous document by UUID and send all corrected details, without patches. Only the latest version belonging to the same credential can be corrected. Documents older than 24 hours can be corrected without returning their previous content. A deleted document returns 404 and cannot be corrected.

A corrective document is generated with a new UUID, PDF and QR; the original and its QR are retained. Give the new PDF to the driver. The request body's reference identifies the new version, not the document in the URL.

Repeating the same PUT with identical normalized data and metadata returns the already-issued correction within 24 hours of its creation, without generating another version. This check occurs before rejecting an already-corrected document and also works when the retry identifies the same document by reference. Changing data on an already-corrected document returns 409. An expired retry result returns 409 DOCUMENT_WINDOW_EXPIRED. If the returned correction is deleted, the retry returns 404. For another correction, use the UUID or reference of the latest version.

Correct document › Path parameters

uuid
​string · uuid · required

Public document UUID. Alternatively, use /api/v1/documents/ref/{reference} with the same method. Example: /api/v1/documents/ref/EXP-2026-004587.

Correct document › Request Body

All corrected transport details. The previous document is identified in the URL. If reference is supplied, it must be a new reference for the corrective document.
transport_date
​string · date · required

Actual transport date in YYYY-MM-DD format; not the PDF creation timestamp.

​Shipper · required

Contractual shipper; may differ from the origin warehouse and the DeCA customer.

​Carrier · required

Carrier actually performing the transport, including subcontractors.

​TransportLocation · required
​TransportLocation · required
​Goods · required

Nature and weight of the goods, or an alternative measurement where applicable. Send exactly one measurement.

​Vehicle · required

Actual vehicle; if a trailer or semi-trailer is present, supply both trailer fields together.

reference
​string | null · minLength: 1 · maxLength: 120 · pattern: ^[A-Za-z0-9-]+(?![\s…

Optional new reference for the corrective document, unique per organization and environment. Do not reuse the reference of the document identified in the URL.

​SpecialAuthorization

Special circulation authorization when required. Omit or send null if not applicable.

Value for testing
observations
​string | null · maxLength: 4000

Remarks requested by the parties for inclusion in the document.

​object | null

Optional JSON object, retained and returned without semantic changes. Not printed on the PDF. Maximum serialized size 16 KiB and nesting depth 8.

Correct document › Responses

Corrective document issued, or an identical retry result without creating another version.

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · Required fields: uuid, reference, created_at +7 more
type = object · Required fields: uuid, reference, created_at +11 more
Properties for Variant 1:
uuid
​string · uuid · required

UUID of the issued document.

reference
​string | null · pattern: ^[A-Za-z0-9-]+(?![\s… · required

Customer reference or null.

created_at
​string · date-time · required

Original creation timestamp, in UTC.

url
​string · uri · required

Full HTTPS QR download URL including its secret. Do not log or publish it.

​object · required
pdf_download_url
​string · uri · required

Authenticated download URL; requires the owning credential's Bearer within 24 hours.

rectifies_uuid
​string | null · uuid · required

Corrected UUID, or null for an initial issue.

​CreateDocumentRequest · required
​object | null · required

The request's unchanged metadata; null if omitted.

document_locale
​string · enum · required

PDF language selected from the organization at issue time. Preserved in the result; changing the organization language does not modify existing documents. Does not change JSON fields or API error messages.

Enum values:
es
ca
gl
ca-valencia
eu
en
pt-pt
fr

Delete document

DELETE
https://deca.sertecpesage.com
/api/v1/documents/{uuid}
Bearer

Logical deletion to correct errors found when generating a document, exclusively before handing it to the carrier or driver and before using it for transport. The integration must confirm both conditions; being within the time limit is not enough. If the document has already been handed over or used, correct it with PUT.

Allowed only while the server time is earlier than created_at + 2 hours; it is no longer allowed at exactly 2 hours. Neither retrieval nor retries restart the period. Each version uses its own creation time. Only the latest version belonging to the authenticated credential can be deleted.

The PDF, data and audit trail are retained, but the document disappears from the list. UUID/reference retrieval, authenticated download, QR access and retries that would return its content respond with 404. The status endpoint returns only status: deleted within the 24-hour read window. The reference remains reserved. There is no reactivation endpoint; deletion retains the file to allow future recovery.

Repeating DELETE within the same 2 hours returns 204 without changing the deletion time. After that period it returns 409.

The first successful access through the QR link also blocks deletion with 409 DOCUMENT_ALREADY_ACCESSED. This access alone does not prove that transport has taken place.

Delete document › Path parameters

uuid
​string · uuid · required

Public document UUID. Alternatively, use /api/v1/documents/ref/{reference} with the same method. Example: /api/v1/documents/ref/EXP-2026-004587.

Delete document › Request Body

reason
​string · minLength: 1 · maxLength: 2000 · required

Reason for the error detected while generating the document.

confirm_not_delivered
​boolean · required

Must be true to delete: confirms it has not been handed to the carrier or driver. false returns 409 DOCUMENT_ALREADY_DELIVERED.

confirm_not_used
​boolean · required

Must be true to delete: confirms it has not been used for transport. false returns 409 DOCUMENT_ALREADY_USED.

Delete document › Responses

Document marked as deleted. No response body.

No data returned

List recent documents

GET
https://deca.sertecpesage.com
/api/v1/documents
Bearer

Returns summaries without the PDF, QR secret or metadata. The server always enforces the 24-hour window and credential isolation. Results are ordered by creation time descending, with UUID as a tie-breaker, page-based pagination and inclusive transport-date filters. The window is evaluated on every request; it does not provide a stable snapshot across pages. Historical access is unavailable.

Deleted documents do not appear in the list.

List recent documents › Query parameters

page
​integer · min: 1

Requested page, starting at 1.

Default: 1
limit
​integer · min: 1 · max: 100

Documents per page, from 1 to 100.

Default: 25
from
​string · date

Earliest transport date, inclusive. Does not extend the read window.

to
​string · date

Latest transport date, inclusive; must be on or after from.

List recent documents › Responses

Page of recent documents. A page without results has an empty data array.

​DocumentSummary[] · required
​object · required

Retrieve document

GET
https://deca.sertecpesage.com
/api/v1/documents/{uuid}
Bearer

Retrieves the original result within 24 hours, only for the credential that issued the document. Includes all accepted and normalized fields and semantically unchanged metadata.

A nonexistent UUID or reference, one belonging to another credential or one outside the window returns the same 404, without confirming existence or ownership. Each reference identifies its own version and does not redirect to a later correction.

A deleted document returns 404. Use the status endpoint to check whether it has been deleted.

Retrieve document › Path parameters

uuid
​string · uuid · required

Public document UUID. Alternatively, use /api/v1/documents/ref/{reference} with the same method. Example: /api/v1/documents/ref/EXP-2026-004587.

Retrieve document › Responses

Original document result.

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · Required fields: uuid, reference, created_at +7 more
type = object · Required fields: uuid, reference, created_at +11 more
Properties for Variant 1:
uuid
​string · uuid · required

UUID of the issued document.

reference
​string | null · pattern: ^[A-Za-z0-9-]+(?![\s… · required

Customer reference or null.

created_at
​string · date-time · required

Original creation timestamp, in UTC.

url
​string · uri · required

Full HTTPS QR download URL including its secret. Do not log or publish it.

​object · required
pdf_download_url
​string · uri · required

Authenticated download URL; requires the owning credential's Bearer within 24 hours.

rectifies_uuid
​string | null · uuid · required

Corrected UUID, or null for an initial issue.

​CreateDocumentRequest · required
​object | null · required

The request's unchanged metadata; null if omitted.

document_locale
​string · enum · required

PDF language selected from the organization at issue time. Preserved in the result; changing the organization language does not modify existing documents. Does not change JSON fields or API error messages.

Enum values:
es
ca
gl
ca-valencia
eu
en
pt-pt
fr

Retrieve status

GET
https://deca.sertecpesage.com
/api/v1/documents/{uuid}/status
Bearer

Returns only the status of a document belonging to the authenticated credential, within 24 hours of creation. A deleted document returns 200 with {"status":"deleted"}; no transport data, PDF, QR link or metadata is returned. An active document returns {"status":"active"}.

A nonexistent UUID, one belonging to another credential or one outside the 24-hour window returns the same 404. Deletion does not extend this window.

Retrieve status › Path parameters

uuid
​string · uuid · required

Public document UUID. Alternatively, use GET /api/v1/documents/ref/{reference}/status. Example: /api/v1/documents/ref/EXP-2026-004587/status.

Retrieve status › Responses

Document status without its content.

status
​string · enum · required

Document status. Does not include transport data, PDF, QR, metadata or dates.

Enum values:
active
deleted

Download PDF

GET
https://deca.sertecpesage.com
/api/v1/documents/{uuid}/pdf
Bearer

Returns the exact bytes of the stored PDF without regenerating it. Requires the owning credential and a document age of less than 24 hours. This limit does not affect legal retention or QR validity.

A deleted document returns 404 without delivering the PDF.

Download PDF › Path parameters

uuid
​string · uuid · required

Public document UUID. Alternatively, use GET /api/v1/documents/ref/{reference}/pdf. Example: /api/v1/documents/ref/EXP-2026-004587/pdf.

Download PDF › Responses

Original native PDF, up to 5 MB. Direct download without regeneration.

string