Developer/Connection method/API Type/API Type Cross-Border Pack Interface Specifications

API Type Cross-Border Pack Interface Specifications

Interface MethodHTTP(S)
Transmission MethodPOST
Timeout Period75 seconds (*1)
Data TypeJSON
Character CodesUTF-8
NoInterface Code<Interface Name>Interface DescriptionInterface TypeDate and time of requestRequest toRemarks
01SBPS-IF-OPEN-01Payment requestInterface for carrying out the payment processing.Synchronous/AsynchronousMerchantSBPS(CT)(※1)
02SBPS-IF-OPEN-02Payment History SearchInterface that checks the specified payment transaction history (status) (refund history is not included in this search)SynchronizationMerchantSBPS(CT)(※1)
* Another API (SBPS-IF-OPEN-03) is used for refund transactions.
03SBPS-IF-OPEN-03Refund requestRefund requestSynchronous/AsynchronousMerchantSBPS(CT)(※1)
04SBPS-IF-OPEN-04Refund History SearchInterface that check the specified refund transaction history (status)SynchronizationMerchantSBPS(CT)(※1)
05SBPS-IF-OPEN-05Payment CancellationInterface for resolving inconsistency in the payment status
by sending a payment cancellation message if a payment timeout occurs.
Synchronous/AsynchronousMerchantSBPS(CT)(※1)
06SBPS-IF-OPEN-06Result NotificationWhen payType of "Payment Request" is "02" and "returnUrl" is a valid http address, 
OPRAL sends the result notification about "http/https" to "returnUrl" after receiving the payment success reply.
AsynchronousSBPS(CT)Merchant(※1)
07SBPS-IF-OPEN-07Customs Clearance RequestAfter an online payment is completed, 
the Customs Clearance Request interface can be called to carry out the customs clearance modification request process when the customs clearance request status is "2 - Application."
SynchronizationMerchantSBPS(CT)(※1)
08SBPS-IF-OPEN-08Customs Clearance History SearchInterface for searching results of customs clearance request.SynchronizationMerchantSBPS(CT)(※1)
09SBPS-IF-OPEN-09Customs Clearance Re-requestThe customs clearance can be requested again when the customs clearance request status is "2 - Application."SynchronizationMerchantSBPS(CT)(※1)
*1 The meaning of the HTTP(S) timeout, even when an HTTPS timeout occurs after a task request message is sent, the payment gateway auto-cancellation, auto-refund, and other processes are not carried out, so make the task request again.
If notification messages from payment gateways are not received, we recommend that the client check the transaction status and carry out the succeeding processes (continuation of the task, cancellation, refund, re-request for the task, and so on). See the abnormal series of each system process sequence.
Interface NamePayment request
Request TypePOST
URLTest environment URL: https://{stg-url}/api/pay/pay/openCreate
Production environment URL:https://{prod-url}/api/pay/pay/openCreate
Interface ApplicationsInterface for carrying out the payment processing.
ParametersColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional, C: Conditionally required)Remarks
1clientOrderNo  Terminal Processing Serial NumberString32YA process sequential number generated by the Merchant side. 
The SBPS (CT) gateway checks the uniqueness.
2orderPrice  Payment amountInt11YIt must be greater than or equal to 1 yen and must be an integer.
3orderSubject  Payment TitleString50Y“Purchased Item” fixed
4payType  Reading MethodString2Y02: Web Type (PC payment)
04: Mini program type
05: InAPP type
06: Web type (Smartphone payment)
5BrandType  Financial InstitutionString2Y02:WeChat Pay
6returnUrl  URL to which the result is notifiedString128CUsed when notifying the merchant APP of the payment request result when payType="02", "04", or "05" is specified.
7openId  EU User LabelString128CRequired when payType="04", "05"
8subAppId  Contract Account IDString128CRequired when payType="04", "05"
9redirectUrl  Redirect URL String256NOptional when payType="06"
10expireTime  Expiry time (in seconds)int5NValid values [60 to 7200]. Default 7200 seconds.
11logisticsType  Customs Clearance Declaration TypeString2N00: clientOrderNo application type
(The client shall completely ensure the uniqueness of clientOrderNo. This payment gateway uses clientOrderNo to make a customs clearance application.)
01: gwOrderNo application type
(This payment gateway uses gwOrderNo whose uniqueness is ensured to make a customs clearance application.)

