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

BIEASES payment system requires merchants to create the payment order before the payment checkout. Once the payment order is created, BIEASES will return with the payment order information.

The merchant platform should redirect to the checkout page to let the consumer complete the payment.

Request

Request payload

POST  /payment/api/v1/payment-order 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
    // { 
    //     "order": {
    //         "orderNo": "string",
    //         "orderAmount": "Number",
    //         "orderDescription": "string",
    //         "goods": [{
    //             "referenceGoodsId": "string",
    //             "goodsName": "string",
    //             "goodsDesc": "string",
    //             "goodsUnitAmount": "Number",
    //             "goodsQuantity": "Number"
    //         }]
    //    },
    //    "channel": "string",
    //    "paymentAmount": "string",
    //    "currency": "string",
    //    "paymentTime": "Timestamp",
    //    "paymentExpiryTime": "Timestamp",
    //    "callbackUrl": "string",
    //    "redirectUrl": "string"
    // }
}

Please refer to Request Payload for more information regarding the payload JSON.

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

Body object

The body parameter object in the Request Payload .

KeyTypeMandatory?LengthDescriptionExample
channelStringYes-The channel where the order was created. Supported value:

- WEB
- APP
paymentAmountNumberYes-The payment amount regarding the payment order.

- An integer for currencies like JPY that are not typically fractional.
- A decimal fraction for currencies like TND that are subdivided into thousandths.
25.37
currencyStringYes-The currency code. ISO 4217USD
paymentTimeTimestampYes-The timestamp payment order time.
paymentExpiryTimeTimestampYes-Thetimestamp payment expiration time. How long will the payment order be kept on the BIEASES server before it gets paid the time range of the expiration can be 5 minutes to 24 hours.
callbackUrlStringNo2048The callback Webhook address.https://merchant_server_name/payment/callback
redirectUrlStringNo2048The redirect URL.
Usually used to navigate back to the merchant order result page once the payment has been settled.
https://merchant_server_name/order/111/result
orderObjectYesRefer to the order object

Order object

KeyTypeMandatory?LengthDescriptionExample
orderNoStringYes64The order number on the Merchant's platform2013112111001004500000675971
orderAmountNumberYes-The total order amount should equal sum of amount * quantity across all items for a given goods.

- An integer for currencies like JPY that are not typically fractional.
- A decimal fraction for currencies like TND that are subdivided into thousandths.
25.37
tipsNumberNoThe customer give merchant tips amount.

- An integer for currencies like JPY that are not typically fractional.
- A decimal fraction for currencies like TND that are subdivided into thousandths.
2.00
discountNumberNoThe order discount amount .if it have

- An integer for currencies like JPY that are not typically fractional.
- A decimal fraction for currencies like TND that are subdivided into thousandths.
0.37
totalTaxNumberNoThe order totalTax amount, should equal sum of tax * quantity across all items for a given goods

- An integer for currencies like JPY that are not typically fractional.
- A decimal fraction for currencies like TND that are subdivided into thousandths.
insuranceNumberNoThe order insurance amount, if it have

- An integer for currencies like JPY that are not typically fractional.
- A decimal fraction for currencies like TND that are subdivided into thousandths.
handlingFeeNumberNoThe order hand fee, if it have

- An integer for currencies like JPY that are not typically fractional.
- A decimal fraction for currencies like TND that are subdivided into thousandths.
shippingObjectNoThe order shipping info
shippingDiscountNumberNoThe order shipping fee discount, if it has
orderDescriptionStringNo256The order descriptionxxx
goodsArrayYes-The goods Object list (Max 100 elements).

Goods object

KeyTypeMandatory?LengthDescriptionExample
referenceGoodsIdStringYes64The goods item id.821e1c32-4a6c-442e-b5ce-8ec5b902d11c
goodsNameStringYes256The goods item name.Paper tower
goodsDescStringNo256The goods item description.White kitchen paper tower
goodsAmountNumberNo-The good amount individual good.

- An integer for currencies like JPY that are not typically fractional.
- A decimal fraction for currencies like TND that are subdivided into thousandths.
2.45
taxNumberNoThe tax amount individual good.

- An integer for currencies like JPY that are not typically fractional.
- A decimal fraction for currencies like TND that are subdivided into thousandths.
0.40
goodsQuantityNumberNo-The quantity for each individual good.2

Shipping_ object

KeyTypeMandatory?DescriptionExample
shipTypeStringYesThe shipType where the order will be give. Supported value:

- SHIPPING
- PICKUP_IN_STORE
- PICKUP_FROM_PERSON
amountNumberNoThe shipping fee amount

