1. NCTS 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
          GET
        • Retrieve an NCTS Declaration
          GET
        • Create an NCTS Declaration with XML Data
          POST
        • Create an Ens Declaration from JSON
          POST
        • Update an NCTS Declaration
          PATCH
        • Download an NCTS Declaration
          GET
        • List Timelines of NCTS Declaration
          GET
        • List Messages of NCTS Decalaration
          GET
      • Customs Declarations
        • List all Customs Declarations
        • Retrieve a Custom Declaration
        • Create a Customs Declaration
        • Update a Custom Declaration
        • Delete a Custom Declaration
        • Retrieve a Declaration History
        • Retrieve an MRN Status of Declaration
      • 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. NCTS Declarations

Create an Ens Declaration from JSON

Testing Env
https://demo.modaltrans.com
Testing Env
https://demo.modaltrans.com
POST
/api/v1/ncts_declarations
Creates an ENS Declaration from JSON.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Query Params
doc_type
enum<string> 
required
Document type of the declaration. Should be ENS.
Allowed value:
ENS
Body Params application/json
manifesto
object 
required
ncts_json_data
object 
required
Example
{
  "manifesto": {
    "ncts_json_data": {
      "doc_type": "ENS",
      "departure_custom_code": "ES003301",
      "arrival_custom_code": "DK004702",
      "load_place": "ES",
      "unload_place": "DK",
      "dispatch_country_id": "ES",
      "destination_country_id": "DK",
      "trans_method": "air",
      "roro_operator_code": "AIR789",
      "ens_voyage_no": "VY78901",
      "vehicle_code": "SPV4321",
      "vehicle_coun": "ES",
      "trailer_code": "ES567Z",
      "trailer_coun": "ES",
      "container": "CNT6789",
      "seal_info": "SEAL6789",
      "carrier_name": "Sky Logistics S.A.",
      "carrier_taxno": "TAX456789",
      "carrier_country_id": "ES",
      "carrier_city": "Madrid",
      "carrier_postcode": "28001",
      "carrier_address": "Madrid, Central Hub",

      "transit_countries_attributes": [
        {
          "country_id": "DK"
        },
        {
          "country_id": "FR"
        },
        {
          "country_id": "ES"
        }
      ],
      "goods_attributes": [
        {
          "sender_name": "ABC CHEMICALS LTD.",
          "sender_address": "3 Calle de la Paz",
          "sender_city": "Madrid",
          "sender_postcode": "28010",
          "sender_country_id": "ES",
          "sender_taxno": "TAX789012",
          "consignee_name": "XYZ COMPANY",
          "consignee_address": "56 Via Roma",
          "consignee_city": "Rome",
          "consignee_postcode": "00100",
          "consignee_country_id": "DK",
          "consignee_taxno": "TAX123987",
          "gtip_code": "01022969",
          "commodity": "Textiles",
          "brut_wg": 3500,
          "net_wg": 3400,
          "invoice_amount": 50,
          "container_no": "CNT1234",
          "packs_attributes": [
            {
              "pack_type": "PK",
              "pack_count": 250,
              "notes": "Handle with care"
            },
            {
              "pack_type": "BK",
              "pack_count": 250,
              "notes": "Keep dry"
            }
          ],
          "produced_documents_attributes": [
            {
              "reference": "DOC987654",
              "code": "N235",
              "quantity": 1,
              "reason": "Export for Manufacturing",
              "scope": "Supporting Document"
            },
            {
              "reference": "DOC987655",
              "code": "N270",
              "quantity": 2,
              "reason": "Export for Retail",
              "scope": "Supporting Document"
            },
            {
              "reference": "DOC987656",
              "code": "N842",
              "quantity": 3,
              "reason": "Export for Trade Show",
              "scope": "Supporting Document"
            }
          ]
        },
        {
          "sender_name": "CBA CHEMICALS LTD.",
          "sender_address": "10 Av. de la Libertad",
          "sender_city": "Barcelona",
          "sender_postcode": "08010",
          "sender_country_id": "ES",
          "consignee_name": "HGB Company LTD.",
          "consignee_address": "78 Corso Magenta",
          "consignee_city": "Milan",
          "consignee_postcode": "20123",
          "consignee_country_id": "IT",
          "gtip_code": "01022961",
          "commodity": "Furniture",
          "brut_wg": 5500,
          "net_wg": 5300,
          "invoice_amount": 75,
          "container_no": "CNT2345",
          "packs_attributes": [
            {
              "pack_type": "Box",
              "pack_count": 400,
              "notes": "Fragile"
            },
            {
              "pack_type": "Box",
              "pack_count": 400,
              "notes": "Fragile, keep upright"
            }
          ],
          "produced_documents_attributes": [
            {
              "reference": "DOC234567",
              "code": "N1234",
              "quantity": 1,
              "reason": "Import for Resale",
              "scope": "Additional Referance"
            },
            {
              "reference": "DOC234568",
              "code": "B654",
              "quantity": 2,
              "reason": "Export for Charity",
              "scope": "Additional Referance"
            },
            {
              "reference": "DOC234569",
              "code": "C910",
              "quantity": 3,
              "reason": "Import for Exhibition",
              "scope": "Additional Referance"
            }
          ]
        }
      ]
    }
  }
}

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/ncts_declarations?doc_type=' \
--header 'Content-Type: application/json' \
--data-raw '{
  "manifesto": {
    "ncts_json_data": {
      "doc_type": "ENS",
      "departure_custom_code": "ES003301",
      "arrival_custom_code": "DK004702",
      "load_place": "ES",
      "unload_place": "DK",
      "dispatch_country_id": "ES",
      "destination_country_id": "DK",
      "trans_method": "air",
      "roro_operator_code": "AIR789",
      "ens_voyage_no": "VY78901",
      "vehicle_code": "SPV4321",
      "vehicle_coun": "ES",
      "trailer_code": "ES567Z",
      "trailer_coun": "ES",
      "container": "CNT6789",
      "seal_info": "SEAL6789",
      "carrier_name": "Sky Logistics S.A.",
      "carrier_taxno": "TAX456789",
      "carrier_country_id": "ES",
      "carrier_city": "Madrid",
      "carrier_postcode": "28001",
      "carrier_address": "Madrid, Central Hub",

      "transit_countries_attributes": [
        {
          "country_id": "DK"
        },
        {
          "country_id": "FR"
        },
        {
          "country_id": "ES"
        }
      ],
      "goods_attributes": [
        {
          "sender_name": "ABC CHEMICALS LTD.",
          "sender_address": "3 Calle de la Paz",
          "sender_city": "Madrid",
          "sender_postcode": "28010",
          "sender_country_id": "ES",
          "sender_taxno": "TAX789012",
          "consignee_name": "XYZ COMPANY",
          "consignee_address": "56 Via Roma",
          "consignee_city": "Rome",
          "consignee_postcode": "00100",
          "consignee_country_id": "DK",
          "consignee_taxno": "TAX123987",
          "gtip_code": "01022969",
          "commodity": "Textiles",
          "brut_wg": 3500,
          "net_wg": 3400,
          "invoice_amount": 50,
          "container_no": "CNT1234",
          "packs_attributes": [
            {
              "pack_type": "PK",
              "pack_count": 250,
              "notes": "Handle with care"
            },
            {
              "pack_type": "BK",
              "pack_count": 250,
              "notes": "Keep dry"
            }
          ],
          "produced_documents_attributes": [
            {
              "reference": "DOC987654",
              "code": "N235",
              "quantity": 1,
              "reason": "Export for Manufacturing",
              "scope": "Supporting Document"
            },
            {
              "reference": "DOC987655",
              "code": "N270",
              "quantity": 2,
              "reason": "Export for Retail",
              "scope": "Supporting Document"
            },
            {
              "reference": "DOC987656",
              "code": "N842",
              "quantity": 3,
              "reason": "Export for Trade Show",
              "scope": "Supporting Document"
            }
          ]
        },
        {
          "sender_name": "CBA CHEMICALS LTD.",
          "sender_address": "10 Av. de la Libertad",
          "sender_city": "Barcelona",
          "sender_postcode": "08010",
          "sender_country_id": "ES",
          "consignee_name": "HGB Company LTD.",
          "consignee_address": "78 Corso Magenta",
          "consignee_city": "Milan",
          "consignee_postcode": "20123",
          "consignee_country_id": "IT",
          "gtip_code": "01022961",
          "commodity": "Furniture",
          "brut_wg": 5500,
          "net_wg": 5300,
          "invoice_amount": 75,
          "container_no": "CNT2345",
          "packs_attributes": [
            {
              "pack_type": "Box",
              "pack_count": 400,
              "notes": "Fragile"
            },
            {
              "pack_type": "Box",
              "pack_count": 400,
              "notes": "Fragile, keep upright"
            }
          ],
          "produced_documents_attributes": [
            {
              "reference": "DOC234567",
              "code": "N1234",
              "quantity": 1,
              "reason": "Import for Resale",
              "scope": "Additional Referance"
            },
            {
              "reference": "DOC234568",
              "code": "B654",
              "quantity": 2,
              "reason": "Export for Charity",
              "scope": "Additional Referance"
            },
            {
              "reference": "DOC234569",
              "code": "C910",
              "quantity": 3,
              "reason": "Import for Exhibition",
              "scope": "Additional Referance"
            }
          ]
        }
      ]
    }
  }
}'

