Create or update a Customs Order.
To determine if a new order will be created or an existing order will be updated, the following rules apply:
metadata.shipment_id is passed, the request is an update of this FLEX-ID.metadata.customs_order_id is passed, the request is an update of this customs order.metadata.source_document is passed and an order already exists for that id or external_ref,
the request is an update for this document.| name required | string non-empty Human-readable name for the order | ||||||||||||
| incoterm required | string (Incoterm) The International Commercial Term variant used Required for creating an order but not for updating | ||||||||||||
object (CustomsOrderServices) The desired services for this order. Not specifying or specifying null indicates:
Note: services requested might not correspond directly to services invoiced. For example: product classification can be included in import filing service. | |||||||||||||
| currency_code | string (CustomsOrderCurrencyCode) [A-Z]{3} Default: "USD" The base currency for the order quote and invoices. ISO 4217 currency code. Not specifying or specifying null indicates:
| ||||||||||||
required | Ocean FCL Freight Details (object) or Ocean LCL Freight Details (object) or Air Freight Details (object) or Truck FTL Freight Details (object) (CustomsOrderRequestFreightDetails) | ||||||||||||
One of: Details of the main freight leg. Exact format is determined by the mode of transport, identified by the mode_of_transport field. | |||||||||||||
object (CargoDetails) Cargo Details | |||||||||||||
| |||||||||||||
Array of Name (object) or External reference (object) or Address (object) (InvolvedPartyDetails) All involved parties for the order | |||||||||||||
Array Any of: Involved Party Details. Either name, external_ref or address_details is required | |||||||||||||
object (CustomsDetails) Details for customs services | |||||||||||||
Array of objects (ShipmentTag) Shipment tags for the order. Available shipment tags can be configured in Flexport App under 'Your Business' -> 'Settings' -> 'Shipment Preferences' | |||||||||||||
| purchase_order_numbers | Array of strings List of purchase order numbers | ||||||||||||
required | object (CustomsOrderRequestMetadata) Data for managing the order creation process, not directly related to the order itself. | ||||||||||||
| |||||||||||||
Order request is pending
Bad request
{- "name": "Import MBL SCAC57021412",
- "incoterm": "FOB",
- "services": {
- "isf": true,
- "import_customs": true
}, - "currency_code": "string",
- "freight_details": {
- "mode_of_transport": "OCEAN_FCL",
- "bill_numbers": {
- "master_bill_of_lading_number": "string",
- "house_bill_of_lading_numbers": [
- "FLXT3000000"
]
}, - "route": {
- "vessel": {
- "name": "string",
- "imo": "string",
- "mmsi": "string"
}, - "voyage_tracking_number": "010E",
- "origin_address": {
- "details": {
- "address_line1": "760 Market Street",
- "city": "San Francisco",
- "state_province": "SF",
- "country_code": "US"
}, - "eta": "2019-08-24T14:15:22Z",
- "etd": "2019-08-24T14:15:22Z"
}, - "port_of_loading": {
- "details": {
- "un_lo_code": "USLAX"
}, - "eta": "2019-08-24T14:15:22Z",
- "etd": "2019-08-24T14:15:22Z"
}, - "transshipment_ports": [ ],
- "port_of_unloading": {
- "details": {
- "un_lo_code": "USLAX"
}, - "eta": "2019-08-24T14:15:22Z",
- "etd": "2019-08-24T14:15:22Z"
}, - "inland_port": {
- "details": {
- "un_lo_code": "USLAX"
}, - "eta": "2019-08-24T14:15:22Z",
- "etd": "2019-08-24T14:15:22Z"
}, - "destination_address": {
- "details": {
- "address_line1": "760 Market Street",
- "city": "San Francisco",
- "state_province": "SF",
- "country_code": "US"
}, - "eta": "2019-08-24T14:15:22Z",
- "etd": "2019-08-24T14:15:22Z"
}
}, - "scac": "string",
- "containers": [
- {
- "container_size": "FT_40",
- "container_number": "CSQU3054383",
- "container_type": "DRY"
}
]
}, - "cargo_details": {
- "weight": {
- "value": 8305,
- "unit": "KG"
}, - "volume": {
- "value": 305,
- "unit": "CBM"
}, - "shipping_unit_details": {
- "count": 5,
- "atomic_count": 5,
- "shipping_unit_type": "CARTON"
}
}, - "involved_parties": [
- {
- "type": "IMPORTER_OF_RECORD",
- "name": "FLEXPORT INTERNATIONAL LLC",
- "external_ref": "IMPORTER708"
}, - {
- "type": "CONSIGNEE",
- "name": "FLEXPORT INTERNATIONAL LLC",
- "external_ref": "CONSIGNEE123"
}, - {
- "type": "BUYER",
- "name": "FLEXPORT INTERNATIONAL LLC",
- "external_ref": "BUYER900"
}
], - "customs_details": {
- "country_of_origin": "CN",
- "country_of_import": "US",
- "estimated_total_commercial_invoice_value": [
- {
- "amount": 15000,
- "currency_code": "USD"
}
]
}, - "shipment_tags": [
- {
- "attribute": "ACME Inc. Order ID",
- "values": [
- "FLEXPORT-ORDER-1000-2000"
]
}
], - "purchase_order_numbers": [
- "PO88087"
], - "request_metadata": {
- "is_update": true,
- "shipment_id": 3000000,
- "customs_order_fid": "flx::customs:pre-order:a65f2d6e-3b1b-44fd-86b5-a9b7d83a7327",
- "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
- "webhook_id": "a47606a1-5b39-4a81-9480-c2cb738ff675",
- "source_document": {
- "type": "OCEAN_BILL_OF_LADING",
- "fid": "flx::customs:inbound-isf:a65f2d6e-3b1b-44fd-86b5-a9b7d83a7327",
- "externalRef": "ISF Worksheet MBL SCAC123456789"
}
}
}{- "_object": "/api/response",
- "version": 2,
- "data": {
- "fid": "flx::customs:pre-order:a65f2d6e-3b1b-44fd-86b5-a9b7d83a7327",
- "status": "REQUESTED",
- "shipment_id": 3000000,
- "name": "Import MBL SCAC57021412",
- "services": {
- "isf": true,
- "import_customs": true
}, - "freight_details": {
- "mode_of_transport": "OCEAN_FCL",
- "bill_numbers": {
- "master_bill_of_lading_number": "string",
- "house_bill_of_lading_numbers": [
- "FLXT3000000"
]
}, - "customer_supplied_bill_numbers": {
- "master_bill_of_lading_number": "string",
- "house_bill_of_lading_numbers": [
- "FLXT3000000"
]
}
}, - "source_documents": [
- {
- "type": "OCEAN_BILL_OF_LADING",
- "fid": "flx::customs:inbound-isf:a65f2d6e-3b1b-44fd-86b5-a9b7d83a7327",
- "externalRef": "ISF Worksheet MBL SCAC123456789"
}
], - "problems": [
- {
- "path": "$.services.pre_departure_authorization_service",
- "level": "ERROR",
- "message": "Service requires `freight_details.mode_of_transport` to be OCEAN_FCL or OCEAN_LCL"
}, - {
- "path": "$.freight_details.route.port_of_unloading.details.un_lo_code",
- "level": "WARNING",
- "message": "Unknown port 'XXABC'"
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
}Retrieve the latest status of the customs order, which might be merged from multiple requests.
The customs order
Bad request, e.g. malformed FID
Customs order not found
{- "_object": "/api/response",
- "version": 2,
- "data": {
- "fid": "flx::customs:pre-order:a65f2d6e-3b1b-44fd-86b5-a9b7d83a7327",
- "status": "REQUESTED",
- "shipment_id": 3000000,
- "name": "Import MBL SCAC57021412",
- "services": {
- "isf": true,
- "import_customs": true
}, - "freight_details": {
- "mode_of_transport": "OCEAN_FCL",
- "bill_numbers": {
- "master_bill_of_lading_number": "string",
- "house_bill_of_lading_numbers": [
- "FLXT3000000"
]
}, - "customer_supplied_bill_numbers": {
- "master_bill_of_lading_number": "string",
- "house_bill_of_lading_numbers": [
- "FLXT3000000"
]
}
}, - "source_documents": [
- {
- "type": "OCEAN_BILL_OF_LADING",
- "fid": "flx::customs:inbound-isf:a65f2d6e-3b1b-44fd-86b5-a9b7d83a7327",
- "externalRef": "ISF Worksheet MBL SCAC123456789"
}
], - "problems": [
- {
- "path": "$.services.pre_departure_authorization_service",
- "level": "ERROR",
- "message": "Service requires `freight_details.mode_of_transport` to be OCEAN_FCL or OCEAN_LCL"
}, - {
- "path": "$.freight_details.route.port_of_unloading.details.un_lo_code",
- "level": "WARNING",
- "message": "Unknown port 'XXABC'"
}
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
}