Default value: 00: clientOrderNo application type
Request Example
{
“clientOrderNo”: “12345678901234567890”,
“orderPrice”:100,
“orderSubject”:”Purchased Item”,
“payType”:”02″,
“brandType”:”02″,
“returnUrl”:”https://www.test.com/”
}
Response BODYColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional, C: Conditionally required)Description
1result  Payment Request Result StructureStringNIf resultType="SUCCESS", all columns are returned.
2 clientOrderNo Terminal Processing Serial NumberString32NProcessing number generated by the merchant
3 gwOrderNo GW Processing Serial NumberString32NProcessing sequence number generated by GW
4 BrandOrderNo Financial Institution NumberString50NPayment number generated by the financial institution
5 customerId Customer IDString30NNumber indicating the individual end user
* As for WeChat, this corresponds to "openid"
6 orderSubject Payment TitleString50N“Purchased Item” fixed
7 currencyType Payment CurrencyString10N“JPY” fixed
8 orderPrice Payment amountInt11N
9 orderStatus Payment StatusInt4N0: Waiting for payment
1: Payment success
2: Payment in progress
3: Payment failed
4: Payment cancellation
7: Payment in progress by end user
10 BrandType Financial InstitutionString2N02: WeChatPay
11 codeUrl Payment URLString128NResponse when payType="02"
12 partnerId Merchant Identification NumberString128NMerchant ID managed by the financial institution. (subMerchantId)
This is returned only when payType = "05."
13 prepayId Prepaid IDString30NThe prepayment success code is responded by the payment institution, and the corresponding field exists when payType = “04: Mini Program Type” and “05: InAPP Type Payment”.
14 orderStartTime Payment start timeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
15 orderFinishTime Payment Completed TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
16resultCode  Processing Result CodeString64Y 
17resultMessage  Processing Result MSGString1024Y 
18resultType  Processing Result TypeString15YThis result is the result of the process of the payment request and different from the payment status.
This is SUCCESS when the payment request is normally created and the communication interface of the financial institution is normally called.
The return value is FAILED in the following cases:
1. When the transaction number already exists
2. When failed to call the interface of the financial institution
3. When an internal system error occurs
Response example (please note that the columns are in random order)
{
"result":{
“clientOrderNo”:”samplecode”,
“gwOrderNo”:”samplecode”,
“brandOrderNo”:”samplecode”,
“orderSubject”:”Purchased Item”,
“currencyType”:”JPY”,
“orderPrice”:100,
“prepayId”:”Sample prepayID”
“codeUrl”:”sample URI”,
“orderStatus”:0,
“brandType”:”02″
“orderStartTime”:”2018-01-01 00:00:01″
},
“resultCode”:”0000″,
“resultMessage”:”null”,
“resultType”:”SUCCESS”
}
Interface NamePayment History Search
Request TypePOST
URLTest environment URL: https://{stg-url}/api/pay/orderInfo/openGet
Production environment URL: https://{prod-url}/api/pay/orderInfo/openGet
Interface ApplicationsInterface that checks the specified payment transaction history (status) (refund history is not included in this search)
ParametersColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Remarks
1clientOrderNo  Terminal Processing Serial NumberString32Y (/N)Set either the terminal processing serial number, GW settlement agency number, or settlement agency number on the left.
2gwOrderNo  GW Financial Institution NumberString32Y (/N)Set either the terminal processing serial number, GW settlement agency number, or settlement agency number on the left.
3BrandOrderNo  Financial Institution NumberString50Y (/N)Set either the terminal processing serial number, GW settlement agency number, or settlement agency number on the left.
Request Example
{
“clientOrderNo”: “12345678901234567890”
}
Response BODYColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Description
1result  Payment Request Result StructureStringNAll the columns are returned 
when resultType = "SUCCESS"
2 clientOrderNo Terminal Processing Serial NumberString32NProcessing number generated by the merchant
3 gwOrderNo GW Processing Serial NumberString32NProcessing sequence number generated by GW
4 BrandOrderNo Financial Institution NumberString50NPayment number generated by the financial institution
5 customerId Customer IDString30NNumber indicating the individual end user
* As for WeChat, this corresponds to "openid"
6 orderSubject Payment TitleString50N“Purchased Item” fixed
7 currencyType Payment CurrencyString10N“JPY” fixed
8 orderPrice Payment amountInt11N 
9 Exchange Rate Exchange RateTring16NExample: 0.056236
10 actualPrice Local Currency Payment AmountInt11NThe smallest unit of local currency
11 BrandType Financial InstitutionString2N02: WeChatPay
12 orderStatus Payment StatusInt4N0: Waiting for payment
1: Payment success
2: Payment in progress
3: Payment failed
4: Payment cancellation
7: Payment in progress by end user
13 codeUrl Payment URLString128NIf payType="02,"04", "codeUrl" will be responded.
14 prepayId Prepaid IDString30NThe prepaid success code is returned by the payment institute, 
and its corresponding field is included when payType = "04: Mini program type" or "05: InAPP type payment."
15 orderStartTime Payment start timeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
16orderFinishTime Payment Completed TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
17resultCode  Processing Result CodeString64Y 
18resultMessage  Processing Result MSGString1024Y 
19resultType  Processing Result TypeString15YThis result is the result of the process of the payment request and different from the payment status.
This is SUCCESS when the payment request is normally created 
and the communication interface of the financial institution is normally called.
The return value is FAILED in the following cases:
1. When the transaction number already exists
2. When failed to call the interface of the financial institution
3. When an internal system error occurs
Response example (please note that the columns are in random order)
{
"result":{
“clientOrderNo”:”samplecode”,
“gwOrderNo”:”samplecode”,
“brandOrderNo”:”samplecode”,
“orderSubject”:”Purchased Item”,
“currencyType”:”JPY”,
“orderPrice”:100,
“prepayId”:”Sample prepayID”
“codeUrl”:”sample URI”,
“orderStatus”:0,
“brandType”:”02″
“orderStartTime”:”2018-01-01 00:00:01″
},
“resultCode”:”0000″,
“resultMessage”:”null”,
“resultType”:”SUCCESS”
}
Interface NameRefund request
Request TypePOST
URLTest environment URL: https://{stg-url}/api/pay/refund/openCreate
Production environment URL:https://{prod-url}/api/pay/refund/openCreate
Interface ApplicationsPayment Processing Interface
ParametersColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Remarks
1clientOrderNo  Terminal Processing Serial NumberString32YSet the terminal processing serial number at the time of payment request
2gwOrderNo  GW Processing Serial NumberString32YGW processing serial number at the time of payment request
3clientRefundNo  Terminal Refund Processing Serial NumberString32YRefund processing serial numbers generated by merchant side,
A unique check is performed on the GW side.
4refundPrice  Refund AmountInt11YThe amount of refund shall be an integer greater than or equal to the minimum amount of refund 
and less than or equal to the payment amount.
Request Example
{
“clientOrderNo”: “12345678901234567890”
}
Response BODYColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional, C: Conditionally required)Description
1result  Refund Request Result StructureStringNAll the columns are returned 
when resultType = "SUCCESS"
2 clientRefundNo Terminal Refund Processing Serial NumberString32NProcessing number generated by the merchant
3 gwRefundNo GW Refund Processing Serial NumberString32NRefund processing sequence number generated by GW
4 brandRefundNo Financial Institution Refund NumberString50NFinancial institution refund number generated by the financial institution
5 clientOrderNo Terminal Processing Serial NumberString32NTerminal processing serial number at the time of payment request
6 gwOrderNo GW Processing Serial NumberString32NGW processing serial number at the time of payment request
7 BrandOrderNo Financial Institution NumberString50NFinancial institution number at the time of payment request
8 orderPrice Payment amountInt11NPayment amount at the time of payment request
9 refundStartTime Refund Start TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
10 refundFinishTime Refund Completion TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
11 currencyType Payment CurrencyString10N“JPY” fixed
12 refundPrice Refund AmountInt11N<= Payment amount at time of payment request
13 Exchange Rate Exchange RateString16NExample: 0.056236
14 actualPrice Local Currency Payment AmountInt11NThe smallest unit of local currency
15refundStatus Refund StatusInt4N1: Refund success
3: Refund failed
16resultCode  Processing Result CodeString64Y 
17resultMessage  Processing Result MSGString1024Y 
18resultType  Processing Result TypeString15YThis result is the result of the process of the payment request and different from the payment status.
This is SUCCESS when the payment request is normally created 
and the communication interface of the financial institution is normally called.
The return value is FAILED in the following cases:
1. When the transaction number already exists
2. When failed to call the interface of the financial institution
3. When an internal system error occurs
Response example (please note that the columns are in random order)
{
"result":{
“clientRefundNo”:”samplecode”,
“gwRefundNo”:”samplecode”,
“brandRefundNo”:”2008012001201706261093075024″,
“clientOrderNo”:”samplecode”,
“gwOrderNo”:”samplecode”,
“brandOrderNo”:”2008012001201706261093075024″,
“orderPrice”:100,
“refundStartTime”:”2017-06-26 12:23:31″,
“refundFinishTime”:”2017-06-26 12:23:33″,
“currencyType”:”JPY”, “refundPrice”:100,
“refundStatus”:1
},
“resultCode”:”0000″,
“resultMessage”:”null”,
“resultType”:”SUCCESS”
}
Interface NameRefund History Search
Request TypePOST
URLTest environment URL: https://{stg-url}/api/pay/refundInfo/openGet
Production environment URL:https://{prod-url}/api/pay/refundInfo/openGet
Interface ApplicationsInterface that check the specified refund transaction history (status)
ParametersColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Remarks
1clientRefundNo  Terminal Refund Processing Serial NumberString32Y(/N)Set either the terminal refund processing serial number, GW refund processing number, or financial institution refund number on the left.
2gwRefundNo  GW Refund Processing Serial NumberString32Y(/N)Set either the terminal refund processing serial number, GW refund processing number, or financial institution refund number on the left.
3brandRefundNo  Financial Institution Refund NumberString50Y(/N)Set either the terminal refund processing serial number, GW refund processing number, or financial institution refund number on the left.
Request Example
{
“client_refund_no”: “samplecode”
}
Response BODYColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Description
1result  Refund Research Result StructureStringNAll the columns are returned when resultType = "SUCCESS."
"brandRefundNo" will be returned only for the Chinese financial institution.
2 clientRefundNo Terminal Refund Processing Serial NumberString32NProcessing number generated by the merchant
3 gwRefundNo GW Refund Processing Serial NumberString32NRefund processing sequence number generated by GW
4 brandRefundNo Financial Institution Refund NumberString50NFinancial institution refund number generated by the financial institution
5 clientOrderNo Terminal Processing Serial NumberString32NTerminal processing serial number at the time of payment request
6 gwOrderNo GW Processing Serial NumberString32NGW processing serial number at the time of payment request
7 BrandOrderNo Financial Institution NumberString50NFinancial institution number at the time of payment request
8 orderPrice Payment amountInt11NPayment amount at the time of payment request
9 refundStartTime Refund Start TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
10 refundFinishTime Refund Completion TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
11 currencyType Payment CurrencyString10N“JPY” fixed
12 refundPrice Refund AmountInt11NPayment amount at the time of payment request
13 Exchange Rate Exchange RateString16NExample: 0.056236
14 actualPrice Local Currency Payment AmountInt11NThe smallest unit of local currency
13 refundStatus Refund StatusInt4N1: Refund Successful 3: Refund Failure
14resultCode  Processing Result CodeString64Y 
15resultMessage  Processing Result MSGString1024Y 
16resultType  Processing Result TypeString15YThis result is the result of the process of the payment request and different from the payment status.
This is SUCCESS when the payment request is normally created 
and the communication interface of the financial institution is normally called.
The return value is FAILED in the following cases:
1. When an internal system error occurs
Response example (please note that the columns are in random order)
{
"result":{
“clientRefundNo”:”samplecode”,
“gwRefundNo”:”samplecode”,
“brandRefundNo”:”2008012001201706261093075024″,
“clientOrderNo”:”samplecode”,
“gwOrderNo”:”samplecode”,
“brandOrderNo”:”2008012001201706261093075024″, “orderPrice”:100,
“refundStartTime”:”2017-06-26 12:23:31″,
“refundFinishTime”:”2017-06-26 12:23:33″,
“currencyType”:”JPY”,
“refundPrice”:100,
“refundStatus”:1
},
”resultCode”:”0000″,
“resultMessage”:”null”,
“resultType”:”SUCCESS”
}
Interface NamePayment Cancellation
Request TypePOST
URLTest environment URL: https://{stg-url}/api/pay/pay/openClose
Production environment URL:https://{prod-url}/api/pay/pay/openClose
Interface ApplicationsAn interface that resolves settlement status discrepancies by sending a payment cancellation message when a payment timeout occurs.
ParametersColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Remarks
1clientOrderNo  Terminal Processing Serial NumberString32Y 
2gwOrderNo  GW Financial Institution NumberString32N 
Request Example
{
“clientOrderNo”: “4a5076b8d82d4e16a9d83ae6a2a40b94”,
“gwOrderNo”: “4a5076b8d82d4e16a9d83ae6a2a40b94”
}
Response BODYColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Description
1result  Payment Cancellation Result StructureStringNAll the columns are returned 
when resultType = "SUCCESS"
2 clientOrderNo Terminal Processing Serial NumberString32NProcessing number generated by the merchant
3 gwOrderNo GW Processing Serial NumberString32NProcessing sequence number generated by GW
4 orderSubject Payment TitleString50N“Purchased Item” fixed
5 currencyType Payment CurrencyString10N“JPY” fixed
6 orderPrice Payment amountInt11N 
7 orderStatus Payment StatusInt4N1: Payment Success
3: Payment Failed
4:Payment cancellation
8 BrandType Financial InstitutionString2N02:WeChat Pay
9 orderStartTime Payment start timeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
10resultCode  Processing Result CodeString64Y 
11resultMessage  Processing Result MSGString1024Y 
12resultType  Processing Result TypeString15YThis result is the result of the process of the payment request and different from the payment status.
This is SUCCESS when the payment request is normally created 
and the communication interface of the financial institution is normally called.
The return value is FAILED in the following cases:
1. When the transaction number already exists
2. When failed to call the interface of the financial institution
3. When an internal system error occurs
Response example (please note that the columns are in random order)
{
"result":{
“clientOrderNo”:”samplecode”,
“gwOrderNo”:”samplecode”,
“orderSubject”:”Purchased Item”,
“currencyType”:”JPY”,
“orderPrice”:100,
“orderStatus”:4,
“brandType”:”02″,
“orderStartTime”:”2018-01-01 00:00:01″
},
”resultCode”:”0000″,
“resultMessage”:”null”,
“resultType”:”SUCCESS”
}
Interface NameResult Notification
Request TypePOST
URLhttps://XXXX
returnUrl result notification URL in 01. payment request
Interface ApplicationsIf payType=“02” for “payment request” and “returnUrl” is a valid http address, OPRAL will send a “http/https” result notification to “returnUrl” after receiving a successful payment response.
Https HeadersAccept-Charset UTF-8
User-Agent OPREAL/v1
Accept-Language jp
ParametersColumn Name (English) (Level1)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Remarks
1clientOrderNoTerminal Processing Serial NumberString32NProcessing number generated by the merchant
2gwOrderNoGW Processing Serial NumberString32NProcessing sequence number generated by GW
3BrandOrderNoFinancial Institution NumberString50NPayment number generated by the financial institution
4customerIdCustomer IDString30NNumber indicating the individual end user
* As for WeChat and Alipay,
this corresponds to "openid" and "alipay_login_id," 
respectively
5orderSubjectPayment TitleString50N 
6currencyTypePayment CurrencyString10N“Purchased Item” fixed
7orderPricePayment amountint11N“JPY” fixed
8Exchange RateExchange RateString16NExample: 0.056236
9actualPriceLocal Currency Payment AmountInt11NThe smallest unit of local currency
10BrandTypeFinancial InstitutionString2N02: WeChatPay
11orderStatusPayment Statusint4N0: Waiting for payment
1: Payment Success
2: Payment in progress
3: Payment Failed
4:Payment cancellation
7: Payment in progress by end user
12orderStartTimePayment start timeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
13orderFinishTimePayment Completed TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
Response example (please note that the columns are in random order)
{
“clientOrderNo”:”samplecode”,
“gwOrderNo”:”samplecode”,
“brandOrderNo”:”samplecode”,
“customerId”:”asd8uy1j2e890sud89″,
“orderSubject”:”Purchased Item”,
“currencyType”:”JPY”,
“orderPrice”:100,
“brandType”:”02″,
“orderStatus”:1,
“orderStartTime”:”2018-01-01 00:00:01″,
“orderFinishTime”:”2018-01-01
00:00:02″    }
Response BODYColumn Name (English) (Level1)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Remarks
Any response is allowable provided httpcode is 200.
{

}
Interface NameCustoms Clearance Request
Request TypePOST
URLTest environment URL: https://{stg-url}/api/pay/customsDeclare/declare
Production environment URL:https://{prod-url}/api/pay/customsDeclare/declare
Interface ApplicationsWhen online payment is completed, the customs clearance request interface is invoked, and if the customs clearance request status is “2-declaration”, a customs clearance modification request can be implemented.
ParametersColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Remarks
1clientDeclareNo  Terminal Customs Clearance NumberString32YTerminal customs clearance number generated by merchant side,
A unique check is performed on the GW side.
2clientOrderNo  Terminal Processing Serial NumberString32YTerminal processing serial number generated by merchant side,
A unique check is performed on the GW side.
3subClientOrderNo  Sub-terminal Processing Serial NumberString32CA sub terminal process sequential number generated by the Merchant side. 
The gateway checks the uniqueness. (Required when the payment is divided)
4Customs  Customs CodeString32YGUANGZHOU_ZS Guangzhou (General Administration of Customs)
HANGZHOU_ZS Hangzhou (General Administration of Customs)
NINGBO Ningbo
ZHENGZHOU_BS Zhengzhou (Bonded logistics center)
CHONGQING Chongqing
SHANGHAI_ZS Shanghai (General Administration of Customs)
SHENZHEN Shenzhen
ZHENGZHOU_ZH_ZS Zhengzhou general bonded area (General Administration of Customs)
TIANJIN Tianjin (if order sheets need to be sent to Tianjin customs, 
the registration information of Tianjin customs and the inspection record information of Tianjin need to be placed in the management backstage of the partner. 
To call the customs interface, 
just pushing the Tianjin customs requests the customs interface.)
5mchCustomsNo  Supplier Customs Notification NumberString50YPartner's application number registered with the customs
6duty  Customs Dutiesint11NThe currency type is CNY, and the minimum unit is fen
7isAdd  Additional FlagsString2NAdditional Flags
0: No
1: Yes
Default value: 1: Yes
8TransportFee  Sub-order Logistics Costsint11CThe currency type is CNY, and the minimum unit is fen.
Required unless subClientOrderNo is NULL
9productFee  Sub-order Logistics Costsint11CThe currency type is CNY, and the minimum unit is fen.
Required unless subClientOrderNo is NULL
10certId  Identification IDString64NIdentification Number
11name  NameString64NUser Name
Example
{
“clientOrderNo”:”samplecode”,
“clientDeclareNo”:”samplecode”,
“customs”:”SHENZHEN”,
“mchCustomsNo”:”samplecode”
}
Response BODYColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Description
1result  Customs Clearance Request Result StructureStringNAll the columns are returned 
when resultType = "SUCCESS"
2 clientDeclareNo Terminal Customs Clearance NumberString32N 
3 gwDeclareNo GW Customs Clearance Processing NumberString32N 
4 brandDeclareNo Financial Institution Customs Clearance NumberString80N 
5 clientOrderNo Terminal Processing Serial NumberString32N 
6 subClientOrderNo Sub-terminal Processing Serial NumberString32N 
7 subGwOrderNo GW Sub-Customs Clearance Processing NumberString32N 
8 subBrandOrderNo Sub-financial Institution Customs Clearance NumberString50N 
9 gwOrderNo GW Customs Clearance Processing NumberString32N 
10 BrandOrderNo Financial Institution Customs Clearance NumberString50N 
11 verifyDepartment Verification AgencyString16N 
12 verifyDepartmentTradeId Verification Agency Transaction Serial NumberString80N 
13 BrandType Financial InstitutionString2N02: WeChatPay
14 declareState Customs Statusint1N0: No application
1: Application success
2: Application submitted
3: Application failed
4: Application error
7: Application in progress
15 certCheckResult Authentication Statusint1N0: UNCHECKED The partner has not uploaded the purchaser's identification information.
1: SAME The purchaser's identification information uploaded by the partner is the same as the payer's.
2: DIFFERENT The purchaser's identification information uploaded by the partner is different from the payer's.
16 declareStartTime Customs Declaration Start TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
17 declareUpdateTime Customs Declaration Last Amendment TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
18 declareFinishTime Customs Clearance Completion TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
19resultCode  Processing Result CodeString64N 
20resultMessage  Processing Result MSGString1024Y 
21resultType  Processing Result TypeString15YThis result is the result of the process of the payment request and different from the customs clearance status.
This is SUCCESS when the customs clearance request is normally created 
and the customs clearance interface is normally called.
The return value is FAILED in the following cases:
1. When the terminal customs clearance sequential number already exists
2. When failed to call the customs clearance interface
3. When an internal system error occurs
Response example (please note that the columns are in random order)
{
"result":{
“clientOrderNo”:”samplecode”,
“gwOrderNo”:”samplecode”,
“brandOrderNo”:”samplecode”,
“clientDeclareNo”:”samplecode”,
“gwDeclareNo”:”samplecode”,
“brandDeclareNo”:”samplecode”,
“verifyDepartment”:”samplecode”,
“verifyDepartmentTradeId”:”samplecode”,
“certCheckResult”:”0″,
“certCheckResult”:”0″,
“declareState”:2,
“brandType”:”02″
“declareStartTime”:”2018-01-01 00:00:01″,
“declareUpdateTime”:”2018-01-01 00:00:01″
},
”resultCode”:”0000″,
“resultMessage”:”null”,
“resultType”:”SUCCESS”
}
Interface NameCustoms Clearance History Search
Request TypePOST
URLTest environment URL: https://{stg-url}/api/pay/customsDeclare/query
Production environment URL:https://{prod-url}/api/pay/customsDeclare/query
Interface ApplicationsInterface for searching results of customs clearance request.
ParametersColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Remarks
1clientDeclareNo  Terminal Customs Clearance NumberString32YTerminal customs clearance number generated by merchant side,
A unique check is performed on the GW side.
2gwDeclareNo  GW Customs Clearance Processing NumberString32YCustoms processing passnumber generated by merchant side,
A unique check is performed on the GW side.
Request Example
{
“clientDeclareNo”:”samplecode”,
“gwDeclareNo”:”samplecode”
}
Response BODYColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Description
1result  Customs Clearance History Search StructureStringNIf resultType="SUCCESS", all columns are returned.
2 clientDeclareNo Terminal Customs Clearance NumberString32N 
3 gwDeclareNo GW Customs Clearance Processing NumberString32N 
4 brandDeclareNo Financial Institution Customs Clearance NumberString80N 
5 clientOrderNo Terminal Processing Serial NumberString32N 
6 subClientOrderNo Sub-terminal Processing Serial NumberString32N 
7 subGwOrderNo GW Sub-Customs Clearance Processing NumberString32N 
8 subBrandOrderNo Sub-financial Institution Customs Clearance NumberString50N 
9 gwOrderNo GW Customs Clearance Processing NumberString32N 
10 BrandOrderNo Financial Institution Customs Clearance NumberString50N 
11 verifyDepartment Verification AgencyString16N 
12 verifyDepartmentTradeId Verification Agency Transaction Serial NumberString80N 
13 BrandType Financial InstitutionString2N02: WeChatPay
14 declareState Customs Statusint1N0: No application
1: Application success
2: Application submitted
3: Application failed
4: Application error
7: Application in progress
15 certCheckResult Authentication Statusint1N0: UNCHECKED The partner has not uploaded the purchaser's identification information.
1: SAME The purchaser's identification information uploaded by the partner is the same as the payer's.
2: DIFFERENT The purchaser's identification information uploaded by the partner is different from the payer's.
16 declareStartTime Customs Declaration Start TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
17 declareUpdateTime Customs Declaration Last Amendment TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
18 declareFinishTime Customs Clearance Completion TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
19resultCode  Processing Result CodeString64N 
20resultMessage  Processing Result MSGString1024Y 
21resultType  Processing Result TypeString15YThis result is the result of the process of the payment request and different from the customs clearance status.
This is SUCCESS when the customs clearance request is normally created 
and the customs clearance interface is normally called.
The return value is FAILED in the following cases:
1. When the terminal customs clearance sequential number already exists
2. When failed to call the customs clearance interface
3. When an internal system error occurs
Response example (please note that the columns are in random order)
{
"result":{
“clientOrderNo”:”samplecode”,
“gwOrderNo”:”samplecode”,
“brandOrderNo”:”samplecode”,
“clientDeclareNo”:”samplecode”,
“gwDeclareNo”:”samplecode”,
“brandDeclareNo”:”samplecode”,
“verifyDepartment”:”samplecode”,
“verifyDepartmentTradeId”:”samplecode”,
“certCheckResult”:”0″,
“certCheckResult”:”0″,
“declareState”:2,
“brandType”:”02″
“declareStartTime”:”2018-01-01 00:00:01″,
“declareUpdateTime”:”2018-01-01 00:00:01″
},
”resultCode”:”0000″,
“resultMessage”:”null”,
“resultType”:”SUCCESS”
}