Responses

🟢201Created
application/json
Body
reference
string 
required
doc_type
string 
required
doc_date
string 
required
vehicle_code
string 
required
vehicle_coun
string 
required
trailer_code
string 
required
trailer_coun
string 
required
container
string 
required
departure_custom_code
string 
required
dispatch_country_id
string 
required
load_place
string 
required
arrival_custom_code
string 
required
destination_country_id
string 
required
unload_place
string 
required
trans_method
string 
required
roro_operator_code
string 
required
status
string 
required
transit_countries_codes
string 
required
goods
array [object {30}] 
required
line_no
integer 
required
gtip_code
string 
required
commodity
string 
required
brut_wg
integer 
required
net_wg
integer 
required
invoice_amount
string 
required
invoice_curr
null 
required
exp_customs_type
null 
required
exp_customs_partial
null 
required
exp_customs_no
string 
required
manifesto_type
null 
required
dep_country_id
null 
required
arv_country_id
null 
required
sender_taxno
string 
required
sender_name
string 
required
sender_address
string 
required
sender_postcode
string 
required
sender_city
string 
required
sender_country_id
string 
required
sender_eori_code
string  | null 
required
consignee_taxno
string 
required
consignee_name
string 
required
consignee_address
string 
required
consignee_postcode
string 
required
consignee_city
string 
required
consignee_country_id
string 
required
consignee_eori_code
null 
required
packs_attributes
array [object {3}] 
required
documents_attributes
array[string]
required
produced_documents_attributes
array [object {5}] 
required
Example
{
    "reference": "SF240047SUPREME",
    "doc_type": "ENS",
    "doc_date": "2024-12-20",
    "vehicle_code": "SPV4321",
    "vehicle_coun": "ES",
    "trailer_code": "ES567Z",
    "trailer_coun": "ES",
    "container": "CNT6789",
    "departure_custom_code": "ES003301",
    "dispatch_country_id": "ES",
    "load_place": "ES",
    "arrival_custom_code": "DK004702",
    "destination_country_id": "DK",
    "unload_place": "DK",
    "trans_method": "air",
    "roro_operator_code": "AIR789",
    "status": "pending",
    "transit_countries_codes": "DK,FR,ES",
    "goods": [
        {
            "line_no": 1,
            "gtip_code": "01022969",
            "commodity": "Textiles",
            "brut_wg": 3500,
            "net_wg": 3400,
            "invoice_amount": "50.0",
            "invoice_curr": null,
            "exp_customs_type": null,
            "exp_customs_partial": null,
            "exp_customs_no": "",
            "manifesto_type": null,
            "dep_country_id": null,
            "arv_country_id": null,
            "sender_taxno": "938472239",
            "sender_name": "ABC CHEMICALS LTD.",
            "sender_address": "AYDEDE SOK NO 12",
            "sender_postcode": "34768",
            "sender_city": "İSTANBUL",
            "sender_country_id": "TR",
            "sender_eori_code": "",
            "consignee_taxno": "TAX123987",
            "consignee_name": "XYZ COMPANY",
            "consignee_address": "56 Via Roma",
            "consignee_postcode": "00100",
            "consignee_city": "Rome",
            "consignee_country_id": "IT",
            "consignee_eori_code": null,
            "packs_attributes": [
                {
                    "pack_type": "PK",
                    "pack_count": "250",
                    "notes": "Handle with care"
                },
                {
                    "pack_type": "BK",
                    "pack_count": "250",
                    "notes": "Keep dry"
                }
            ],
            "documents_attributes": [],
            "produced_documents_attributes": [
                {
                    "code": "N235",
                    "reference": "DOC987654",
                    "reason": "Export for Manufacturing",
                    "quantity": 1,
                    "scope": "Supporting Document"
                },
                {
                    "code": "N270",
                    "reference": "DOC987655",
                    "reason": "Export for Retail",
                    "quantity": 2,
                    "scope": "Supporting Document"
                },
                {
                    "code": "N842",
                    "reference": "DOC987656",
                    "reason": "Export for Trade Show",
                    "quantity": 3,
                    "scope": "Supporting Document"
                }
            ]
        },
        {
            "line_no": 2,
            "gtip_code": "01022961",
            "commodity": "Furniture",
            "brut_wg": 5500,
            "net_wg": 5300,
            "invoice_amount": "75.0",
            "invoice_curr": null,
            "exp_customs_type": null,
            "exp_customs_partial": null,
            "exp_customs_no": "",
            "manifesto_type": null,
            "dep_country_id": null,
            "arv_country_id": null,
            "sender_taxno": "",
            "sender_name": "CBA CHEMICALS LTD.",
            "sender_address": "10 Av. de la Libertad",
            "sender_postcode": "08010",
            "sender_city": "Barcelona",
            "sender_country_id": "ES",
            "sender_eori_code": null,
            "consignee_taxno": "",
            "consignee_name": "HGB COMPANY LTD.",
            "consignee_address": "78 Corso Magenta",
            "consignee_postcode": "20123",
            "consignee_city": "Milan",
            "consignee_country_id": "IT",
            "consignee_eori_code": null,
            "packs_attributes": [
                {
                    "pack_type": "Box",
                    "pack_count": "400",
                    "notes": "Fragile"
                },
                {
                    "pack_type": "Box",
                    "pack_count": "400",
                    "notes": "Fragile, keep upright"
                }
            ],
            "documents_attributes": [],
            "produced_documents_attributes": [
                {
                    "code": "N1234",
                    "reference": "DOC234567",
                    "reason": "Import for Resale",
                    "quantity": 1,
                    "scope": "Additional Referance"
                },
                {
                    "code": "B654",
                    "reference": "DOC234568",
                    "reason": "Export for Charity",
                    "quantity": 2,
                    "scope": "Additional Referance"
                },
                {
                    "code": "C910",
                    "reference": "DOC234569",
                    "reason": "Import for Exhibition",
                    "quantity": 3,
                    "scope": "Additional Referance"
                }
            ]
        }
    ]
}
🟠403Forbidden
🟠404Record Not Found
🟠400Bad Request
🟠422Unprocessable Entity
Modified at 2025-03-25 10:48:18
Previous
Create an NCTS Declaration with XML Data
Next
Update an NCTS Declaration
Built with