Skip to main content
POST
/
api
/
v2
/
checkout
Create a session
curl --request POST \
  --url https://api.tabby.ai/api/v2/checkout \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "payment": {
    "amount": "100",
    "currency": "AED",
    "description": "test payload",
    "buyer": {
      "name": "John Doe",
      "email": "jsmith@example.com",
      "phone": "500000001",
      "dob": "2000-01-20"
    },
    "shipping_address": {
      "city": "Dubai",
      "address": "Dubai",
      "zip": "1111"
    },
    "order": {
      "reference_id": "1001",
      "updated_at": "2023-11-07T05:31:56Z",
      "tax_amount": "0.00",
      "shipping_amount": "0.00",
      "discount_amount": "0.00",
      "items": [
        {
          "reference_id": "SKU123",
          "title": "Name of the product",
          "description": "Description of the product",
          "quantity": 1,
          "unit_price": "0.00",
          "discount_amount": "0.00",
          "image_url": "https://example.com/",
          "product_url": "https://example.com/",
          "gender": "Kids",
          "category": "Clothes",
          "color": "white",
          "product_material": "cotton",
          "size_type": "EU",
          "size": "M",
          "brand": "Name of the Brand",
          "is_refundable": true,
          "barcode": "12345678",
          "ppn": "MNXT2ZM/A",
          "seller": "Name of the Seller"
        }
      ]
    },
    "buyer_history": {
      "registered_since": "2023-11-07T05:31:56Z",
      "loyalty_level": 0,
      "wishlist_count": 0,
      "is_social_networks_connected": true,
      "is_phone_number_verified": true,
      "is_email_verified": true
    },
    "order_history": [
      {
        "purchased_at": "2023-11-07T05:31:56Z",
        "amount": "100",
        "payment_method": "card",
        "status": "new",
        "buyer": {
          "name": "John Doe",
          "email": "jsmith@example.com",
          "phone": "500000001",
          "dob": "2000-01-20"
        },
        "shipping_address": {
          "city": "Dubai",
          "address": "Dubai",
          "zip": "1111"
        },
        "items": [
          {
            "reference_id": "SKU123",
            "title": "Name of the product",
            "description": "Description of the product",
            "quantity": 1,
            "unit_price": "0.00",
            "discount_amount": "0.00",
            "image_url": "https://example.com/",
            "product_url": "https://example.com/",
            "gender": "Kids",
            "category": "Clothes",
            "color": "white",
            "product_material": "cotton",
            "size_type": "EU",
            "size": "M",
            "brand": "Name of the Brand",
            "is_refundable": true,
            "barcode": "12345678",
            "ppn": "MNXT2ZM/A",
            "seller": "Name of the Seller"
          }
        ]
      }
    ],
    "meta": {
      "customer": "#customer-id",
      "order_id": "#1234"
    },
    "attachment": {
      "body": "{\"flight_reservation_details\": {\"pnr\": \"TR9088999\",\"itinerary\": [...],\"insurance\": [...],\"passengers\": [...],\"affiliate_name\": \"some affiliate\"}}",
      "content_type": "application/vnd.tabby.v1+json"
    }
  },
  "lang": "en",
  "merchant_code": "code provided to you from Tabby side",
  "merchant_urls": {
    "success": "https://your-store/success",
    "cancel": "https://your-store/cancel",
    "failure": "https://your-store/failure"
  },
  "token": null
}'
{
  "id": "session id, uuid format",
  "configuration": {
    "available_products": {
      "installments": [
        {
          "web_url": "https://checkout.tabby.ai/",
          "qr_code": "https://api.tabby.ai/api/v2/checkout/{id}/hpp_link_qr"
        }
      ]
    },
    "products": {
      "installments": {
        "type": "installments",
        "is_available": true,
        "rejection_reason": null
      }
    }
  },
  "token": null,
  "payment": {
    "id": "payment id, uuid format",
    "created_at": "2023-11-07T05:31:56Z",
    "status": "CREATED",
    "is_test": true,
    "amount": "100",
    "currency": "AED",
    "description": "test payload",
    "order": {
      "reference_id": "1001",
      "updated_at": "2023-11-07T05:31:56Z",
      "tax_amount": "0.00",
      "shipping_amount": "0.00",
      "discount_amount": "0.00",
      "items": [
        {
          "reference_id": "SKU123",
          "title": "Name of the product",
          "description": "Description of the product",
          "quantity": 1,
          "unit_price": "0.00",
          "image_url": "https://example.com/",
          "product_url": "https://example.com/",
          "gender": "Kids",
          "category": "Clothes",
          "color": "white",
          "product_material": "cotton",
          "size_type": "EU",
          "size": "M",
          "brand": "Name of the Brand",
          "is_refundable": true
        }
      ]
    },
    "meta": {
      "customer": "#customer-id",
      "order_id": "#1234"
    },
    "attachment": {
      "body": "{\"flight_reservation_details\": {\"pnr\": \"TR9088999\",\"itinerary\": [...],\"insurance\": [...],\"passengers\": [...],\"affiliate_name\": \"some affiliate\"}}",
      "content_type": "application/vnd.tabby.v1+json"
    }
  },
  "status": "created",
  "merchant_urls": {
    "success": "https://your-store/success",
    "cancel": "https://your-store/cancel",
    "failure": "https://your-store/failure"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <secret_key>, where <secret_key> is your secret_key.

Body

application/json
payment
object
required

Payment object associated with the current session.

lang
enum<string>
required

Session language, used to launch HPP with desired language.

Available options:
ar,
en
Example:

"en"

merchant_code
string
required

Please contact your integration manager to get the merchant code.

Example:

"code provided to you from Tabby side"

merchant_urls
object

Used for redirecting the customer after Tabby Checkout flow. Required for Web integration, optional for Mobile App integration.

token
string

If you already have token, you can pass it there. Authorization header still requires Secret Key.

Response

Success. Checkout session object is returned.

id
string<uuid>

Unique identifier for the checkout Session, assigned by Tabby.

Example:

"session id, uuid format"

configuration
object

Some details associated with the current session.

token
string | null

In the response, this field will be filled with token value if session status is 'approved'. You can use that token for Tokenized Payments and Web Checkout.

Example:

null

payment
object

Payment object associated with the current session.

status
enum<string>

Status of the current session. Used at the pre-scoring and session creation steps.

  • created is returned when the request is approved and the customer is eligible to use Tabby
  • rejected means that there are no available products for a customer
  • expired and approved - used for specific type of integration, kindly ignore them if not communicated directly
Available options:
created,
rejected,
expired,
approved
Example:

"created"

merchant_urls
object