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
    • Customs
      • NCTS Declarations
        • List all NCTS Declarations
        • Retrieve an NCTS Declaration
        • Create an NCTS Declaration with XML Data
        • Create an Ens Declaration from JSON
        • 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
    • 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
      • 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
    • 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
    • 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
  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 a Export or Import Custom Declaration.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
declaration_data
object 
optional
auto_send
boolean 
optional
Indicates if declaration auto send or not
badge_code
string 
optional
Chief Route code
service_code
enum<string> 
optional
Service code associated with the declaration. For export documents, you can use either "CDC" or "CHIEF" as the service code. For import documents, only "CDC" is acceptable.
Allowed values:
cdschief
doc_type
enum<string> 
required
Document type of the declaration
Allowed values:
exportimport
declaration_type
enum<string> 
required
Type of the customs declaration
Allowed values:
EXAEXBEXCEXDEXEEXFEXJEXKEXYEXZEXSIMAIMBIMCIMDIMEIMFIMGIMHIMJIMKIMYIMZWRDCOACOD
commercial_ref
string 
optional
Commercial reference number of the declaration
<= 15 characters
ducr
string 
optional
Declaration UCR
mucr
string 
optional
MUCR/Inventory UCN
ducr_part
string 
optional
Part number of the DUCR
<= 10 characters
declarant_eori
string 
required
EORI number of the declarant
declarant_name
string 
required
Name of the declarant
declarant_address
string 
optional
Address of the declarant
declarant_city_name
string 
optional
City of the declarant
declarant_country_id
string 
optional
Country ID of the declarant
declarant_postcode
string 
optional
Postcode of the declarant
declarant_rep
enum<string> 
optional
Type of the declarant representative
Allowed values:
No RepresentationDirect RepresentationIn-Direct Representation
export_country_id
string 
required
Country ID of the export country
consignor_eori
string 
optional
EORI number of the consignor
consignor_name
string 
required
Name of the consignor
consignor_address
string 
optional
Address of the consignor
consignor_city_name
string 
optional
City of the consignor
consignor_country_id
string 
optional
Country ID of the consignor
consignor_postcode
string 
optional
Postcode of the consignor
multiple_consignor
boolean 
optional
Indicates if involves multiple consignors. True if there are multiple consignors; false otherwise.
import_country_id
string 
required
Country ID of the import country
consignee_eori
string 
optional
EORI number of the consignee
consignee_name
string 
required
Name of the consignee
consignee_address
string 
optional
Address of the consignee
consignee_city_name
string 
optional
City of the consignee
consignee_country_id
string 
optional
Country ID of the consignee
consignee_postcode
string 
optional
Postcode of the consignee
multiple_consignee
boolean 
optional
Indicates if involves multiple consignees. True if there are multiple consignees; false otherwise.
invoice_amount
number 
optional
Total invoice amount
invoice_curr
string 
optional
Currency of the invoice amount
goods_location
string 
required
Customs Sub Place
border_transport_type
enum<string> 
required
Transport mode at the border
Allowed values:
12346789
border_vehicle_coun
string 
optional
Country code of the vehicle crossing border.If the transport mode at the border (border_transport_type) is 2,5,7 than leave this field blank.
border_vehicle_code
string 
optional
Vehicle code/plate number for the transport at the border
inland_transport_type
enum<string> 
optional
Transport mode at the inland
Allowed values:
12346789
container_no
string 
optional
Container number
gvms_interested
boolean 
optional
Indicates if the gvms completed
freight_amount
number 
optional
Freight cost
freight_curr
string 
optional
Currency of the freight cost
payment_method
string 
optional
Method of payment
carrier_eori
string 
optional
EORI number of the carrier
carrier_name
string 
optional
Name of the carrier
carrier_address
string 
optional
Address of the carrier
carrier_city_name
string 
optional
City of the carrier
carrier_country_id
string 
optional
Country ID of the carrier
carrier_postcode
string 
optional
Postcode of the carrier
total_packages
integer 
required
Total number of packages
nature_of_transaction
enum<string> 
optional
Nature of Transaction
Allowed values:
123456789111213141921222329414251529199
premises_code
string 
optional
Premises code
first_dan_no
string 
optional
Second Deferment Type
second_dan_no
string 
optional
Second Deferment Type
insurance_amount
number 
optional
Insurance amount
other_amounts
number 
optional
Other costs
airport_code
string 
optional
Airport code of the loading
apportment_indicator
string 
optional
Apportment indicator
total_gross_weight
number 
optional
Total gross weight
total_net_weight
number 
optional
Total net weight
airfreight_cost
number 
optional
Cost of airfreight
insurance_curr
string 
optional
Currency of the insurance amount
other_amounts_curr
string 
optional
Currency of the other costs
vat_adjustment
number 
optional
VAT adjustment amount
vat_adjustment_curr
string 
optional
Currency of the VAT adjustment
discount_amount
number 
optional
Discount amount
discount_curr
string 
optional
Currency of the discount amount
discount_rate
number 
optional
Discount rate
warehouse_type
string 
optional
Type of warehouse
incoterm
enum<string> 
optional
Incoterm
Allowed values:
CFRCIFCIPCPTDAFDAPDDPDDUDEQDESDPUEXWFASFCAFOBXXX
incoterm_location
string 
optional
Location/UN Code
trader_ref
string 
optional
Trader reference
arrival_transport_type
enum<string> 
optional
Arrival Transport Mode
Allowed values:
1011203040418081
guarantee_code
string 
optional
Guarantee code
guarantee_reference
string 
optional
Guarantee reference number
evrim_xml
string 
optional
EVRIM XML content
goods_attributes
array [object {39}] 
optional
Goods Items
parties_attributes
array [object {3}] 
optional
trader_additions_attributes
array [object {4}] 
optional
Example
{
    "declaration_data": {
        "badge_code": "AB123",
        "service_code": "chief",
        "doc_type": "export",
        "declaration_type": "EXD",
        "ducr": "GB23ABCD1234567891XYZ",
        "declarant_name": "Demo Uk",
        "export_country_id": "TR",
        "consignor_name": "Demo Uk",
        "trader_ref": "TRD-4567-2024-001",
        "commercial_ref": "INV2024GB00123",
        "border_transport_type": "3",
        "border_vehicle_coun": "GB",
        "border_vehicle_code": "DAF XF 105",
        "import_country_id": "TR",
        "goods_location": "GBDOV",
        "total_packages": 10,
        "total_gross_weight": 1200.50,
        "total_net_weight": 1100.00,
        "invoice_amount": 25000.00,
        "invoice_curr": "GBP",
        "consignee_name": "NİMBO TEKNOLOJİ HİZMETLERİ LTD.ŞTİ.",
        "goods_attributes": [
            {
                "commodity": "Perishable",
                "consignee_name": "NİMBO TEKNOLOJİ HİZMETLERİ LTD.ŞTİ.",
                "sender_name": "Demo Uk",
                "packs_attributes": [
                    {
                        "pack_type": "box",
                        "notes": "Deneme"
                    }
                ]
            }
        ]
    }
}

