Airwallex logo
Airwallex logo

Accept Tabby payments

You can accept Tabby payments in three simple steps:

  1. Initialize a Payment Intent
  2. Redirect the shopper to Tabby to complete payment
  3. Query the Payment Status

Step 1. Initialize a Payment Intent

Create a Payment Intent using the Create a Payment Intent API API.

Example request:

Shell
1curl --request POST \
2--url 'https://api-demo.airwallex.com/api/v1/pa/payment_intents/create' \
3--data-raw '{
4 "request_id": "ed11e38a-7234-11ea-aa94-7fd44ffd1b89",
5 "amount": 200,
6 "currency": "SAR",
7 "merchant_order_id": "85d7b0e0-7235-11ea-862e-9f6aa1adfca6",
8 "return_url": "https://www.airwallex.com"
9}'

Step 2. Redirect to Tabby to complete payment

When a shopper selects to pay with Tabby, call the Confirm a Payment Intent API API to get a payment URL pointing to Tabby page.

Shell
1__POST /api/v1/pa/payment_intents/{id}/confirm__
JSON
1{
2 "request_id": "ed11e38a-7234-11ea-aa94-7fd44ffd1b89",
3 "payment_method": {
4 "type": "tabby"
5 "tabby": {
6 "language": "en",
7 "shopper_name": "John Doe",
8 "shopper_email": "[email protected]",
9 "shopper_phone": "+971500000001"
10 }
11 }
12}

You will get a response similar to the following.

JSON
1{
2 // ... other fields omitted.
3 "next_action": {
4 "type": "redirect",
5 "method": "GET",
6 "url": "https://api-dev.airwallex.com/pa/redirect/sg/sgdvbl9nzgwd9fze1ng_fz3yhk?checksum=91ff02539b72"
7 }
8}

You should redirect the shopper to the Tabby page with the next_action.url returned in the confirm Payment Intent response.

Once generated, the URL will expire in 20 minutes. Confirming the Payment Intent again with Tabby or other payment methods will lead to the invalidation of the URL.

Step 3. Query the Payment Status

To get the payment result, we recommend polling the status of the Payment Intent via the Retrieve a Payment Intent API API. You may start polling the Payment Intent status after the shopper is redirected back to your website (i.e. the return_url passed when creating the Payment Intent).

In addition, Airwallex will notify you of the payment result asynchronously via webhooks. Please refer to the webhook documentation to set up your webhook accordingly.

Was this page helpful?