post https://sandbox.xfers.io/api/v4/payments
Dynamic PayNow QR
Dynamic PayNow QR allows you to create unique PayNow QR codes for each and every transaction. Upon getting the response, you will need to convert the base64 string to an image and display it to your customer.
There will be 2 callbacks fired:
- Payment completion by customer
- Crediting of funds to your account
For more information on PayNow, head over to PayNow QR.
Dynamic Virtual Account
Dynamic Virtual Account (VA) allows you to create unique VAs for each and every transaction. You can tie your transactionID with a VA, e.g. txnID123 <> VA123.
If a transaction (e.g. txnID123) is Paid or Expired, subsequent transfers to the Virtual Account (e.g. VA123) will not be associated. These subsequent transfers will be refunded to the user to the originating bank account.
Parameter | Required? | Type | Description |
---|---|---|---|
Amount | Mandatory | Float (up to 2decimal places) | Transaction Amount that user is required to pay/transfer. |
referenceId | Mandatory | String | This is used for idempotency and should typically be a "transaction id" or "order id" on your platform. |
Description | Optional | String | An arbitrary string attached to the object. |
paymentMethodType | Mandatory | String | Must always be "virtual_bank_account" |
bankShortCode | Mandatory | String | Supported values: "cimb" |
expiredAt | Mandatory | String | Timestamp to be in Time.iso8601. Expiry limit within 1hour to 30days |
Example of Dynamic VA request
# POST api/v4/payments/
# FYI, passing in metadata is possible,
# "description": "{\"key\":\"abc\",\"key2\":\"another key\"}"
Basic Auth
{
"data": {
"relationships": {
"customerProfile": {
"data": {
"id": "customer_profile_ff9a2945-5f58-4cd3-ac6e-90ee4361bf1e"
}
}
},
"attributes": {
"amount": 101.0,
"referenceId": "ORDER_0322",
"description": "This is the first order",
"paymentMethodType": "virtual_bank_account",
"paymentMethodOptions": {
"bankShortCode": "cimb"
},
"expiredAt": "2023-06-20T17:48:42+07:00"
}
}
}
Example of Dynamic VA response
{
"data": {
"id": "contract_ab8ad04b27d0414a96ae0b30a82576c8",
"type": "payment",
"attributes": {
"status": "pending",
"amount": "101.0",
"createdAt": "2022-09-06T16:52:11+08:00",
"description": "This is the first order",
"expiredAt": "2023-06-20T17:48:42+07:00",
"referenceId": "ORDER_0322",
"fees": "0.0",
"paymentMethod": {
"id": "va_756d9f1e6c3f7c1417c3eed133e0ab4d",
"type": "virtual_bank_account",
"referenceId": "ORDER_0322",
"instructions": {
"bankShortCode": "CIMB",
"accountNo": "8435212389019"
}
}
}
}
}