Submit
Submit new declaration.
2 Declaration Types
There are 2 types of declarations: Normal, VIP. Please check with your assigned technical support personnel to identify your declaration type.
Checking Declaration Status
Certain declarations may be approved immediately, while others might take some time to process. Upon submitting new declaration if status is not "APPROVED"/"REJECTED", you may check for change in status at a later time. There are 2 ways to check status: declaration/query API and callback.
Recommended apporach is to define a callback URl in declaration/submit API. Whenever there is a change in declaration status, declaration information will be sent to the defined callback URL via HTTP POST. This is more efficient than constantly polling declaration/query API.
Second approach is to call the declaration/query API. Repeated call to should be kept minimal, in order to reduce unnecessary load on both yours and XpressCover server.
Endpoint
/api/declaration/submit
Request
Request Parameter
Name
Mandatory
Description
Type
Default
type
Y
Declaration Type
char ( 1 )
N: Normal
C: VIP
user
Y
User ID
string ( 255 )
consignment_note
Y
Consignment Note
string ( 100 )
cover_date
Y
Cover Date
date ( YYYYMMDD )
from_country
Y
"Deliver from" country
ISO 3166-1 alpha-3 country code
to_country
Y
"Deliver to" country
ISO 3166-1 alpha-3 country code
remark
N
Remark
string ( 255 )
courier_code
Y
Courier Code
string ( 100 )
courier_others
Mandatory if courier_code == "OTHERS"
Courier Name
string ( 255 )
callback_url
N
Callback URL
string ( 255 )
Extra Request Parameter (Type = VIP Only)
Name
Mandatory
Description
Type
Default
from_address
Y
Send From Address
string ( 255 )
to_address
Y
Send To Address
string ( 255 )
goods_description
Y
Goods Description
string ( 255 )
total_value
Y
Total Declare Value
decimal ( 11, 2 )
Extra Request Parameter (Type = Normal Only)
Name
Mandatory
Description
Type
Default
from_city
Y
Send From City
string ( 255 )
to_city
Y
Send To City
string ( 255 )
items
Y
Declaration Items
Array ( Item )
Item Parameter
Name
Mandatory
Description
Type
Default
descriptions
Y
Descriptions
string ( 255 )
quantity
N
Quantity
integer
1
price
Y
Unit Price
decimal ( 11, 2 )
commodity_code
Y
Commodity Code
string ( 10 )
Example Request (VIP):
Example Request (Normal):
Response
Successful Response Params
Name
Description
Type
declaration
Declaration
Declaration Model
Example Response (VIP):
Example Response (Normal):
Callback URL
If defined callback_url when submit declaration, any update to declaration will initiate HTTP POST request to callback_url with body content = declaration model in json format.
callback_url must return with HTTP response ( 200 ) and body content in json format with status = OK
If request to callback_url failed, XpressConnect will retry in 30 seconds interval, for maximum 3 times ( inclusive 1st request )
Example PHP Code
Last updated
Was this helpful?