- Introduction
- Getting Started
- Authentication
- Error Handling
- Contact Support
- Modaltrans API
- Get Auth Token
- Accounting
- Customs
- NCTS Declarations
- Customs Declarations
- Declaration Requests
- Logistics
- Depot
- Fleet Management
- CRM
- Timelines
- S3 Files
- Notifications
- User Details
Create a Customs Declaration
Testing Env
https://demo.modaltrans.com
Testing Env
https://demo.modaltrans.com
POST
/api/v1/customs_declarations
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
badge_code
string
optional
service_code
enum<string>
optional
Allowed values:
cdschief
doc_type
enum<string>
required
Allowed values:
exportimport
declaration_type
enum<string>
required
Allowed values:
EXAEXBEXCEXDEXEEXFEXJEXKEXYEXZEXSIMAIMBIMCIMDIMEIMFIMGIMHIMJIMKIMYIMZWRDCOACOD
commercial_ref
string
optional
<= 15 characters
ducr
string
optional
mucr
string
optional
ducr_part
string
optional
<= 10 characters
declarant_eori
string
required
declarant_name
string
required
declarant_address
string
optional
declarant_city_name
string
optional
declarant_country_id
string
optional
declarant_postcode
string
optional
declarant_rep
enum<string>
optional
Allowed values:
No RepresentationDirect RepresentationIn-Direct Representation
export_country_id
string
required
consignor_eori
string
optional
consignor_name
string
required
consignor_address
string
optional
consignor_city_name
string
optional
consignor_country_id
string
optional
consignor_postcode
string
optional
multiple_consignor
boolean
optional
import_country_id
string
required
consignee_eori
string
optional
consignee_name
string
required
consignee_address
string
optional
consignee_city_name
string
optional
consignee_country_id
string
optional
consignee_postcode
string
optional
multiple_consignee
boolean
optional
invoice_amount
number
optional
invoice_curr
string
optional
goods_location
string
required
border_transport_type
enum<string>
required
Allowed values:
12346789
border_vehicle_coun
string
optional
border_vehicle_code
string
optional
inland_transport_type
enum<string>
optional
Allowed values:
12346789
container_no
string
optional
gvms_interested
boolean
optional
freight_amount
number
optional
freight_curr
string
optional
payment_method
string
optional
carrier_eori
string
optional
carrier_name
string
optional
carrier_address
string
optional
carrier_city_name
string
optional
carrier_country_id
string
optional
carrier_postcode
string
optional
total_packages
integer
required
nature_of_transaction
enum<string>
optional
Allowed values:
123456789111213141921222329414251529199
premises_code
string
optional
first_dan_no
string
optional
second_dan_no
string
optional
insurance_amount
number
optional
other_amounts
number
optional
airport_code
string
optional
apportment_indicator
string
optional
total_gross_weight
number
optional
total_net_weight
number
optional
airfreight_cost
number
optional
insurance_curr
string
optional
other_amounts_curr
string
optional
vat_adjustment
number
optional
vat_adjustment_curr
string
optional
discount_amount
number
optional
discount_curr
string
optional
discount_rate
number
optional
warehouse_type
string
optional
incoterm
enum<string>
optional
Allowed values:
CFRCIFCIPCPTDAFDAPDDPDDUDEQDESDPUEXWFASFCAFOBXXX
incoterm_location
string
optional
trader_ref
string
optional
arrival_transport_type
enum<string>
optional
Allowed values:
1011203040418081
guarantee_code
string
optional
guarantee_reference
string
optional
evrim_xml
string
optional
goods_attributes
array [object {39}]
optional
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