Request 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 --request POST 'https://demo.modaltrans.com/api/v1/customs_declarations' \
--header 'Content-Type: application/json' \
--data-raw '{
    "declaration_data": {
        "badge_code": "AB123",
        "service_code": "chief",
        "doc_type": "export",
        "declaration_type": "EXD",
        "ducr": "GB23ABCD1234567891XYZ",
        "declarant_name": "Demo Uk",
        "export_country_id": "TR",
        "consignor_name": "Demo Uk",
        "trader_ref": "TRD-4567-2024-001",
        "commercial_ref": "INV2024GB00123",
        "border_transport_type": "3",
        "border_vehicle_coun": "GB",
        "border_vehicle_code": "DAF XF 105",
        "import_country_id": "TR",
        "goods_location": "GBDOV",
        "total_packages": 10,
        "total_gross_weight": 1200.50,
        "total_net_weight": 1100.00,
        "invoice_amount": 25000.00,
        "invoice_curr": "GBP",
        "consignee_name": "NİMBO TEKNOLOJİ HİZMETLERİ LTD.ŞTİ.",
        "goods_attributes": [
            {
                "commodity": "Perishable",
                "consignee_name": "NİMBO TEKNOLOJİ HİZMETLERİ LTD.ŞTİ.",
                "sender_name": "Demo Uk",
                "packs_attributes": [
                    {
                        "pack_type": "box",
                        "notes": "Deneme"
                    }
                ]
            }
        ]
    }
}'

Responses

