Skip to main content

What you can do

Upload a CSV or Excel file and receive an uploadId. Use this ID to import a Shipment Manifest or NCTS Departure Goods. Uploading a file does not create a Declaration or Transit Declaration. You must make a separate import request to process the uploaded file.

Before you start

Make sure you have valid Eaze Customs API credentials and the X-Eaze-Client-Ref header.
Create Upload, Complete Upload, and Get Upload currently require the ncts module on the credential, including when the file is a Shipment manifest. A credential that only has import or export cannot call these routes.
The Excel content type is application/vnd.openxmlformats-officedocument.spreadsheetml.sheet. The file must be 20 MiB or smaller (20,971,520 bytes). The filename starts with a letter or number, is at most 200 characters, uses only letters, numbers, spaces, and . _ ( ) -, and does not contain ... The extension must match the content type: .csv or .xlsx.

Steps

1

Prepare the file

Read the file as bytes. byteLength is the exact size of those bytes. sha256 is the SHA-256 fingerprint of the same bytes, written as 64 lowercase hexadecimal characters.Calculate both values in your integration. Do not re-save or re-encode the file between the calculation and the upload.
2

Get an upload URL

Call Create Upload with purpose, filename, contentType, byteLength, and sha256. Send a new Idempotency-Key.The response status is pending. It includes upload.method, upload.url, and upload.requiredHeaders. The URL expires in 15 minutes.
3

Upload and verify

Send an HTTP PUT of the original bytes to upload.url. Set every header in requiredHeaders exactly as returned. This is not a multipart form upload.The storage service may answer HTTP 200 with an empty body. Do not parse that body as JSON. A successful PUT does not finish the Eaze Customs upload.Call Complete Upload. Eaze Customs checks the size, checksum, content type, and file structure. This check is not an antivirus scan. A successful completion returns status: available.Call Get Upload if you need to confirm readyForImport. That flag is true only when the status is available.
4

Import the file

Use the verified uploadId in Import Manifest or Import Departure Details. Then follow Operations.Each upload can be used for one import. That reservation stays even when the import fails or requires review. A second import needs a new upload and a new uploadId.

Working example

This example uses the same bytes for the fingerprint, the upload, and the import. The sample CSV is 73 bytes. Its SHA-256 is 4ea9a34e9b058915cb420a3b6f18fee40a6b877b0f330e33b5497c1fc0370a4d.
Replace shipmentId with the Shipment you created. HTTP 202 from the import means the file was accepted for processing. Read the Operation before you treat the import as successful. The full sequence is in Manifest Import and Examples. For a large file, hash and upload a stream of the same bytes. The fingerprint and byteLength must still describe the exact bytes you PUT.
A CSV file must be UTF-8 and must not contain NUL bytes. An Excel file must be a real .xlsx workbook. An NCTS goods file cannot contain more than 999 items in one house consignment. A Shipment manifest is checked against the Manifest Template later, during import.

Statuses and errors

Common failures: scanRequired is a legacy field. It is true while checking is still pending and false after a successful completion. It does not describe an antivirus scan. Optional local check, not an integration step: wc -c manifest.csv and shasum -a 256 manifest.csv show the same size and fingerprint your code should calculate. Next: Idempotency, then Shipments.