09. Customs Re-Clearance Request

Interface NameCustoms Clearance Re-request
Request TypePOST
URLTest environment URL: https://{stg-url}/api/pay/customsDeclare/redeclare
Production environment URL:https://{prod-url}/api/pay/customsDeclare/redeclare
Interface ApplicationsThe customs clearance can be requested again when the customs clearance request status is "2 - Application."
ParametersColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Remarks
1clientDeclareNo  Terminal Customs Clearance NumberString32YTerminal customs clearance number generated by merchant side,
A unique check is performed on the GW side.
2gwDeclareNo  GW Customs Clearance Processing NumberString32YCustoms processing passnumber generated by merchant side,
A unique check is performed on the GW side.
Request Example
{
“clientDeclareNo”:”samplecode”,
“gwDeclareNo”:”samplecode”
}
Response BODYColumn Name (English) (Level1)Column Name (English) (Level2)Column Name (English) (Level3)Column NameParameter TypeCharacterRequired (Y: Required, N: Optional)Description
1result  Customs Clearance Re-request Result StructureStringNAll the columns are returned 
when resultType = "SUCCESS"
2 clientDeclareNo Terminal Customs Clearance NumberString32N 
3 gwDeclareNo GW Customs Clearance Processing NumberString32N 
4 brandDeclareNo Financial Institution Customs Clearance NumberString80N 
5 clientOrderNo Terminal Processing Serial NumberString32N 
6 subClientOrderNo Sub-terminal Processing Serial NumberString32N 
7 subGwOrderNo GW Sub-Customs Clearance Processing NumberString32N 
8 subBrandOrderNo Sub-financial Institution Customs Clearance NumberString50N 
9 gwOrderNo GW Customs Clearance Processing NumberString32N 
10 BrandOrderNo Financial Institution Customs Clearance NumberString50N 
11 verifyDepartment Verification AgencyString16N 
12 verifyDepartmentTradeId Verification Agency Transaction Serial NumberString80N 
13 BrandType Financial InstitutionString2N02: WeChatPay
14 declareState Customs Statusint1N0: No application
1: Application success
2: Application submitted
3: Application failed
4: Application error
7: Application in progress
15 certCheckResult Authentication Statusint1N0: UNCHECKED The partner has not uploaded the purchaser's identification information.
1: SAME The purchaser's identification information uploaded by the partner is the same as the payer's.
2: DIFFERENT The purchaser's identification information uploaded by the partner is different from the payer's.
16 declareStartTime Customs Declaration Start TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
17 declareUpdateTime Customs Declaration Last Amendment TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
18 declareFinishTime Customs Clearance Completion TimeString20Ndatetime format "YYYY-MM-DD HH:MI:SS"
19 Explanation Customs Clearance DescriptionString128N 
20resultCode  Processing Result CodeString64N 
21resultMessage  Processing Result MSGString1024Y 
22resultType  Processing Result TypeString15YThis result is the result of the process of the payment request and different from the customs clearance status.
This is SUCCESS when the customs clearance request is normally created 
and the customs clearance interface is normally called.
The return value is FAILED in the following cases:
1. When the terminal customs clearance sequential number already exists
2. When failed to call the customs clearance interface
3. When an internal system error occurs
Response example (please note that the columns are in random order)
{
"result":{
“clientOrderNo”:”samplecode”,
“gwOrderNo”:”samplecode”,
“brandOrderNo”:”samplecode”,
“clientDeclareNo”:”samplecode”,
“gwDeclareNo”:”samplecode”,
“brandDeclareNo”:”samplecode”,
“verifyDepartment”:”samplecode”,
“verifyDepartmentTradeId”:”samplecode”,
“certCheckResult”:”0″,
“certCheckResult”:”0″,
“declareState”:2,
“brandType”:”02″
“declareStartTime”:”2018-01-01 00:00:01″,
“declareUpdateTime”:”2018-01-01 00:00:01″
},
”resultCode”:”0000″,
“resultMessage”:”null”,
“resultType”:”SUCCESS”
}

