1. Customs Declarations
  • Introduction
  • Getting Started
  • Authentication
  • Error Handling
  • Contact Support
  • Modaltrans API
    • Get Auth Token
      • Get Bearer Token
    • Accounting
      • Invoices
        • Retrieve an Invoice
        • List all Invoices
      • Invoice Items
        • List all Invoice Items
        • Deleted Invoice Items
      • Financials
        • Retrieve Financial Information
    • Customs
      • NCTS Declarations
        • List all NCTS Declarations
        • Retrieve an NCTS Declaration
        • Create an NCTS Declaration with XML Data
        • Update an NCTS Declaration
        • Download an NCTS Declaration
        • List Timelines of NCTS Declaration
        • List Messages of NCTS Decalaration
      • Customs Declarations
        • List all Customs Declarations
          GET
        • Retrieve a Custom Declaration
          GET
        • Create a Customs Declaration
          POST
        • Update a Custom Declaration
          PATCH
        • Delete a Custom Declaration
          DELETE
        • Retrieve a Declaration History
          GET
        • Retrieve an MRN Status of Declaration
          GET
      • Declaration Requests
        • List all Declaration Orders
        • Retrieve a Declaration Request
        • Create a Declaration Request
        • Update a Declaration Request
        • Delete a Declaration Request
      • Ens Declarations
        • Create an Ens Declaration
        • Download an Ens Declaration
    • Logistics
      • Bookings
        • Retrieve a Booking
        • List all Bookings
        • Create a Booking
        • Update a Booking
      • Locations
        • List all Locations
        • Retrieve a Location
      • Positions
        • Update a Transport
        • Get All Positions
        • Retrieve a Position
      • Tracking
        • Available Shipping Lines
        • Retrieve a Tracking Data
        • Subscribe to Tracking
      • Shipments
        • Retrieve a Shipment
        • List All Shipments
        • Retrieve Financials of Shipment
        • List Contacts of the Shipment
        • Create a Shipment
        • Update a Shipment
      • Tariffs
        • List All Tariffs
        • Retrieve a Tariff
        • Create a Tariff
        • Update a Tariff
        • Download a Tariff PDF
    • Depot
      • Orders
        • Retrieve an Order
        • List all Orders
        • Create an Order
        • Update an Order
      • Products
        • Retrieve a Product
        • List all Products
        • Create a Product
        • Update a Product
        • List Product Stocks
      • Inventories
        • List all Inventories
    • Fleet Management
      • Drivers
        • Retrieve a Driver
        • Retrieve a Driver's Vehicle
        • List Driver Positions
        • Update a Driver
      • Vehicles
        • Retrieve a Vehicle
        • Update a Vehicle
      • Gps Service Controller
        • Create Gps Responses
      • Service Logs
        • List all Service Logs
        • Retrieve a Service Log
        • Create a Service Log
        • Delete a Service Log
        • Update a Service Log
      • Periodic Documents
        • Retrieve a Periodic Document
        • Update a Periodic Document
        • Create a Periodic Document
    • CRM
      • Companies
        • List all Companies
        • Retrieve a Company
        • Create a Company
        • Update a Company
        • Delete a Company
        • List Company Credit Limits
      • Quotes
        • Retrieve a Quote
        • List All Quotes
        • Update a Quote
        • Create a Quote
        • Accept a Quote
        • Reject a Quote
    • Timelines
      • Retrieve a Timeline
      • List Timelines
      • Create a Timeline
    • S3 Files
      • List all S3Files
      • Create an S3File
      • Delete an S3File
    • Notifications
      • List all Notifications
      • Update a Notification Status
    • User Details
      • List User Details
      • Update User Details
    • Milestones
      • Retrieve a Milestone
      • List Milestones
      • Create a Milestone
      • Delete a Milestone
      • Update a Milestone
  • Webhooks
    • Webhooks
    • Trackings
      • Tracking Webhooks
      • Sea
        • Sea Tracking Event Created
        • Sea Tracking Event Updated
      • Air
        • Air Tracking Event Created
        • Air Tracking Event Updated
    • Customs
      • Customs Declaration Status Changed
      • NCTS Declaration Status Changed
      • ENS Declaration Status Changed
      • GVMS Declaration Status Changed
    • Shipment Documents
      • Shipment Document Webhooks
      • Shipment Document Created
      • Shipment Document Updated
  1. Customs Declarations

