Webhook

BIEASES payment gateway supports a callback with the callback URL Setting in the Create Payment Operation. The callback URL can be changed for each of the requests. However, we do not recommend that as that might be blocked by the security control if you change the callback URL frequently. Please use a fixed callback URL if that is possible. You can change that anytime, but before that make sure the new callback URL is reachable.

Setup

Merchant customs can use the callback URL Parameter to get notified while the payment order gets processed.

The webhook process workflow


Event List

The webhook callback event list.

Event Name Description Related Endpoint

payment.order.confirming

Consumer has submitted the payment request and pending BIEASES backend to process.

https://docs.bieases.com/reference/create-payment

payment.order.timeout

The payment order has not been paid within given period.

https://docs.bieases.com/reference/create-payment

payment.order.success

The payment order has been paid successfully by the consumer.

https://docs.bieases.com/reference/create-payment

payment.order.failed

The payment order failed to pay.
Refer to the "msg" field Payment result object for the failed reason.

https://docs.bieases.com/reference/create-payment

payment.refund.success

The payment refund completed successfully.

https://docs.bieases.com/reference/refund-payment

payment.refund.failed

The payment refund request failed.
Refer to the "msg" field Payment result object for the failed reason.

https://docs.bieases.com/reference/refund-payment

Handle callback

The callback message is constructed with two parts, one is used for the basic request information, and another represents the payment result details.

**Please follow the below steps to process the callback message: **

  1. Verify the signature.
  2. Handle the callback message with your code.
  3. Respond to the callback message synchronously with a HTTP** 200 success** status.
200
Content-Type: application/json

{
  "code": 20000,
  "msg": ""
}

📘

Note:

  • The confirmation message does not require signature and encryption. Just return a simple message through the HTTP response.
  • Your listener should be an app or script deployed at the corresponding URL that listens on HTTPS port 443. For webhook message deliveries to be successful, the listener must respond with an HTTP 200 success status every time. Otherwise, BIEASES will retry each delivery up to 8 times over 7 days.
    • For example if there is no response, BIEASES cannot connect, or if the server responds with a 404 or 500 error

Callback message structure

POST  /callbackUrl/  HTTP/1.1
Content-Type: application/json

{
    "id":"string",//the webhook id
    "merchantId": "string",
    "eventName": "string",//webhook event name
  	"format":"string",
    "charset":"string",
    "encryptType":"string",
    "signType":"string",
    "sign": "string",
    "timestamp": "string",
    "body": "<encrypted body string>" // the encrypted body string
    
    // the body data structure example, for more information please refer to "Created order callback" and "Refund order callback" object defination.
    // "body": { 
    //     "merchantId":"string",
    //     "outOrderNo":"string",
    //     "status":"string",
    //     "msg":"string",
    //     "paymentAmount":"string",
    //     "currency":"string",
    //     "paymentTime":"string",
    //     "paidTime":"string"
    // }
}

Please refer to Webhook Callback Payload for more information. And please refer to Webhook Event Names to find all of the supported event names.

Payment result objects

Created order callback

KeyTypeDescriptionExample
merchantIdStringThe merchant wallet ID which can be found at merchant wallet: Home->Merchant Information->BIEASES IDB131567545069
referOrderNoStringThe order number on the Merchant's platform2013112111001004500000675971
transactionIdStringThe wallet transaction id8zzsLUsjPaJBDQMM86bVh2ou7f6y8W
paymentAmountNumberPayment amount.21.55
currencyStringThe payment currency code. Refer to ISO 4217.USD
paymentTimeTimestampPayment creation time. It's a timestamp .1706585572074
completeTimeTimestampPayment completion time. It's a timestamp .1706585572074
statusStringThe payment order status.
msgStringThe status message If there is any exception in the payment order.

Refund order callback

Key Type Description Example

merchantId

String

The merchant wallet ID which can be found at merchant wallet: Home->Merchant Information->BIEASES ID

B131567545069

refundId

String

The refund number on the payment

2013112111001004500000675973

paymentId

String

The payment order number regarding the payment request

01J143NWJFNGBV2YB9ZRB9T7PS

referRefundNo

String

The order number on the Merchant's platform

2013112111001004500000675971

transactionId

String

The wallet transaction id

8zzsLUsjPaJBDQMM86bVh2ou7f6y8W

refundAmount

Number

Refunded amount.

21.55

refundTime

Timestamp

The refund created time. It's a timestamp

1706585572074

completeTime

Timestamp

The refund request completion time. It's a timestamp .
The request completed does not mean the refund success. It's just that the transaction has completed either successfully or failed.

1706585572074

status

String

The payment order status.

msg

String

The status message If there is any exception in the refund order.