"Payment Request Sequence" *WeChat Pay

■ About Result Notification
The HTTP/HTTPS result notification is sent to the Merchant server at the notification destination address specified in the "returnUrl" column upon the payment request.
The notification destination can be changed as necessary by setting the value in "returnUrl."

“Unable To Receive Result Notification Sequence (recommended) *WeChat Pay

“Unable To Receive Payment Request Response Sequence (recommended) *WeChat Pay

"Settlement sequence" * WeChat Pay
* The end user's terminal is a smartphone, and the browser is not the WeChat browser

■ About Result Notification
The HTTP/HTTPS result notification is sent to the Merchant server at the notification destination address specified in the "returnUrl" column upon the payment request.
The notification destination can be changed as necessary by setting the value in "returnUrl."

“Unable To Receive Result Notification Sequence (recommended) *WeChat Pay
* The end user's terminal is a smartphone, and the browser is not the WeChat browser

“Unable To Receive Payment Request Response Sequence (recommended) *WeChat Pay

"Settlement sequence" * WeChat Pay

■ About Result Notification
The HTTP/HTTPS result notification is sent to the Merchant server at the notification destination address specified in the "returnUrl" column upon the payment request.
The notification destination can be changed as necessary by setting the value in "returnUrl."

“Unable To Receive Result Notification Sequence (recommended) *WeChat Pay

