Attach a customs declaration to a bill

Attaches a customs declaration to a courier's bill through the app's declaration service: an inbox document by document_extraction_id, or a PDF, JPEG or PNG inline in content_base64 (at most 700 KiB decoded; a larger file goes to the document inbox through an upload session first). An inbox document also needs view_document_extractions and, for an API credential, the document-extractions:read scope, else 403 document_source_forbidden; it is refused not_a_declaration or document_booked (422), and already_attached (409) when it is on another bill. The same document attached to the same bill again answers 200 with that declaration; a new one answers 201. It is read and checked against the bill; poll customs.show for the result. A bill with no customs record is refused not_a_customs_bill; while held import VAT is not on for the company, customs_off. Requires Idempotency-Key, the bills:action OAuth scope and update_bills.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
Body Params

Fields accepted to attach a customs declaration to a bill. The schema identifies required and optional values.

customs.declaration.attach: the customs declaration as an inbox document
(document_extraction_id) or as a small file inline (file_name,
file_mime, content_base64, at most 700 KiB decoded), one of the two.
A larger file goes to the document inbox through an upload session first
and is attached by its document_extraction_id. The route's
update_bills is the gate; an inbox document also needs
view_document_extractions and, for an API credential, the
document-extractions:read scope, checked in the controller.

uuid

An inbox document holding the declaration. Or send the file inline.

string
length ≤ 255

The declaration's file name, e.g. declaration.pdf.

string
enum
Allowed:
string
length ≤ 955736

Standard base64, no data: prefix; at most 700 KiB decoded.

string | null
^[A-Fa-f0-9]{64}$

Hex SHA-256 of the file; refused when it does not match.

Headers
string
required
length ≤ 191

Required unique key whose request hash and terminal response are stored durably for 24 hours.

Responses

Language
Credentials
OAuth2
Missing 1 required scope
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
*/*