Quick Start
Endpoint
You need to contact the open platform staff to add the merchant server's IP whitelist.
Glossary
api-key
: unique identifier of the merchant.merchant-public-key
: merchant RSA public key.merchant-private-key
: merchant RSA private key.wsb-public-key
: open platform RSA public key.
The above parameters can be obtained and updated in the merchant backend.
Authentication
Use api-key to authenticate the request. Merchants need to put X-WSB-API-KEY
in the request header every time they make a request.
Signature
To ensure the security of API calls, each request and response needs to be verified for message integrity through signature.
Merchant requests API are signed with merchant RSA private key and verified with merchant RSA public key;
Merchant requests responses are signed with platform RSA private key and verified with platform RSA public key;
Notification subscriptions are signed with platform RSA private key and verified with platform RSA public key.
The signing rules are as follows:
The merchant sends a request to the development platform, signs it with the
merchant's RSA private key
, and the open platform verifies the signature with themerchant's RSA public key
;The open platform interface responds and sends notifications to the merchant, signs it with the
platform's RSA private key
, and the merchant verifies the signature with theplatform's RSA public key
;Signing is to encrypt the
HTTP request body
, and all requests are called using the POST method;Use
sha256 RSA
to sign it and then usebase64
as the signature string;Put the encrypted signature string signature in the HTTP header
X-WSB-SIGNATURE
field.
demo
Contains code information such as mobile area code, region, etc.; and java-demo
Request Template
POST
${uri}
Headers
Content-Type
application/json
X-WSB-API-KEY
${api-key}
X-WSB-SIGNATURE
${signature}
Response Template
Headers
Content-Type
application/json
X-WSB-SIGNATURE
${signature}
Response
Response Code
200
Success
500
Internal service error. Please contact WasabiCard staff
-1
Business error code. This is a normal situation, for example, the user purchases more cards than the limit.
40002
Param error
40020
Duplicate order number
40021
Insufficient balance
50001
The api key and signature parameters are empty
50002
Signature verification failed
50003
Signature failed
50004
Merchant does not exist
Last updated