“Unable To Receive Payment Request Response Sequence (recommended) *WeChat Pay

"Settlement sequence" * WeChat Pay

■ About Result Notification
The HTTP/HTTPS result notification is sent to the Merchant server at the notification destination address specified in the "returnUrl" column upon the payment request.
The notification destination can be changed as necessary by setting the value in "returnUrl."

“Unable To Receive Result Notification Sequence (recommended) *WeChat Pay

“Unable To Receive Result Notification Sequence (recommended) *WeChat Pay

"Custom Clearance Request Sequence" *WeChat Pay

“Customs Clearance Re-request Sequence” *WeChat Pay

"Customs Clearance Re-quest Re-send Sequence" *WeChat Pay

The "Payment cancellation", "Refund request", "Payment history search", and "Refund history search" sequences are common to the WEB type (PC, smartphone), InApp type, and mini-program type.

■ About Payment Cancellation
Use a new terminal process sequential number to make a request again through the Payment Request after Payment Cancellation. If the same terminal process sequential number is used for making another request, an error occurs.
A transaction whose payment has been succeeded cannot be canceled, though can be refunded.
NoNAMEKEYValueDescription
1ACCESS_TOKENX-OPREAL-AccessToken Please refer to "About AccessToken"Required Fields
2CHECK_SIGNATUREX-OPREAL-Signature Please refer to "Sign Specifications"Required Fields
3User-AgentUser-Agent  Required Fields
4Remote_IPX-OPREAL-RemoteIP  Selected Items *Web Type (Smartphone Payment) Required
5 content_typeapplication/json; charset=UTF-8 Required Fields
Example
HTTPs Request:[Url:http://{$stg-url}/api/history/orderInfo/openGet]
HttpHeaders:{
“X-OPREAL-Signature”: [
“09860BC70F8254474EFA4CDA88ED63F2”
],
“X-OPREAL-AccessToken”: [
“1ouiyasdijasid”
],
“User-Agent”:[
“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36”
],
"content-type": [
”application/json; charset=UTF-8″

* An access token is mandatory.
* Each Merchant shall generate and manage an access token.
The access token shall be embedded in "X-OPREAL-AccessToken" of the Header.
* For details about how to embed the header, see [HTTP Header].

Regarding the access token, after passing the merchant screening, SBPS Merchant Support will send the "Connection Information Guide (PDF)" to the person in charge by email.

An external terminal platform shall generate its own RSA public key (we recommend to use the RSA2 format. They will be referred to as the "external public key" and "external private key" later.) and upload the public key to the OLGW platform to obtain a public key for the OLGW platform (referred to as the "OLGW public key" later).

* Note 1: The access platform shall store the external private key, 
and if the key is lost, it shall generate a key again and upload the key to OLGW.
* Note 2: The external platform shall make sure that the public key 
and private key are the proper pair. If they are not a proper pair, direct payments will fail.

https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/pay/In-AppPay/chapter6_2.shtml

https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/pay/chapter2_2.shtml#menu1

Sine Value Generation Specifications

  1. Sort parameters in the POST body in ascending order (A to Z)
  2. Concatenate the key and value with "="
  3. Concatenate key value pairs with "&"
  4. If there are nests, substitute "&" for links of commas (",") in the nests.
  5. If the value is NULL, it is out of the target of signature.
  6. Attach a signature with RSA of the "SHA 256 WithRSA" method using the private key of the platform.
resultCoderesultMessage
0000* Although this is success, there is no return value for "resultMessage".
resultCoderesultMessage
param.access_token.invalidInvalid Access Token
param.invalidInvalid Parameter [{0}]
param.signature.invalidInvalid Signature[{0}]
param.signature.isnull[Signature] is empty, please enter a value
param.access_token.isnull[Access Token] is empty, please enter a value
param.http_request_body.format.errorHttpRequest body format error
param.format.error[{0}] Parameter format error
param.format.overlength.error[{0}] field is too long
param.isnull.error[{0}] is empty, please enter a value
param.format.over_maximum[{0}]Exceeds the maximum value of {1}
order_info.not_same_companyThe company code does not exist.
order_info.not_existThere is no corresponding payment
order_info.not_pay_okThe payment was not completed correctly.
order_info.client_order_no.duplicateThe terminal processing serial number is duplicated.
refund_info.refund_price.incorrectRefund amount is invalid, Refund amount {0}
refund_info.refund_price.exceed_possibleRefund amount exceeds limit
refund_info.refund_no.duplicateThe corresponding refund processing number already exists.
order_info.pay_brand.invalidPayment brand can not be selected
order_info.return_url.illegalThe payment URL is invalid.
order_info.expiredThe payment has expired
refund_info.begin_processed_by_othersSomeone else is refunding the payment
order_info.pay_type.incorrectThe value of [{0}] is invalid
order_info.pay_type.buildingThe payment brand is not available.
order_info.brand_type.buildingThe payment brand is not available.
order_info.brand_type.incorrectThe value of [{0}] is invalid
order_info.order_no.invalidPlease set the terminal processing serial number/GW processing serial number/financial institution number
refund_info.refund_no.invalidPlease set the terminal refund processing serial number/GW refund processing serial number/financial institution refund number
order_info.order_status.invalidThe value of [{0}] is invalid
order_info.has_refund.invalidThe value of [{0}] is invalid
refund_info.refund_status.invalidThe value of [{0}] is invalid
order_info.not_belong_to_this_open_accountThe payment does not belong to this account
refund_info.not_belong_to_this_open_accountThe refund does not belong to this account
org_order_info.not_belong_to_this_open_accountThe original payment does not belong to this account
refund_info.not_existThere is no corresponding refund
weixin.sub_mch_id.invalidInvalid SubMchID
weixin.pay_config.invalidWechat connection parameters are invalid {0}
order_info.sub_brand.invalidPayment sub-brand can not be selected
order_info.branch_unit.pay_brand.invalidBranch payment brand can not be selected
order_info.trade_not_supportThe transaction does not support authorization.
order_info.order_price.exceed_possibleThe payment amount exceeded the authorized amount.
declare_order_info.not_belong_to_this_open_accountCustoms clearance information does not belong to this account
declare_order_info.not_existThere is no relevant customs clearance information.
declare_order_info.declare_order_no.invalidPlease enter your customs number/platform customs number
declare_order_info.client_declare_no.duplicateCustoms number is duplicated
declare_order_info.amount.incorrect[{0}]Amount is invalid, Amount:{1}
order_info.branch.invalidUnable to obtain payment store
branch_unit.pay_type.invalidThis branch does not accept payments for {0}.
order_info.has_been.paidThe payment has already been processed and cannot be cancelled.
order_info.has_been.refundedThe transaction has been fully refunded
failThe operation or process timed out.

Processing Result Code

resultCoderesultMessage
SYSTEM ERRORSystem error
PARAM_ERRORIncorrect parameter description
ORDERPAIDCorresponding payment is already complete.
NOAUTHNot authorized to use the relevant API.
AUTHCODEEXPIREUser's code has been expired.
NOTENOUGHInsufficient user's balance
NOTSUPORTCARDUser's card does not support this payment method.
ORDERCLOSEDCorresponding payment has been closed.
ORDERREVERSEDCorresponding payment has been canceled.
BANKERRORSystem error in the bank
USER PAYINGUser is required to enter the payment password.
AUTH_CODE_ERRORIncorrect request parameter description
AUTH_CODE_INVALIDScanned code is not WeChat Pay code.
XML_FORMAT_ERRORXML format error
REQUIRE_POST_METHODParameters are not sent by POST method.
SIGNERRORWrong signature
LACK_PARAMSMissing request parameter
NOT_UTF8Wrong coding format
BUYER_MISMATCHPayment account has been changed.
APPID_NOT_EXISTAPPID does not included in the parameter.
MCHID_NOT_EXISTMCHID does not included in the parameter.
OUT_TRADE_NO_USEDMerchant payment number is duplicated.
APPID_MCHID_NOT_MATCHappid does not match mch_id.
INVALID_REQUESTInvalid request
POST_DATA_EMPTYMissing request parameter
ORDERNOTEXISTCorresponding payment does not exist.
BIZERR_NEED_RETRYInternal Error
TRADE_OVERDUERefundable period has passed.
ERROROther error
USER_ACCOUNT_ABNORMALAbnormality in the user account
INVALID_REQ_TOO_MUCHNumber of invalid requests reached the upper limit.
INVALID_TRANSACTIONIDInvalid transaction ID
REFUNDNOTEXISTCorresponding refund does not exist.
ACCOUNTERRORUnusable account
RULELIMITCredit limit would be exceeded.
132011004Parameter error
132021028Different currency type
MCHID_NOT_SETMerchant number is not specified.
MCHID_INVALID_LENGTHInvalid length of the trade name
CUSTOMSCONFIG_NOT_SETCustoms configuration is not specified.
FEETYPE_NOT_SETCurrency type is not specified.
OUTTRADENO_NOT_SETPartner order number is not specified.
TRANSACTION_ID_NOT_SETWeChat Pay order number is not specified.
INVALID_TRANSACTION_IDInvalid length of the WeChat Pay order number
CUSTOMS_NOT_SETCustoms information is not specified.
CHCUSTOMSNO_NOT_SETCustoms application number is not specified.
INVALID_MCHCUSTOMSNOInvalid length of the customs application number
PAYFEE_NOT_MATCHAmount of money does not match.
INVALID_SUBORDER_NOInvalid length of the sub order
AUTHORITY_NOT_FOUNDAuto customs function is not opened.
NO_AUTHNo rights
ORDER_REFUNDEDCorresponding transaction has already been fully refunded.
ORDER_NEED_DECLAREStatus of the corresponding transaction is that no application is made for customs.
FAILEDConsult the payment center.
Was this page helpful?