Update declaration item
curl --request PATCH \
--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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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 => "PATCH",
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("PATCH", 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.patch("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::Patch.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",
"commodityCode": "6203429000",
"quantity": 510,
"grossMass": 250,
"netWeight": 220,
"netPrice": 1901.2,
"currency": "EUR",
"originCountry": "CN"
}
Declaration Items
Update declaration item
Partial update with the same propagation options as PUT.
PATCH
/
v1
/
declaration-items
/
{id}
Update declaration item
curl --request PATCH \
--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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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 => "PATCH",
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("PATCH", 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.patch("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::Patch.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",
"commodityCode": "6203429000",
"quantity": 510,
"grossMass": 250,
"netWeight": 220,
"netPrice": 1901.2,
"currency": "EUR",
"originCountry": "CN"
}
Perform a partial update on a declaration item, targeting specific values or linked customs documents.
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
Detailed description of the goods.
string
The Harmonized System HS code for the goods.
number
The number of units.
number
Net mass of the item in kilograms.
number
The value or net price of the items.
string
The currency code (e.g.,
EUR, USD).string
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",
"commodityCode": "6203429000",
"quantity": 510,
"grossMass": 250,
"netWeight": 220,
"netPrice": 1901.2,
"currency": "EUR",
"originCountry": "CN"
}
⌘I