- An integer for currencies like JPY that are not typically fractional.
- A decimal fraction for currencies like TND that are subdivided into thousandths.
2.45
nameStringYesThe receiver nameJacob
addressStringNoThe receiver address

Response

Response payload

200 OK
Content-Type: "application/json"

{
    "code": "20000",
    "msg": "SUCCESS",
    "data": 
    {
       "paymentId":"",
       "referOrderNo":"",
       "channel":"",
       "checkoutUrl":"",
       "status":"",
    }
}

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
paymentIdString32The payment order number regarding the payment request.1754349465357123584
referOrderNoString32The order number from Merchant's platform.2013112111001004500000675971
channelString-The channel where the order was created. Supported value:

- WEB
- APP
APP
checkoutUrlString2048The payment checkout URL. Once the merchant gets this URL, the merchant should be redirected to this page to let the end user complete the payment order.https://pay-eu.bieases.com/user/login?paymentId=tAjn4xewdsd0DJJCsfpocHHXuVaOL9
statusStringThe payment order status."pending"

Examples

Follow the steps below to construct the payment request message.

  1. Construct the request object.

    {
        "merchantId": "B131567545069",
        "method": "bieases.trade.create",
        "format": "json",
        "charset": "utf-8",
        "encryptType": "AES",
        "signType": "RSA",
        "timestamp": 1706585572074,
        "body": { 
            "order": {
                "orderNo": "111111111111111",
                "orderAmount": "10.0",
                "orderDescription": "",
                "goods": [{
                    "referenceGoodsId": "213111131",
                    "goodsName": "fans",
                    "goodsDesc": "",
                    "goodsUnitAmount": "1",
                    "goodsQuantity": "3"
                }]
           },
           "channel": "Web",
           "paymentAmount": "100.0",
           "currency": "USD",
           "paymentTime": "7065855724",
           "paymentExpiryTime": "7065856724",
           "callbackUrl": "https://merchantserverhost/pay/complete/callback/url",
           "redirectUrl": "https://merchantserverhost/pay/complete/redirect/url"
       }
    }
    
  2. Sign the request and add the signature to the request body.

    {
        "merchantId": "B131567545069",
        "method": "bieases.trade.create",
        "format": "json",
        "charset": "utf-8",
        "encryptType": "AES",
        "signType": "RSA",
    	   
        // Add the signature to the request parameter
        "sign": "hcsZg0q6sLm4gRQ97MBAlkNFAJCFXUAlnxlJCzjjwNwJJ9i8JIXoFjnzi6zRpyt6Vw7RGiUvUsLCq6PSUEIQ4B45ZaOCZCcs8SqCEP/ybxyacOnOD5Km8y7XbOJGYFgvepixo4BvigTvfrPydjtbeJMxoaRJnsvhgAtcwxErLwM3GARLMP4sEj/5xEheO1zvmD1BoacEBBxcE5uGXm0YSLE45NDeNvwVYPg9mJYmsVzHT7+NQngFFTHpPOoN5YaD+iI6PeU+h6r3ulq4+rDgjTc+3451Ce7g32ZXBRwOS3osAU9BBiW1bL97J4vXBhdBiL9iiEbE3BdbHlf03HPpIg==",
    
        "timestamp": 1706585572074,
        "body": { 
            "order": {
                "orderNo": "111111111111111",
                "orderAmount": "10.0",
                "orderDescription": "",
                "goods": [{
                    "referenceGoodsId": "213111131",
                    "goodsName": "fans",
                    "goodsDesc": "",
                    "goodsUnitAmount": "1",
                    "goodsQuantity": "3"
                }]
           },
           "channel": "Web",
           "paymentAmount": "100.0",
           "currency": "USD",
           "paymentTime": "7065855724",
           "paymentExpiryTime": "7065856724",
           "callbackUrl": "https://merchantserverhost/pay/complete/callback/url",
           "redirectUrl": "https://merchantserverhost/pay/complete/redirect/url"
       }
    }
    
  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");
    //for example: "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.create",
        "format": "json",
        "charset": "utf-8",
        "encryptType": "AES",
        "signType": "RSA",
      	
         // Add the signature to the request parameter
        "sign": "hcsZg0q6sLm4gRQ97MBAlkNFAJCFXUAlnxlJCzjjwNwJJ9i8JIXoFjnzi6zRpyt6Vw7RGiUvUsLCq6PSUEIQ4B45ZaOCZCcs8SqCEP/ybxyacOnOD5Km8y7XbOJGYFgvepixo4BvigTvfrPydjtbeJMxoaRJnsvhgAtcwxErLwM3GARLMP4sEj/5xEheO1zvmD1BoacEBBxcE5uGXm0YSLE45NDeNvwVYPg9mJYmsVzHT7+NQngFFTHpPOoN5YaD+iI6PeU+h6r3ulq4+rDgjTc+3451Ce7g32ZXBRwOS3osAU9BBiW1bL97J4vXBhdBiL9iiEbE3BdbHlf03HPpIg==",
    
        "timestamp": 1706585572074,
    
        // Encrypted payment object
        "body": "7K2AyShlt1fOrKhCTC42EpqOnXxzSAiY+pLWGLo2AX4Q7uWjcv6SNQFUpgUpzrvRVXb4wQtTtdAelRk8YnqBGl/UlUR08cSWz4VALGT+YJB7FUEMfZ7m8Y3kLloe8Mv4Kg4D8uNNBmIUUZBPS782tQVoSNG+B0jLjqISTltY5UkqkidQnbPKxXO0XeFJApW00UZIJhuhUhaQgMT3/cmO5XzDtVjOa2FRszMi65zoeWyoFVXYxqJwiZ4PVv7FFRzoDbcbtXL1mJ/TeJ51UC2zdeJN9IW41aw6e2dE3xx++PLsLbzhtwJg/qra/+4/94kQw/gB3qWGbeb9icOC/A7TnFqOWkct7A9xYlm1mYbyBer1EYpNSZ/IB156ou+YS4S3aeqtDoXp+wRk0L9fYZher5cwy7GD2IPGMF9OLDd+5/ml7Lpik9dOmu9m8UljJLNM620o3j7R3clFB1Zztrd53i78/K/XOgj0Kd+rJt1CUkcAjFleTXDP63uFMcbFz36iHv6+/tPfisGGCX98jEGVWA=="
    }
    
    

  5. Send the request to the BIEASES payment gateway.

    POST /payment/api/v1/payment-order HTTP 1.1
    Content-Type: "application/json"
    
    {
        "merchantId": "B131567545069",
        "method": "bieases.trade.create",
        "format": "json",
        "charset": "UTF-8",
        "encryptType": "AES",
        "signType": "RSA",
        "sign": "hcsZg0q6sLm4gRQ97MBAlkNFAJCFXUAlnxlJCzjjwNwJJ9i8JIXoFjnzi6zRpyt6Vw7RGiUvUsLCq6PSUEIQ4B45ZaOCZCcs8SqCEP/ybxyacOnOD5Km8y7XbOJGYFgvepixo4BvigTvfrPydjtbeJMxoaRJnsvhgAtcwxErLwM3GARLMP4sEj/5xEheO1zvmD1BoacEBBxcE5uGXm0YSLE45NDeNvwVYPg9mJYmsVzHT7+NQngFFTHpPOoN5YaD+iI6PeU+h6r3ulq4+rDgjTc+3451Ce7g32ZXBRwOS3osAU9BBiW1bL97J4vXBhdBiL9iiEbE3BdbHlf03HPpIg==",
        "timestamp": "1706585572074",
        "body": "7K2AyShlt1fOrKhCTC42EpqOnXxzSAiY+pLWGLo2AX4Q7uWjcv6SNQFUpgUpzrvRVXb4wQtTtdAelRk8YnqBGl/UlUR08cSWz4VALGT+YJB7FUEMfZ7m8Y3kLloe8Mv4Kg4D8uNNBmIUUZBPS782tQVoSNG+B0jLjqISTltY5UkqkidQnbPKxXO0XeFJApW00UZIJhuhUhaQgMT3/cmO5XzDtVjOa2FRszMi65zoeWyoFVXYxqJwiZ4PVv7FFRzoDbcbtXL1mJ/TeJ51UC2zdeJN9IW41aw6e2dE3xx++PLsLbzhtwJg/qra/+4/94kQw/gB3qWGbeb9icOC/A7TnFqOWkct7A9xYlm1mYbyBer1EYpNSZ/IB156ou+YS4S3aeqtDoXp+wRk0L9fYZher5cwy7GD2IPGMF9OLDd+5/ml7Lpik9dOmu9m8UljJLNM620o3j7R3clFB1Zztrd53i78/K/XOgj0Kd+rJt1CUkcAjFleTXDP63uFMcbFz36iHv6+/tPfisGGCX98jEGVWA=="
    }
    
  6. The following JSON shows an example of the Create Payment request being returned when you requested.

    200 OK
    Content-Type: "application/json"
    
    {
        "code": "20000",
        "msg": "SUCCESS",
        "data": 
        {
           "paymentId":"",
           "referOrderNo":"",
           "channel":"",
           "checkoutUrl":"",
           "status":"",
        }
    }
    

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