Create a Customs Declaration

Testing Env
https://demo.modaltrans.com
Testing Env
https://demo.modaltrans.com
POST
/api/v1/customs_declarations
Creates an export or import customs declaration. The declaration is created as a draft. Send auto_send: true to submit it to customs in the same request (CDS declarations only; badge_code is required). Declarations with more than 50 items are queued and submitted in the background; follow them with Retrieve an MRN Status of Declaration.
Send the full set of nested rows on every request: omitted fields are cleared, and rows are matched on their code, not their position.

Submission result#

The declaration is always saved. When auto_send is sent, the response carries the outcome in api_notes (and, for invalid_for_sending, the blocking validation messages in auto_send_errors):
api_notesMeaning
(not present)Submitted to customs (or auto_send was not requested)
will_be_submittedQueued; will be submitted in the background (more than 50 items), or handed over to the badge owner
queued_for_submissionSubmission in progress
invalid_for_sendingData required for submission is missing; see auto_send_errors
submission_failedCustoms rejected the submission; see error_messages
badge_missingbadge_code was not provided
service_not_supportedauto_send is supported for CDS declarations only
already_submittedAlready submitted, has an MRN, or is being submitted by another request

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json

Example
{
    "declaration_data": {
        "service_code": "cds",
        "doc_type": "export",
        "declaration_type": "EXA",
        "badge_code": "CDS",
        "auto_send": true,
        "commercial_ref": "INV-2026-0042",
        "ducr": "6GB123456789000-INV20260042",
        "declarant_eori": "GB123456789000",
        "declarant_name": "ACME CUSTOMS SERVICES LTD",
        "declarant_address": "1 DOCK ROAD",
        "declarant_city_name": "LONDON",
        "declarant_country_id": "GB",
        "declarant_postcode": "N1 1AA",
        "declarant_rep": "2",
        "export_country_id": "GB",
        "consignor_eori": "GB987654321000",
        "consignor_name": "ACME COMPONENTS LTD",
        "consignor_address": "12 FACTORY ROAD",
        "consignor_city_name": "ESSEX",
        "consignor_country_id": "GB",
        "consignor_postcode": "CM19 5FA",
        "import_country_id": "TR",
        "consignee_name": "ORNEK SANAYI VE TICARET AS",
        "consignee_address": "OSB 4. CADDE NO 10",
        "consignee_city_name": "BALIKESIR",
        "consignee_country_id": "TR",
        "consignee_postcode": "10100",
        "goods_location": "GBAUDEUDEUDEU",
        "border_transport_type": "6",
        "arrival_transport_type": "30",
        "inland_transport_type": "6",
        "border_vehicle_code": "TRUCK",
        "border_vehicle_coun": "TR",
        "nature_of_transaction": "11",
        "gvms_interested": true,
        "carrier_eori": "GB555666777000",
        "carrier_name": "ACME TRANSPORT (UK) LTD",
        "carrier_address": "UNIT A11 BELL LANE",
        "carrier_city_name": "BUCKINGHAMSHIRE",
        "carrier_country_id": "GB",
        "carrier_postcode": "HP6 6FA",
        "total_packages": 5,
        "total_gross_weight": 685.236,
        "total_net_weight": 608.436,
        "invoice_amount": 8462.8,
        "invoice_curr": "GBP",
        "goods_attributes": [
            {
                "line_no": 1,
                "commodity": "Electrical lighting or signalling equipment of a kind used for motor vehicles",
                "gtip_code": "8512200000",
                "brut_wg": 685.236,
                "net_wg": 608.436,
                "invoice_amount": 8462.8,
                "invoice_curr": "GBP",
                "cpc_code": "1040",
                "additional_cpc_code": "000",
                "sender_name": "ACME COMPONENTS LTD",
                "sender_address": "12 FACTORY ROAD",
                "sender_city": "ESSEX",
                "sender_postcode": "CM19 5FA",
                "sender_country_id": "GB",
                "sender_eori_code": "GB987654321000",
                "consignee_name": "ORNEK SANAYI VE TICARET AS",
                "consignee_address": "OSB 4. CADDE NO 10",
                "consignee_city": "BALIKESIR",
                "consignee_postcode": "10100",
                "consignee_country_id": "TR",
                "packs_attributes": [
                    {
                        "pack_type": "PK",
                        "pack_count": 5,
                        "notes": "AS ADDRESSED"
                    }
                ],
                "documents_attributes": [
                    {
                        "doc_type": "380",
                        "doc_no": "INV-2026-0042",
                        "pre_post": "Z",
                        "doc_date": "2026-10-14"
                    }
                ]
            }
        ]
    }
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://demo.modaltrans.com/api/v1/customs_declarations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "declaration_data": {
        "service_code": "cds",
        "doc_type": "export",
        "declaration_type": "EXA",
        "badge_code": "CDS",
        "auto_send": true,
        "commercial_ref": "INV-2026-0042",
        "ducr": "6GB123456789000-INV20260042",
        "declarant_eori": "GB123456789000",
        "declarant_name": "ACME CUSTOMS SERVICES LTD",
        "declarant_address": "1 DOCK ROAD",
        "declarant_city_name": "LONDON",
        "declarant_country_id": "GB",
        "declarant_postcode": "N1 1AA",
        "declarant_rep": "2",
        "export_country_id": "GB",
        "consignor_eori": "GB987654321000",
        "consignor_name": "ACME COMPONENTS LTD",
        "consignor_address": "12 FACTORY ROAD",
        "consignor_city_name": "ESSEX",
        "consignor_country_id": "GB",
        "consignor_postcode": "CM19 5FA",
        "import_country_id": "TR",
        "consignee_name": "ORNEK SANAYI VE TICARET AS",
        "consignee_address": "OSB 4. CADDE NO 10",
        "consignee_city_name": "BALIKESIR",
        "consignee_country_id": "TR",
        "consignee_postcode": "10100",
        "goods_location": "GBAUDEUDEUDEU",
        "border_transport_type": "6",
        "arrival_transport_type": "30",
        "inland_transport_type": "6",
        "border_vehicle_code": "TRUCK",
        "border_vehicle_coun": "TR",
        "nature_of_transaction": "11",
        "gvms_interested": true,
        "carrier_eori": "GB555666777000",
        "carrier_name": "ACME TRANSPORT (UK) LTD",
        "carrier_address": "UNIT A11 BELL LANE",
        "carrier_city_name": "BUCKINGHAMSHIRE",
        "carrier_country_id": "GB",
        "carrier_postcode": "HP6 6FA",
        "total_packages": 5,
        "total_gross_weight": 685.236,
        "total_net_weight": 608.436,
        "invoice_amount": 8462.8,
        "invoice_curr": "GBP",
        "goods_attributes": [
            {
                "line_no": 1,
                "commodity": "Electrical lighting or signalling equipment of a kind used for motor vehicles",
                "gtip_code": "8512200000",
                "brut_wg": 685.236,
                "net_wg": 608.436,
                "invoice_amount": 8462.8,
                "invoice_curr": "GBP",
                "cpc_code": "1040",
                "additional_cpc_code": "000",
                "sender_name": "ACME COMPONENTS LTD",
                "sender_address": "12 FACTORY ROAD",
                "sender_city": "ESSEX",
                "sender_postcode": "CM19 5FA",
                "sender_country_id": "GB",
                "sender_eori_code": "GB987654321000",
                "consignee_name": "ORNEK SANAYI VE TICARET AS",
                "consignee_address": "OSB 4. CADDE NO 10",
                "consignee_city": "BALIKESIR",
                "consignee_postcode": "10100",
                "consignee_country_id": "TR",
                "packs_attributes": [
                    {
                        "pack_type": "PK",
                        "pack_count": 5,
                        "notes": "AS ADDRESSED"
                    }
                ],
                "documents_attributes": [
                    {
                        "doc_type": "380",
                        "doc_no": "INV-2026-0042",
                        "pre_post": "Z",
                        "doc_date": "2026-10-14"
                    }
                ]
            }
        ]
    }
}'

Responses

🟢201Created
application/json
Bodyapplication/json

Examples
{
    "error": "Request body could not be read properly."
}
🟠400Bad Request
🟠403Forbidden
🟠422Unprocessable Entity
Modified at 2026-12-02 13:16:16
Previous
Retrieve a Custom Declaration
Next
Update a Custom Declaration
Built with