This document provides an overview of Easyway API, including it's authentication mode, request/response format, and detailed access endpoints.
APP Access Process
Get App ID and App Secret
Please contact Easyway Dev Team to get your unique app_id and app_secret for making calls to the API.
Note:
The app_id is the unique identification of the web app.
The app_secret is used to authenticate API requests.
Easyway Public Key is for api notification validation.
Public Key
Public key is used to verify the API requests. Please contact Easyway Dev Team to provide your public key information.
IP WhiteList
Please contact Easyway Dev Team to provide the IP address for whitelist. To help your integration operate securely, we must verify that it’s communicating through one of our listed IP addresses.
If your integration also receives webhooks from us, make sure these events originate from a whitelisted IP address.
Timestamp, used for signature verification, required for POST requests.
Conditional
Content-Type
for POST request, needs to be application/json
Conditional
X-Unit-Id
All sub-merchant requests are required
Conditional
Sign
Signature is the verification of the body of the messages during the interaction between the Easyway and the merchant. Signature occurs in post http request. There is also a webhook message used by Easyway to notify merchants of data changes.
Easyway uses the RSA private key to decrypt, and the RSA public key to sign. Therefore, during the API interaction, there are merchant RSA public and private keys and Easyway RSA public and private keys.
The signing rules are as follows:
The merchant sends a request to Easyway, the merchant uses its own RSA private key to sign, and Easyway uses the merchant's RSA public key to verify the signature;
Easyway sends a notification to the merchant, Easyway uses its own RSA private key to sign, and the merchant uses the Easyway RSA public key to verify the signature;
Signing is to encrypt the http request body, app_id, timestamp, For specific rules, see the following signature example;
Whether it is the public and private keys of the merchant or the platform, the generation method is to use the PKCS8 padding method and 2048 length Tool;
If a request fails, we will respond with error details. If the response is not received, it may mean that the network has timed out, and please try again.
Response Code
Description
B_XXX
Bad request - The request is invalid due to missing parameters, an incorrect structure, or failure in another validation test.
S_XXX
Business process failure
Error Codes
Response Code
Description
S_Common_SystemError
System error, please contact Easyway dev team
B_Common_AuthError
Unauthorized - Please ensure that a valid authentication token is provided.
B_Auth_TokenInvalidError
Unauthorized - Please get a new authentication token.
B_Common_NotFound
Not found - The requested endpoint does not exist.
B_Common_ParamError
An incorrect type or failed validation test occurred with a provided argument.
Failed Example Response
Code
{ "code": "B_Common_ParamError", "message": "Invalid parameter: app_id is required"}