🟢201Created
application/json
Body
customs_declaration
object 
optional
declaration_data
object 
required
Example
{
    "customs_declaration": {
        "declaration_data": {
            "auto_send": true,
            "badge_code": "string",
            "service_code": "cds",
            "doc_type": "export",
            "declaration_type": "EXA",
            "commercial_ref": "string",
            "ducr": "sadasd",
            "mucr": "string",
            "ducr_part": "string",
            "declarant_eori": "string",
            "declarant_name": "string",
            "declarant_address": "string",
            "declarant_city_name": "string",
            "declarant_country_id": "string",
            "declarant_postcode": "string",
            "declarant_rep": "No Representation",
            "export_country_id": "string",
            "consignor_eori": "string",
            "consignor_name": "string",
            "consignor_address": "string",
            "consignor_city_name": "string",
            "consignor_country_id": "string",
            "consignor_postcode": "string",
            "multiple_consignor": true,
            "import_country_id": "string",
            "consignee_eori": "string",
            "consignee_name": "string",
            "consignee_address": "string",
            "consignee_city_name": "string",
            "consignee_country_id": "string",
            "consignee_postcode": "string",
            "multiple_consignee": true,
            "invoice_amount": 0,
            "invoice_curr": "string",
            "goods_location": "string",
            "border_transport_type": "1",
            "border_vehicle_code": "string",
            "border_vehicle_coun": "string",
            "inland_transport_type": "1",
            "container_no": "string",
            "gvms_interested": true,
            "freight_amount": 0,
            "freight_curr": "string",
            "payment_method": "string",
            "carrier_eori": "string",
            "carrier_name": "string",
            "carrier_address": "string",
            "carrier_city_name": "string",
            "carrier_country_id": "string",
            "carrier_postcode": "string",
            "total_packages": 0,
            "nature_of_transaction": "1",
            "premises_code": "string",
            "first_dan_no": "string",
            "second_dan_no": "string",
            "insurance_amount": 0,
            "other_amounts": 0,
            "airport_code": "string",
            "apportment_indicator": "string",
            "total_gross_weight": 0,
            "total_net_weight": 0,
            "airfreight_cost": 0,
            "insurance_curr": "string",
            "other_amounts_curr": "string",
            "vat_adjustment": 0,
            "vat_adjustment_curr": "string",
            "discount_amount": 0,
            "discount_curr": "string",
            "discount_rate": 0,
            "warehouse_type": "string",
            "incoterm": "CFR",
            "incoterm_location": "string",
            "trader_ref": "string",
            "arrival_transport_type": "10",
            "guarantee_code": "string",
            "guarantee_reference": "string",
            "evrim_xml": "string",
            "goods_attributes": [
                {
                    "line_no": 0,
                    "commodity": "string",
                    "gtip_code": "string",
                    "gtip_language": "string",
                    "brut_wg": 0,
                    "net_wg": 0,
                    "sender_name": "string",
                    "sender_address": "string",
                    "sender_city": "string",
                    "sender_country_id": "string",
                    "sender_postcode": "string",
                    "sender_eori_code": "string",
                    "consignee_name": "string",
                    "consignee_address": "string",
                    "consignee_city": "string",
                    "consignee_country_id": "string",
                    "consignee_postcode": "string",
                    "consignee_eori_code": "string",
                    "invoice_amount": 0,
                    "invoice_curr": "string",
                    "third_quantity_type": "string",
                    "cpc_code": "string",
                    "container_no": "string",
                    "preferential_country_id": "string",
                    "cus_code": "string",
                    "additional_cpc_code": "string",
                    "nature_of_transaction": "string",
                    "additional_commodity_codes": "string",
                    "origin_country_id": "string",
                    "preference_request": "string",
                    "quota_desc": "string",
                    "valuation_method": "string",
                    "valuation_adjustment": "string",
                    "third_quantity": 0,
                    "supplementary_unit": 0,
                    "packs_attributes": [
                        {
                            "pack_type": "AE",
                            "pack_count": 0,
                            "notes": "string"
                        }
                    ],
                    "documents_attributes": [
                        {
                            "doc_type": "T1",
                            "doc_no": "string",
                            "pre_post": "string"
                        }
                    ],
                    "produced_documents_attributes": [
                        {
                            "code": "string",
                            "reference": "string",
                            "status": "string",
                            "reason": "string",
                            "quantity": 0
                        }
                    ],
                    "additional_codes_attributes": [
                        {
                            "code": "string",
                            "notes": "string"
                        }
                    ]
                }
            ],
            "parties_attributes": [
                {
                    "party_role": "string",
                    "party_code": "string",
                    "eori_code": "string"
                }
            ],
            "trader_additions_attributes": [
                {
                    "code": "string",
                    "amount": 0,
                    "curr": "string",
                    "rate_code": 0
                }
            ]
        }
    }
}
🟠400Bad Request
🟠403Forbidden
🟠404Record Not Found
🟠422Unprocessable Entity
Modified at 2025-03-25 10:49:07
Previous
Retrieve a Custom Declaration
Next
Update a Custom Declaration
Built with