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.
Example of Dynamic PayNow request
# POST api/v4/payments/
{
"data": {
"attributes": {
"amount": 1.05,
"referenceId": "orderref001",
"description": "This is the first order",
"paymentMethodType": "paynow",
"expiredAt": "2024-09-13T17:48:42+07:00",
"paymentMethodOptions": {
"bankShortCode": "fazz"
}
}
}
}
Example of Dynamic PayNow response
{
"data": {
"id": "order_579e3f86-80ad-4770-8bef-a85b4df6c7f5",
"type": "payment",
"attributes": {
"status": "pending",
"amount": "1.05",
"currency": "SGD",
"createdAt": "2024-08-30T22:03:03+08:00",
"description": "This is the first order",
"expiredAt": "2024-09-13T17:48:42+07:00",
"referenceId": "orderref001",
"fees": "0.0",
"paymentMethod": {
"id": "payment_method_d5e22df0-4fab-47f4-8abc-5f97ab40cce3",
"type": "paynow",
"instructions": {
"extEndToEndId": "paynowb82a9e631725026123",
"qrCodeDisplayImage": "iVBORw0KGgoAAAANSUhEUgAA..."
},
"referenceId": "orderref001"
},
"senderInformation": null
}
}
}
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" |
paymentMethodOptions | Mandatory | String | Available options: "fazz", "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/
{
"data": {
"attributes": {
"amount": 1.00,
"referenceId": "orderref005",
"description": "This is the first order",
"paymentMethodType": "virtual_bank_account",
"paymentMethodOptions": {
"bankShortCode": "fazz"
},
"expiredAt": "2024-09-20T17:48:42+07:00"
}
}
Example of Dynamic VA response
{
"data": {
"id": "order_88b9a2bf-1168-4dfb-bbc9-25ab80385fe6",
"type": "payment",
"attributes": {
"status": "pending",
"amount": "1.0",
"currency": "SGD",
"createdAt": "2024-08-30T22:05:43+08:00",
"description": "This is the first order",
"expiredAt": "2024-09-20T17:48:42+07:00",
"referenceId": "orderref005",
"fees": "0.0",
"paymentMethod": {
"id": "payment_method_61a14365-42d4-4f91-8eea-e54d8d812e3b",
"type": "virtual_bank_account",
"referenceId": "orderref005",
"instructions": {
"bankName": "Xfers Pte Ltd",
"bankShortCode": "FAZZ",
"accountNo": "5009889591238"
}
},
"senderInformation": null
}
}
}