Get started
Quick start
Authenticate with X-WSB-API-KEY, sign request bodies with SHA256withRSA, verify responses, and run the official Java demo.
Endpoint
You need to contact the open platform staff to add the merchant server's IP whitelist for prod env.
https://sandbox-api-merchant.wasabicard.com
Glossary
The above parameters can be obtained and updated in the dashboard.
| Parameter | Description |
|---|---|
| api-key | Unique identifier of the merchant. |
| public-key | User's RSA public key. |
| private-key | User's RSA private key. |
| wsb-public-key | Platform RSA public key. |
Authentication
Use api-key to authenticate the request. User 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.
User requests API are signed with user's RSA private key and verified with merchant RSA public key; responses and notification subscriptions are signed with platform RSA private key and verified with platform RSA public key.
If the interface does not require request parameters, please construct an empty JSON object {} for body for transmission and signing.
- 1
Sign merchant requests
The merchant sends a request to the development platform, signs it with the user's RSA private key, and the open platform verifies the signature with the user's RSA public key.
- 2
Verify responses & notifications
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 the platform's RSA public key.
- 3
Sign the raw HTTP request body
Signing is to encrypt the HTTP request body, and all requests are called using the POST method.
- 4
Use sha256 RSA + base64
Use sha256 RSA to sign it and then use base64 as the signature string.
- 5
Attach X-WSB-SIGNATURE header
Put the encrypted signature string in the HTTP header X-WSB-SIGNATURE field.
Code
Official Java reference classes covering signed HTTP POST requests (SHA256withRSA), response signature verification, and segmented RSA private-key decryption (such as decrypting sensitive CVV data).
package com.wsbcard.demo.model;
import lombok.Data;
import java.io.Serializable;
/**
* @author: test
* @date: 2023/12/2 15:20
* @describe:
*/
@Data
public class ResultData<T> implements Serializable {
private static final long serialVersionUID = 1L;
private boolean success = true;
private int code = 200;
private String msg = "Success";
private T data;
public boolean isSuccess() {
return code == 200;
}
}Multi-language examples
Switch languages below to see how to sign and call /merchant/core/mcb/card/v2/cardTypes in cURL, Node.js, Go, Python, Java, or PHP.
curl https://sandbox-api-merchant.wasabicard.com/merchant/core/mcb/card/v2/cardTypes \
-H "Content-Type: application/json" \
-H "X-WSB-API-KEY: <api-key>" \
-H "X-WSB-SIGNATURE: <signature>" \
-d '{}'Java demo
Browse the complete runnable Java 8+ Maven project — including pom.xml, RSA/AES utilities, signed HTTP client, and API examples for Accounts, Common, and Global payouts.
Request template
All endpoints use POST ${uri} with the following HTTP headers:
| Name | Value |
|---|---|
| Content-Type | application/json |
| X-WSB-API-KEY | ${api-key} |
| X-WSB-SIGNATURE | ${signature} |
Response template
Platform responses include X-WSB-SIGNATURE for verification and follow this standard JSON envelope:
| Name | Value |
|---|---|
| Content-Type | application/json |
| X-WSB-SIGNATURE | ${signature} |
{
"success": true, // True when code=200
"code": 200,
"msg": "Success",
"data": null
}Response code
| Code | Remark |
|---|---|
| 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 | User does not exist |

