API reference
Customs
Customs declarations for shipments that cross a border.
Create a customs declaration
POST /v1/customs/declarations
Describes what is in a cross-border shipment: each item's description, quantity, value, HS code, country of origin and weight. Pass the returned id as customs_declaration_id when you get rates and buy the label. Look up HS codes with GET /v1/public/hs-codes?q=… (add country=US for 10-digit US codes).
Request body
contents_type• Required stringmerchandise,documents,gift,commercial_sample,returned_goodsorother.declaration_currency• Required stringCurrency of the item values. Use one currency for the whole declaration.
from_country• Required stringShip-from country code.
incoterm• Required stringWho pays duties and taxes:
DAP(the recipient, on delivery) orDDP(you, prepaid with the label, whereGET /v1/shipments/duties-availabilitysays it is offered).items• Required array of objectsEvery item in the shipment.
Each item · 13
country_of_origin• Required stringTwo-letter code of the country where the item was made.
currency• Required stringThree-letter currency code, e.g.
CAD.description• Required stringWhat the item is, specifically ("cotton t-shirt", not "clothing").
hs_code• Required stringHarmonized System code. Find one with
GET /v1/public/hs-codes?q=….net_weight_g• Required integerWeight of all units of this item, in grams.
package_index• Required integerWhich box the item is in (from 0).
position• Required integerOrder of the item in the list (from 0).
quantity• Required integerHow many.
unit_value_cents• Required integerValue of one unit, in cents of
currency.gross_weight_gintegerWeight including packaging, in grams (optional).
hs_code_version_iduuidLeave out; set by the dashboard's HS-code picker.
manufacturer_countrystringCountry of the manufacturer, if different from the origin.
skustringYour product code.
signed_by• Required stringName of the person certifying the declaration.
to_country• Required stringShip-to country code.
hs_code_version_iduuidLeave out; set by the dashboard's HS-code picker.
invoice_datedateInvoice date (
YYYY-MM-DD).invoice_numberstringYour commercial invoice or order number.
non_delivery_optionstringIf it cannot be delivered:
return(default) orabandon.reason_for_exportstringsale,gift,sample,repair,return,personalorother.restrictions_notestringAny restriction or licence to declare.
tax_idsanyTax numbers where the destination asks for them, e.g.
{"IOSS": "…", "recipient": "…", "recipient_type": "personal"}. Brazil, Argentina, Israel and some other countries require the recipient's number.
Response in data
contents_type• Required stringcreated_at• Required timestampWhen it was created (ISO 8601, UTC).
declaration_currency• Required stringeei_required• Required booleanid• Required uuidincoterm• Required stringitems• Required array of objectsEach item · 15
country_of_origin• Required stringcreated_at• Required timestampWhen it was created (ISO 8601, UTC).
currency• Required stringThree-letter currency code, e.g.
CAD.description• Required stringhs_code• Required stringHarmonized System code.
id• Required uuidnet_weight_g• Required integerpackage_index• Required integerposition• Required integerquantity• Required integerHow many.
unit_value_cents• Required integergross_weight_gintegerhs_code_version_iduuidLeave out; set by the dashboard's HS-code picker.
manufacturer_countrystringskustringYour product code.
non_delivery_option• Required stringsigned_by• Required stringtax_ids• Required anytotal_value_cents• Required integerupdated_at• Required timestampWhen it last changed (ISO 8601, UTC).
eei_reasonstringhs_code_version_iduuidLeave out; set by the dashboard's HS-code picker.
invoice_datedateinvoice_numberstringreason_for_exportstringrestrictions_notestringshipment_iduuid
curl -X POST "https://api.parcelhub.ca/v1/customs/declarations" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"contents_type": "merchandise",
"declaration_currency": "string",
"from_country": "string",
"incoterm": "DAP",
"invoice_date": "2026-11-03",
"invoice_number": "string",
"items": [
{
"country_of_origin": "string",
"currency": "CAD",
"description": "string",
"gross_weight_g": 1,
"hs_code": "6109.10",
"manufacturer_country": "string",
"net_weight_g": 1,
"package_index": 1,
"position": 1,
"quantity": 1,
"sku": "string",
"unit_value_cents": 1299
}
],
"non_delivery_option": "return",
"reason_for_export": "sale",
"restrictions_note": "string",
"signed_by": "string",
"to_country": "string"
}'{
"ok": true,
"data": {
"contents_type": "string",
"created_at": "2026-10-31T15:04:05Z",
"declaration_currency": "string",
"eei_reason": "string",
"eei_required": true,
"hs_code_version_id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"incoterm": "string",
"invoice_date": "2026-11-03",
"invoice_number": "string",
"items": [
{
"country_of_origin": "string",
"created_at": "2026-10-31T15:04:05Z",
"currency": "CAD",
"description": "string",
"gross_weight_g": 1,
"hs_code": "6109.10",
"hs_code_version_id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"manufacturer_country": "string",
"net_weight_g": 1,
"package_index": 1,
"position": 1,
"quantity": 1,
"sku": "string",
"unit_value_cents": 1299
}
],
"non_delivery_option": "string",
"reason_for_export": "string",
"restrictions_note": "string",
"shipment_id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"signed_by": "string",
"tax_ids": null,
"total_value_cents": 1299,
"updated_at": "2026-10-31T15:04:05Z"
},
"request_id": "01JBX7Q2…"
}Get a customs declaration
GET /v1/customs/declarations/{id}
One customs declaration with its items.
Path parameters
id• Required string
Response in data
contents_type• Required stringcreated_at• Required timestampWhen it was created (ISO 8601, UTC).
declaration_currency• Required stringeei_required• Required booleanid• Required uuidincoterm• Required stringitems• Required array of objectsEach item · 15
country_of_origin• Required stringcreated_at• Required timestampWhen it was created (ISO 8601, UTC).
currency• Required stringThree-letter currency code, e.g.
CAD.description• Required stringhs_code• Required stringHarmonized System code.
id• Required uuidnet_weight_g• Required integerpackage_index• Required integerposition• Required integerquantity• Required integerHow many.
unit_value_cents• Required integergross_weight_gintegerhs_code_version_iduuidLeave out; set by the dashboard's HS-code picker.
manufacturer_countrystringskustringYour product code.
non_delivery_option• Required stringsigned_by• Required stringtax_ids• Required anytotal_value_cents• Required integerupdated_at• Required timestampWhen it last changed (ISO 8601, UTC).
eei_reasonstringhs_code_version_iduuidLeave out; set by the dashboard's HS-code picker.
invoice_datedateinvoice_numberstringreason_for_exportstringrestrictions_notestringshipment_iduuid
curl "https://api.parcelhub.ca/v1/customs/declarations/3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f" \
-H "Authorization: Bearer $TOKEN"{
"ok": true,
"data": {
"contents_type": "string",
"created_at": "2026-10-31T15:04:05Z",
"declaration_currency": "string",
"eei_reason": "string",
"eei_required": true,
"hs_code_version_id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"incoterm": "string",
"invoice_date": "2026-11-03",
"invoice_number": "string",
"items": [
{
"country_of_origin": "string",
"created_at": "2026-10-31T15:04:05Z",
"currency": "CAD",
"description": "string",
"gross_weight_g": 1,
"hs_code": "6109.10",
"hs_code_version_id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"manufacturer_country": "string",
"net_weight_g": 1,
"package_index": 1,
"position": 1,
"quantity": 1,
"sku": "string",
"unit_value_cents": 1299
}
],
"non_delivery_option": "string",
"reason_for_export": "string",
"restrictions_note": "string",
"shipment_id": "3f2b8c1e-5d6a-4b7c-9e0f-1a2b3c4d5e6f",
"signed_by": "string",
"tax_ids": null,
"total_value_cents": 1299,
"updated_at": "2026-10-31T15:04:05Z"
},
"request_id": "01JBX7Q2…"
}