Product Custom Codes
Working with product custom codes.
List Customs Codes
GET /v1/products/customs
List Customs Codes.
Return Type
array<ProductComponentCustomsCodes>
Available expands
| Field | Return Type | Description |
|---|---|---|
organisation | Organisations | Organisation data. |
Rate limit cost
Each call to this endpoint deducts 1 credit from your request bucket.
Scopes
This endpoint is only available for users with scope APP::PRODUCTS::READ.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("GET", "https://public-api.bladepro.io/v1/products/customs?expand=*", [
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.get 'https://public-api.bladepro.io/v1/products/customs?expand=*', {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "GET",
json: true,
uri: "https://public-api.bladepro.io/v1/products/customs?expand=*",
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request GET 'https://public-api.bladepro.io/v1/products/customs?expand=*' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86",
"paging": {
"page": 1,
"records": 1,
"per_page": 250,
"total_records": 1,
"total_pages": 1
}
},
"data": [
{
"id": 1,
"code": "8471",
"name": "Personal computers",
"duty_rate": 1.5,
"organisation_id": 1,
"created": "2019-11-25T14:52:56.000Z",
"modified": "2019-11-25T14:52:56.000Z"
}
]
}Create Customs Code
POST /v1/products/customs
Create a new customs code.
Request Body
Return Type
Types for the Request Body
CreateProductCustomsCode (root level)
| Key | Description | Types | Restrictions |
|---|---|---|---|
code | HS Code. | string | requirednot nullmin length is 4 |
name | Name of the code. | string | requirednot nullmin length is 1 |
duty_rate | The duty rate applied to this customs code. | number | requirednot nullmin is 0 |
Rate limit cost
Each call to this endpoint deducts 2 credits from your request bucket.
Scopes
This endpoint is only available for users with scope APP::PRODUCTS::MANAGE.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("POST", "https://public-api.bladepro.io/v1/products/customs", [
"body" => json_encode([
"code" => "8471",
"name" => "Personal computers",
"duty_rate" => 1.5,
]),
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.post 'https://public-api.bladepro.io/v1/products/customs', {
code: "8471",
name: "Personal computers",
duty_rate: 1.5,
}, {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "POST",
json: true,
uri: "https://public-api.bladepro.io/v1/products/customs",
body: {
"code": "8471",
"name": "Personal computers",
"duty_rate": 1.5
},
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request POST 'https://public-api.bladepro.io/v1/products/customs' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login' \
--data-raw '{
"code": "8471",
"name": "Personal computers",
"duty_rate": 1.5
}'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"id": 1,
"code": "8471",
"name": "Personal computers",
"duty_rate": 1.5,
"organisation_id": 1,
"created": "2019-11-25T14:52:56.000Z",
"modified": "2019-11-25T14:52:56.000Z"
}
}