Skip to main content

Update Declaration by ID

Updates an existing declaration in the system with the provided information.

Request

PUT /api/v1/declarations/{declaration_id}

Parameters

NameTypeInDescription
declaration_idstringpathRequired. The ID of the declaration to update

Headers

NameDescription
AuthorizationRequired. Bearer token for authentication
Content-TypeRequired. Must be application/json
X-Target-ServerRequired. Target server identifier

Code Types

Representative Types

CodeDescription
1Declaration Owner
2Company and Legal Representative
3Legal Representative

Financial Officer Types

CodeDescription
1Certified Public Accountant
2Public Accountant
3Independent Accountant

Operation Types

CodeDescription
EUTransit
ANAntrepo
EXExport
IMImport

Authorized Types

CodeDescription
1Company
2Person

Incoterms Codes

CodeDescription
CFCost and Freight
CFRCost and Freight
CICost and Insurance
CIFCost, Insurance and Freight
CIPCarriage and Insurance Paid To
CPTCarriage Paid To
DAFDelivered At Frontier
DAPDelivered At Place
DATDelivered At Terminal
DDPDelivered Duty Paid
DDUDelivered Duty Unpaid
DEQDelivered Ex Quay
DESDelivered Ex Ship
DPUDelivered at Place Unloaded
EXQEx Quay
EXSEx Ship
EXWEx Works
FASFree Alongside Ship
FCAFree Carrier
FOAFree On Aircraft
FOBFree On Board
FORFree On Rail
FOTFree On Truck
XXXOther

Transaction Attribute Codes

CodeDescription
7Normal
8Return
9Return with Different Declaration
11Normal
12Return
13Return with Different Declaration
14Normal
15Return
21Normal
22Return
23Return with Different Declaration
31Normal
32Return
33Return with Different Declaration
34Normal
41Normal
42Return
43Return with Different Declaration
51Normal
52Return
53Return with Different Declaration
61Normal
62Return

Approver Types

CodeDescription
1Representative
2Legal Entity
3Customs Broker

Vehicle Information Types

CodeDescription
registration_numberRegistration Number
nameName
platePlate

Vehicle Types

CodeDescription
vehicleVehicle
trainTrain
planePlane
shipShip

Entry of Transport Document

CodeDescription
singleSingle
multipleMultiple

Entire Transport Document

CodeDescription
entireEntire
partialPartial

Transport Type Codes

CodeDescription
10Road Transport
12Road Transport
16Road Transport
17Road Transport
18Road Transport
20Rail Transport
23Rail Transport
30Air Transport
31Air Transport
40Sea Transport
50Sea Transport
70Sea Transport
80Sea Transport
90Sea Transport

Request Body

The request body should contain the following structure:

{
"senders": [
{
"id": "string",
"name": "string",
"tax_identification_number": "string",
"address": "string",
"country": {
"code": "string",
"name": "string"
},
"type": "number",
"is_default": "boolean"
}
],
"receiver": {
"name": "string",
"tax_identification_number": "string",
"address": "string",
"country": {
"code": "string",
"name": "string"
},
"type": "number",
"is_auto_generated": "boolean"
},
"financial_officer": {
"name": "string",
"surname": "string",
"tax_identification_number": "string",
"type": "number"
},
"representative": {
"name": "string",
"surname": "string",
"address": "string",
"tax_identification_number": "string",
"type": "number"
},
"operation_type": "string",
"incoterms": {
"code": "string",
"delivery_place": "string"
},
"insurance": {
"insurance_documents": [
{
"id": "string",
"name": "string",
"url": "string",
"type": "string",
"hash": "string",
"size": "number",
"created_at": "string"
}
],
"policy_documents": [
{
"id": "string",
"name": "string",
"url": "string",
"type": "string",
"hash": "string",
"size": "number",
"created_at": "string"
}
]
},
"invoices": {
"other_invoices": [
{
"id": "string",
"name": "string",
"url": "string",
"type": "string",
"hash": "string",
"size": "number",
"created_at": "string"
}
],
"e_invoices": [
{
"file": {
"id": "string",
"name": "string",
"url": "string",
"type": "string",
"hash": "string",
"size": "number",
"created_at": "string"
},
"invoice_no": "string",
"date": "string",
"amount": "number",
"currency": "string",
"type": "number",
"company": "string",
"vkn": "string"
}
]
},
"transaction_attribute_code": "number",
"shipment_reference_number": "string",
"approver": {
"type": "number",
"name": "string",
"surname": "string",
"title": "string",
"registration_number": "string",
"address": "string"
},
"previous_declaration": {
"is_regime_applied": "boolean",
"date": "string",
"reference_code": "string",
"entire_transport_document": "string",
"is_item_in_package": "boolean",
"is_any_other_regime_will_open": "boolean",
"entry_of_transport_document": "string",
"transport_document_no": "string"
},
"logistic": {
"is_container": "boolean",
"in_border_carrier_type": {
"code": "number",
"name": "string"
},
"internal_carrier_type": {
"code": "number",
"name": "string"
},
"loading_or_unloading_area": "string",
"customs_administration_name": "string",
"product_control_area_name": "string",
"antrepo_code": "string",
"first_arrival_or_last_shipment_country": {
"code": "string",
"name": "string"
}
},
"transport_vehicle_information": {
"vehicle_information_type": "string",
"vehicle_information": "string",
"vehicle_information_country": {
"code": "string",
"name": "string"
}
},
"border_crossing_vehicle_information": {
"vehicle_type": "string",
"vehicle_information_type": "string",
"vehicle_information": "string",
"vehicle_registration_country": {
"code": "string",
"name": "string"
}
},
"source_country": {
"code": "string",
"name": "string"
},
"shipment_or_export_country": {
"code": "string",
"name": "string"
},
"target_country": {
"code": "string",
"name": "string"
}
}

