メインコンテンツまでスキップ

Customs Declaration

POST 

/api/entry/customs

This API is used for merchants to submit additional order information required by customs.

  1. Currently, it only supports customs declaration to Chinese customs through WeChat Pay and Alipay, with the declaration currency limited to RMB.
  2. Before calling the API, you should ensure that the merchant has been registered with customs and obtained a customs registration number. You must also submit your customs information to Newage so that Newage can register your information with WeChat and Alipay.
  3. If the additional order information has been requested for customs declaration but the electronic port loses the order, you can use customs re-push to resend the information to customs (the state of the additional order information must be SUCCESS or EXCEPT).
  4. Modifications to customs declaration information are limited to changes in the merchant customs registration number, suborder amount, logistics fees, and product fees. If you change the merchant customs registration number, the new registration number and name will be used for re-declaration.
Here is a Java code example
// Set application parameters and keys
private static final String APP_RSA_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCMPiTuC1xHkCUu/TospfJ7IldcnqYWaB4L287ADssc91NJ0NHP9AXvepTee1StWxRVamcyH3yWRJSnsbTWRqE+tQWDZ21Rhg5AQ8KWZ9RpSK+f07eX1K0rMUl3xUouvJgWzWvHZlUoIqXBx76nU7upFo5CoKmnyXYrZ0K2hjM9+7cRXff4+LJ7Js7d8eFgMWKEm0IN+h4SMeRCuU5DgIXf4W0sUZuyFXiDuIbID1kArp9JnO5woSY/OYCM3PjesaXMLHunLR2hTj4yAYg2WVT85tsWCT+B3rBDhpuNgZhRrPn9cgzaHfXCfZrpX9B5uSleuFbUFCz+e7ZqSmQ0O5PJAgMBAAECggEAMy2KdIQYzNTBfQBT9m8oqd7CWr5ahdrA/DrenB/J52wqLMnThzvZ3qaxJO+E2y5doT4PIq9y27NzPC8RexCTTzroJCfeMN3m3XTc0d5aGYG49W5hlTq7ZwO5d8e7ZorURZ35Mu8ZLGhYbPrjjFR2KyJcD9xpjR1rzjMEmW8ny/o+z1nMMdt77bLddHVwVWqEMxuyy8DRIRcLU6yqQdrio+y6nt0fYjA5lKhiAhgcjehmNFAppeLGa0bZyUGnUsXEhHpfyvbGwVqh4m65RwXi1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5W19ssCyfdtNFy6DRAureoYV053ETPUefEA5bHDOQnjbb9PuNEfT651v8cqwEaTptaxj2zujsWI8Ad3R50EyQHsskQWms/gv2aB36XUM4vyOIk4P1f3dxtqigH0YROEYiuwFFqsyJuNSjJzNbCmfgqlQv/+pE/pOV9MIQe0CAdD26JF10QpSssEwKgvKvnXPUynVu09cjSEipev5cLJSApKSDZxrRjSFBXrh6nzg8JK05ehkI8wdsryRUneh0PGN0PgYLP/wjKiqlgTJaItxnb/JQIDAQAB";
private static final String APP_ID = "wz715fc0d10ee9d156";

private static final String GATEWAY_URL = "https://open.n-age.co.jp";

// Instantiate a client
OpenApiClient openapiClient = new OpenApiClient(APP_ID, GATEWAY_URL, APP_RSA_PRIVATE_KEY, GATEWAY_RSA_PUBLIC_KEY);

// Build a request object, set parameters
CustomsDeclarationRequest request = new CustomsDeclarationRequest();
request.setMerchant_no("312100007235");
request.setMerchant_order_no("TEST_CUSTOMS_" + System.currentTimeMillis());
request.setCustoms_declaration_request_id("TEST_CUSTOMS_" + System.currentTimeMillis());
request.setCustoms_declaration_request_type(1);
request.setCustoms("SHENZHEN");
request.setMerchant_customs_no("18918719091");
request.setMerchant_customs_name("XX公司");
request.setCurrency("CNY");
request.setCustoms_declaration_amount(100d);
request.setIs_split(false);

CustomsDeclarationResponse response;
try {
// Execute the request
response = openapiClient.execute(request);
} catch (OpenApiException e) {
// Handle network exceptions ......
// @TODO
System.err.println("\nrequest api error:" + e.getErrCode() + "->>" + e.getErrMsg());
return;
}
if (!response.isSuccess()) {
// Handle business exceptions ......
// @TODO
System.err.println("\napi execute error: " + JSON.toJSONString(response));
}

// Write your business code based on the API response ......
// @TODO

Request

Responses

Response Headers