Update Declaration by ID
Updates an existing declaration in the system with the provided information.
Request
PUT /api/v1/declarations/{declaration_id}
Parameters
| Name | Type | In | Description |
|---|---|---|---|
declaration_id | string | path | Required. The ID of the declaration to update |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer token for authentication |
Content-Type | Required. Must be application/json |
X-Target-Server | Required. Target server identifier |
Code Types
Representative Types
| Code | Description |
|---|---|
| 1 | Declaration Owner |
| 2 | Company and Legal Representative |
| 3 | Legal Representative |
Financial Officer Types
| Code | Description |
|---|---|
| 1 | Certified Public Accountant |
| 2 | Public Accountant |
| 3 | Independent Accountant |
Operation Types
| Code | Description |
|---|---|
| EU | Transit |
| AN | Antrepo |
| EX | Export |
| IM | Import |
Authorized Types
| Code | Description |
|---|---|
| 1 | Company |
| 2 | Person |
Incoterms Codes
| Code | Description |
|---|---|
| CF | Cost and Freight |
| CFR | Cost and Freight |
| CI | Cost and Insurance |
| CIF | Cost, Insurance and Freight |
| CIP | Carriage and Insurance Paid To |
| CPT | Carriage Paid To |
| DAF | Delivered At Frontier |
| DAP | Delivered At Place |
| DAT | Delivered At Terminal |
| DDP | Delivered Duty Paid |
| DDU | Delivered Duty Unpaid |
| DEQ | Delivered Ex Quay |
| DES | Delivered Ex Ship |
| DPU | Delivered at Place Unloaded |
| EXQ | Ex Quay |
| EXS | Ex Ship |
| EXW | Ex Works |
| FAS | Free Alongside Ship |
| FCA | Free Carrier |
| FOA | Free On Aircraft |
| FOB | Free On Board |
| FOR | Free On Rail |
| FOT | Free On Truck |
| XXX | Other |
Transaction Attribute Codes
| Code | Description |
|---|---|
| 7 | Normal |
| 8 | Return |
| 9 | Return with Different Declaration |
| 11 | Normal |
| 12 | Return |
| 13 | Return with Different Declaration |
| 14 | Normal |
| 15 | Return |
| 21 | Normal |
| 22 | Return |
| 23 | Return with Different Declaration |
| 31 | Normal |
| 32 | Return |
| 33 | Return with Different Declaration |
| 34 | Normal |
| 41 | Normal |
| 42 | Return |
| 43 | Return with Different Declaration |
| 51 | Normal |
| 52 | Return |
| 53 | Return with Different Declaration |
| 61 | Normal |
| 62 | Return |
Approver Types
| Code | Description |
|---|---|
| 1 | Representative |
| 2 | Legal Entity |
| 3 | Customs Broker |
Vehicle Information Types
| Code | Description |
|---|---|
| registration_number | Registration Number |
| name | Name |
| plate | Plate |
Vehicle Types
| Code | Description |
|---|---|
| vehicle | Vehicle |
| train | Train |
| plane | Plane |
| ship | Ship |
Entry of Transport Document
| Code | Description |
|---|---|
| single | Single |
| multiple | Multiple |
Entire Transport Document
| Code | Description |
|---|---|
| entire | Entire |
| partial | Partial |
Transport Type Codes
| Code | Description |
|---|---|
| 10 | Road Transport |
| 12 | Road Transport |
| 16 | Road Transport |
| 17 | Road Transport |
| 18 | Road Transport |
| 20 | Rail Transport |
| 23 | Rail Transport |
| 30 | Air Transport |
| 31 | Air Transport |
| 40 | Sea Transport |
| 50 | Sea Transport |
| 70 | Sea Transport |
| 80 | Sea Transport |
| 90 | Sea 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 Code | Description |
|---|---|
| 204 | Success - Declaration updated successfully |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing authentication token |
| 404 | Not Found - Declaration ID does not exist |
| 500 | Internal 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.