How to add your internal reference id

Most of the times merchants create an internal reference id for every transaction or order that the user creates on their platform or application.

This needs to be mapped to a successful or failed payment at TG as this helps the merchant with reconciliations.

The best way to map a merchant's internal reference id or payment id with TG payment id is by passing the unique identifier in the endToEndId parameter while creating a payment url.

Sample Request

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"
    }
  }
}'

The above endToEndId is also returned in response with the status.

{
  "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 internal reference id (Unique id created on merchant's platform) and the endToEndId are now mapped to each other and the same endToEndId is also passed to the bank when initiating a payment.