/cgi/payment/api/v1/payment-order/query

Once the payment order Created merchant can use the paymentId to retrieve the payment order status and information. Just in case the network issue the callback is not coming.

Request

Request payload

POST /payment/api/v1/payment-order/query HTTP/1.1
Content-Type: application/json

{
    "merchantId": "string",
    "method": "string",
    "format": "string",
    "charset": "string",
    "encryptType": "string",
    "signType": "string",
    "sign": "string",
    "timestamp": "Number",
    "body": "<encrypted body string>" // the encrypted body string
    
    // the body data structure
    // { 
    //     "paymentId": "string"
    // }
}

Please follow the Request Payload to construct the request payload.

  • Set the method parameter to bieases.trade.query.
  • Set to body parameter to Body object.

Body object

The body parameter object in the Request Payload .

KeyTypeMandatory?LengthDescriptionExample
paymentIdStringYes32The payment order number regarding the payment request01J143NWJFNGBV2YB9ZRB9T7PS

Response

Response payload

200 OK
Content-Type: "application/json"

{
    "code": "string",
    "msg": "string",
    "data": 
    {
       "merchantId":"string",
       "referOrderNo":"string",
       "payAmount":"string",
       "currency":"string",
       "currency":"string",
       "paymentTime":"string",
       "paidTime":"string",
       "status":"string",
       "msg":"string",
    }
}

The request will be returned with HTTP status code 200 if success and details included in the data object of the response payload.

  • data object defined as below

📘

Note

The response is returned synchronous and does not require signature verification and decryption.

Data object

KeyTypeLengthDescriptionExample
statusString-Please refer to Payment Order Status for more information.
transactionIdString30The wallet transaction id
msgString-If payment failed, will return a reasonorder is time out
merchantIdString18The merchant id.B131567545069
referOrderNoString32The refund order number or the original order number from Merchant's platform. If there is no refund order number, please put the original order number.2013112111001004500000675971
payAmountNumber-The actual payment amount.

- An integer for currencies like JPY that are not typically fractional.
- A decimal fraction for currencies like TND that are subdivided into thousandths.
25.99
currencyString-Currency code. Refer to ISO 4217USD
paymentTimeTimestamp-The timestamp of payment time1706585572074
paidTimeTimestamp-The timestamp of paid time1706585572074

Examples

Follow the steps below to construct the payment request message.

  1. Construct the request object.

    {
        "merchantId": "B131567545069",
        "method": "bieases.trade.query",
        "format": "json",
        "charset": "utf-8",
        "encryptType": "AES",
        "signType": "RSA",
        "timestamp": 1706585572074,
        "body": { 
                  "paymentId": "1754349465357123584",
                }
    }
    
  2. Sign the request and add the signature to the request body.

    {
        "merchantId": "B131567545069",
        "method": "bieases.trade.query",
        "format": "json",
        "charset": "utf-8",
        "encryptType": "AES",
        "signType": "RSA",
    	   
        // Add the signature to the request parameter
        "sign": "<signature string>",
    
        "timestamp": 1706585572074,
        "body": { 
                  "paymentId": "1754349465357123584",
                }
    }
    
  3. Encrypt the Payment Object
    Refer to the Request Sandbox Access or Request production secure keys to get your AES encrypt key.

    String body ="{Payment Object JSON String}";// The payment object JSON string which is constructed in step 1.
    
    //encrypt the body with the given AES encrypt key from BIEASES.
    String encryptedBody = AesEncrypt.encrypt(body, aesEncryptKey, "UTF-8");
    
    //  "7K2AyShlt1fOrKhCTC42EpqOnXxzSAiY+pLWGLo2AX4Q7uWjcv6SNQFUpgUpzrvRVXb4wQtTtdAelRk8YnqBGl/UlUR08cSWz4VALGT+YJB7FUEMfZ7m8Y3kLloe8Mv4Kg4D8uNNBmIUUZBPS782tQVoSNG+B0jLjqISTltY5UkqkidQnbPKxXO0XeFJApW00UZIJhuhUhaQgMT3/cmO5XzDtVjOa2FRszMi65zoeWyoFVXYxqJwiZ4PVv7FFRzoDbcbtXL1mJ/TeJ51UC2zdeJN9IW41aw6e2dE3xx++PLsLbzhtwJg/qra/+4/94kQw/gB3qWGbeb9icOC/A7TnFqOWkct7A9xYlm1mYbyBer1EYpNSZ/IB156ou+YS4S3aeqtDoXp+wRk0L9fYZher5cwy7GD2IPGMF9OLDd+5/ml7Lpik9dOmu9m8UljJLNM620o3j7R3clFB1Zztrd53i78/K/XOgj0Kd+rJt1CUkcAjFleTXDP63uFMcbFz36iHv6+/tPfisGGCX98jEGVWA=="
    
  4. Replace the body parameter with the encrypted value.

    {
        "merchantId": "B131567545069",
        "method": "bieases.trade.query",
        "format": "json",
        "charset": "utf-8",
        "encryptType": "AES",
        "signType": "RSA",
      	
         // Add the signature to the request parameter
        "sign": "<signature string>",
    
        "timestamp": 1706585572074,
    
        // Encrypted payment object
        "body": "<encrypted data body>"
    }
    
    
  5. Send the request to the BIEASES payment gateway.

    POST /api/v1/gateway HTTP 1.1
    Content-Type: "application/json"
    
    {
        "merchantId": "B131567545069",
        "method": "bieases.trade.query",
        "format": "json",
        "charset": "utf-8",
        "encryptType": "AES",
        "signType": "RSA",
        "sign": "<signature string>",
        "timestamp": 1706585572074,
        "body": "<encrypted data body>"
    }
    
  6. The following JSON shows an example of the Query Payment response being returned when you requested it.

    200 OK
    Content-Type: "application/json"
    
    {
        "code": "string",
        "msg": "string",
        "data": 
        {
           "merchantId":"string",
           "referOrderNo":"string",
           "payAmount":"string",
           "currency":"string",
           "currency":"string",
           "paymentTime":"string",
           "paidTime":"string",
           "status":"string",
           "msg":"string",
        }
    }
    

    Verify the signature and decrypt The body to hand the response as your logic.