Replace declaration item
curl --request PUT \
--url https://sandbox-api.easecustoms.com/v1/declaration-items/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"commodityCode": "<string>",
"quantity": 123,
"netWeight": 123,
"netPrice": 123,
"currency": "<string>",
"originCountry": "<string>",
"additionalProcedureCodes": [
"<string>"
],
"SupportingDocuments": [
{}
],
"AdditionalReferences": [
{}
]
}
'import requests
url = "https://sandbox-api.easecustoms.com/v1/declaration-items/{id}"
payload = {
"description": "<string>",
"commodityCode": "<string>",
"quantity": 123,
"netWeight": 123,
"netPrice": 123,
"currency": "<string>",
"originCountry": "<string>",
"additionalProcedureCodes": ["<string>"],
"SupportingDocuments": [{}],
"AdditionalReferences": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
commodityCode: '<string>',
quantity: 123,
netWeight: 123,
netPrice: 123,
currency: '<string>',
originCountry: '<string>',
additionalProcedureCodes: ['<string>'],
SupportingDocuments: [{}],
AdditionalReferences: [{}]
})
};
fetch('https://sandbox-api.easecustoms.com/v1/declaration-items/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.easecustoms.com/v1/declaration-items/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'commodityCode' => '<string>',
'quantity' => 123,
'netWeight' => 123,
'netPrice' => 123,
'currency' => '<string>',
'originCountry' => '<string>',
'additionalProcedureCodes' => [
'<string>'
],
'SupportingDocuments' => [
[
]
],
'AdditionalReferences' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.easecustoms.com/v1/declaration-items/{id}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"commodityCode\": \"<string>\",\n \"quantity\": 123,\n \"netWeight\": 123,\n \"netPrice\": 123,\n \"currency\": \"<string>\",\n \"originCountry\": \"<string>\",\n \"additionalProcedureCodes\": [\n \"<string>\"\n ],\n \"SupportingDocuments\": [\n {}\n ],\n \"AdditionalReferences\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox-api.easecustoms.com/v1/declaration-items/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"commodityCode\": \"<string>\",\n \"quantity\": 123,\n \"netWeight\": 123,\n \"netPrice\": 123,\n \"currency\": \"<string>\",\n \"originCountry\": \"<string>\",\n \"additionalProcedureCodes\": [\n \"<string>\"\n ],\n \"SupportingDocuments\": [\n {}\n ],\n \"AdditionalReferences\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.easecustoms.com/v1/declaration-items/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"commodityCode\": \"<string>\",\n \"quantity\": 123,\n \"netWeight\": 123,\n \"netPrice\": 123,\n \"currency\": \"<string>\",\n \"originCountry\": \"<string>\",\n \"additionalProcedureCodes\": [\n \"<string>\"\n ],\n \"SupportingDocuments\": [\n {}\n ],\n \"AdditionalReferences\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 7,
"declarationId": 42,
"description": "Men's cotton trousers - updated",
"commodityCode": "6203421100",
"quantity": 500,
"grossMass": 250,
"netWeight": 220.5,
"netPrice": 1875.75,
"currency": "EUR",
"originCountry": "CN"
}
Declaration Items
Replace declaration item
Full update with propagation rules to linked delivery items.
PUT
/
v1
/
declaration-items
/
{id}
Replace declaration item
curl --request PUT \
--url https://sandbox-api.easecustoms.com/v1/declaration-items/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"commodityCode": "<string>",
"quantity": 123,
"netWeight": 123,
"netPrice": 123,
"currency": "<string>",
"originCountry": "<string>",
"additionalProcedureCodes": [
"<string>"
],
"SupportingDocuments": [
{}
],
"AdditionalReferences": [
{}
]
}
'import requests
url = "https://sandbox-api.easecustoms.com/v1/declaration-items/{id}"
payload = {
"description": "<string>",
"commodityCode": "<string>",
"quantity": 123,
"netWeight": 123,
"netPrice": 123,
"currency": "<string>",
"originCountry": "<string>",
"additionalProcedureCodes": ["<string>"],
"SupportingDocuments": [{}],
"AdditionalReferences": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
commodityCode: '<string>',
quantity: 123,
netWeight: 123,
netPrice: 123,
currency: '<string>',
originCountry: '<string>',
additionalProcedureCodes: ['<string>'],
SupportingDocuments: [{}],
AdditionalReferences: [{}]
})
};
fetch('https://sandbox-api.easecustoms.com/v1/declaration-items/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.easecustoms.com/v1/declaration-items/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'commodityCode' => '<string>',
'quantity' => 123,
'netWeight' => 123,
'netPrice' => 123,
'currency' => '<string>',
'originCountry' => '<string>',
'additionalProcedureCodes' => [
'<string>'
],
'SupportingDocuments' => [
[
]
],
'AdditionalReferences' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.easecustoms.com/v1/declaration-items/{id}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"commodityCode\": \"<string>\",\n \"quantity\": 123,\n \"netWeight\": 123,\n \"netPrice\": 123,\n \"currency\": \"<string>\",\n \"originCountry\": \"<string>\",\n \"additionalProcedureCodes\": [\n \"<string>\"\n ],\n \"SupportingDocuments\": [\n {}\n ],\n \"AdditionalReferences\": [\n {}\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://sandbox-api.easecustoms.com/v1/declaration-items/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"commodityCode\": \"<string>\",\n \"quantity\": 123,\n \"netWeight\": 123,\n \"netPrice\": 123,\n \"currency\": \"<string>\",\n \"originCountry\": \"<string>\",\n \"additionalProcedureCodes\": [\n \"<string>\"\n ],\n \"SupportingDocuments\": [\n {}\n ],\n \"AdditionalReferences\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.easecustoms.com/v1/declaration-items/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"commodityCode\": \"<string>\",\n \"quantity\": 123,\n \"netWeight\": 123,\n \"netPrice\": 123,\n \"currency\": \"<string>\",\n \"originCountry\": \"<string>\",\n \"additionalProcedureCodes\": [\n \"<string>\"\n ],\n \"SupportingDocuments\": [\n {}\n ],\n \"AdditionalReferences\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 7,
"declarationId": 42,
"description": "Men's cotton trousers - updated",
"commodityCode": "6203421100",
"quantity": 500,
"grossMass": 250,
"netWeight": 220.5,
"netPrice": 1875.75,
"currency": "EUR",
"originCountry": "CN"
}
Perform a full replacement of a declaration item, with propagation rules to update linked delivery items.
Path Parameters
number
required
The unique declaration item ID.
Query Parameters
string
required
Whether to update all linked delivery items.
- Options:
true,false
string
required
Whether to distribute aggregated values across delivery items.
- Options:
true,false
string
required
Whether to allow merging with another existing declaration item if the codes match.
- Options:
true,false
Body
string
required
Detailed description of the goods.
string
required
The Harmonized System HS code for the goods.
number
required
The number of units.
number
required
Net mass of the item in kilograms.
number
required
The value or net price of the items.
string
required
The currency code (e.g.,
EUR, USD).string
required
The two-letter ISO country code of origin (e.g.,
CN, US).string[]
Additional customs procedure codes.
object[]
Supporting documentation details.
object[]
Additional references for the item.
{
"id": 7,
"declarationId": 42,
"description": "Men's cotton trousers - updated",
"commodityCode": "6203421100",
"quantity": 500,
"grossMass": 250,
"netWeight": 220.5,
"netPrice": 1875.75,
"currency": "EUR",
"originCountry": "CN"
}
⌘I