Creating a payment URL
πΈπ¦ In The Kingdom of Saudi Arabia, Payments are not yet supported in the KSAs Open Banking Standard.
In order to start initiating open banking single domestic payments from your application you need to first create a Payment URL by making a call to the following end point /payment-services/v2/payments .
curl --location --request POST 'https://api.sandbox.tarabutgateway.io/payment-services/v2/payments' \
--header 'Authorization: Bearer <your_access_token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"endToEndId": "{{321423413}}",
"intent": {
"type": "SINGLE_DOMESTIC",
"reference": "payment to my favourite store",
"payment": {
"currency": "BHD",
"value": "800.231"
}
}
}'
Once you make the above API call, you will receive a redirectUrl, status and endToEndId in response.
{
"endToEndId": "31d7ab6f6e4049ed84c00b7f7fc6fd4c",
"createdAtDateTime": "2023-02-09T07:39:16.278337175Z",
"redirectUrl": "https://payment-ui.ci.tarabutgateway.io?token=eyJraWQiOiI5ODEwNWRkNy02OTk1LTQxY2ItOGFlMS05NDViOGIxNTY2Y2MiLCJhbGciOiJSUzI1NiJ9.eyJjbGllbnRJZCI6IjZlZjQyZDNjLWUyNjgtNGU0Ny05MzdkLTIzYjhjMDMzMzRkYSIsImtpZCI6Ijk4MTA1ZGQ3LTY5OTUtNDFjYi04YWUxLTk0NWI4YjE1NjZjYyIsImlzcyI6Imh0dHBzOi8vYXBpLmNpLnRhcmFidXRnYXRld2F5LmlvIiwiZXhwIjoxNjc1OTI5MjU2LCJlbmRUb0VuZElkIjoiMzFkN2FiNmY2ZTQwNDllZDg0YzAwYjdmN2ZjNmZkNGMiLCJ0b2tlblR5cGUiOiJNRVJDSEFOVF9SRURJUkVDVF9VUkxfVE9LRU4iLCJpYXQiOjE2NzU5MjgzNTYsImp0aSI6ImEzOTgzYWMwLTA2YzEtNGE3NS1iZTM5LTg1MDljMTkzZDBlYiJ9.M8y1Rve1_oI45rfLIgZfxv9YphOvx6M8vh29k63CTTGrLPE4gAozhvij5HxlViPqMab62Ocm5e478OiASsP_PzVM8vwWHXTimvv1WEGW1PWj52NJdm9AL30SlxZ_TSniQ5EKRcOi2dS3bN-AAKB6RDWDh00P46XU1j6lR_y8h99ijjR9yCW_37bDwPtCvEMDtr4TErvyYerrSTK9w0F2TyqZAIjPNs6uO4Ck1-duk0djCtK1oALPD8WVAp3HejnGNtd_SlRMJo4q92o4IW4UBH9v7wrHfFDe5VDyaUn7TY8_KYdRL_Z9xTWtvdoJJ3jtA6kkVzGaGvJOJgtavANfqQ",
"status": "INITIATED",
"payment": {
"currency": "BHD",
"value": "54.662"
}
}
The redirect url has information about the transaction, user information, info like currency, unique transaction identifier and more.
In the above request and response payloads you will also notice that there is a field called as the "endToEndId". This is parameter that can be used to pass the unique identifier that is attached to each API request. For every API request whether it is successful or failed, the endToEndId passed should be unique. This helps merchants and TG internal teams to troubleshoot any problems that may occur on a technical level.
The redirect url should be integrated in such a way that the URL is generated with the right values in it when the end user is on the merchant payment page and the end user clicks on "Pay with Bank". This way the merchant does not create redirect urls that do not get invoked and the payment journey on the merchant app is also seamless.
Good to know : -
Our service can be used to initiate a Single Domestic Payment via Fawri+. Fawri+ settles transactions in near real-time, up to 30 seconds and are limited to 1000.000 BHD. Other payment types of payment rails, like Fawri, a slower delayed settlement payment method, are currently not supported. TG does not support other payment types, like future-dated and international payments.
Updated 25 days ago