Example

curl --request PUT \
--url '{{HOST}}/api/v1/declarations/682735a3b702ddb736a9b9f3' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--header 'X-Target-Server: declaration' \
--data '{
"senders": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "ABC Company Ltd.",
"tax_identification_number": "1234567890",
"address": "123 Business Street, Istanbul, Turkey",
"country": {
"code": "F01",
"name": "Turkey"
},
"type": 1,
"is_default": true
}
],
"receiver": {
"name": "XYZ Trading Co.",
"tax_identification_number": "9876543210",
"address": "456 Trade Avenue, London, UK",
"country": {
"code": "F01",
"name": "United Kingdom"
},
"type": 1,
"is_auto_generated": false
},
"financial_officer": {
"name": "John",
"surname": "Doe",
"tax_identification_number": "12345678901",
"type": 1
},
"representative": {
"name": "Jane",
"surname": "Smith",
"address": "789 Representative Street, Istanbul, Turkey",
"tax_identification_number": "98765432101",
"type": 1
},
"operation_type": "EX",
"incoterms": {
"code": "FOB",
"delivery_place": "Istanbul Port"
},
"insurance": {
"insurance_documents": [
{
"id": "123e4567-e89b-12d3-a456-426614174001",
"name": "insurance_policy.pdf",
"url": "https://example.com/insurance_policy.pdf",
"type": "application/pdf",
"hash": "abc123def456",
"size": 1024.5,
"created_at": "2024-03-20T10:00:00Z"
}
],
"policy_documents": [
{
"id": "123e4567-e89b-12d3-a456-426614174002",
"name": "policy_document.pdf",
"url": "https://example.com/policy_document.pdf",
"type": "application/pdf",
"hash": "def456abc789",
"size": 2048.0,
"created_at": "2024-03-20T10:00:00Z"
}
]
},
"invoices": {
"other_invoices": [
{
"id": "123e4567-e89b-12d3-a456-426614174003",
"name": "invoice.pdf",
"url": "https://example.com/invoice.pdf",
"type": "application/pdf",
"hash": "ghi789jkl012",
"size": 1536.0,
"created_at": "2024-03-20T10:00:00Z"
}
],
"e_invoices": [
{
"file": {
"id": "123e4567-e89b-12d3-a456-426614174005",
"name": "e_invoice.pdf",
"url": "https://example.com/e_invoice.pdf",
"type": "application/pdf",
"hash": "mno345pqr678",
"size": 1024.0,
"created_at": "2024-03-20T10:00:00Z"
},
"invoice_no": "INV-2024-001",
"date": "2024-03-20",
"amount": 1000.00,
"currency": "USD",
"type": 1,
"company": "ABC Company Ltd.",
"vkn": "1234567890"
}
]
},
"transaction_attribute_code": 11,
"shipment_reference_number": "REF-2024-001",
"approver": {
"type": 1,
"name": "Michael",
"surname": "Johnson",
"title": "Senior Customs Broker",
"registration_number": "CB123456",
"address": "101 Approver Street, Istanbul, Turkey"
},
"previous_declaration": {
"is_regime_applied": true,
"date": "2024-03-19",
"reference_code": "PD-2024-001",
"entire_transport_document": "entire",
"is_item_in_package": true,
"is_any_other_regime_will_open": false,
"entry_of_transport_document": "single",
"transport_document_no": "TD-2024-001"
},
"logistic": {
"is_container": true,
"in_border_carrier_type": {
"code": 10,
"name": "Road Transport"
},
"internal_carrier_type": {
"code": 10,
"name": "Rail Transport"
},
"loading_or_unloading_area": "Istanbul Port Area A",
"customs_administration_name": "Istanbul Customs",
"product_control_area_name": "Istanbul Control Area",
"antrepo_code": "ANT-001",
"first_arrival_or_last_shipment_country": {
"code": "F01",
"name": "Turkey"
}
},
"transport_vehicle_information": {
"vehicle_information_type": "name",
"vehicle_information": "34ABC123",
"vehicle_information_country": {
"code": "F01",
"name": "Turkey"
}
},
"border_crossing_vehicle_information": {
"vehicle_type": "vehicle",
"vehicle_information_type": "name",
"vehicle_information": "34XYZ789",
"vehicle_registration_country": {
"code": "F01",
"name": "Turkey"
}
},
"source_country": {
"code": "F01",
"name": "Turkey"
},
"shipment_or_export_country": {
"code": "F01",
"name": "Turkey"
},
"target_country": {
"code": "F01",
"name": "United Kingdom"
}
}'

Response

A successful request returns an HTTP 200 status code with the updated declaration data.

Status Codes

Status CodeDescription
204Success - Declaration updated successfully
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing authentication token
404Not Found - Declaration ID does not exist
500Internal Server Error

Notes

  • All fields in the request body are optional. Only the fields that need to be updated should be included in the request.
  • The declaration ID in the URL must be valid and exist in the system.
  • The request must include valid authentication and authorization headers.