curl --request GET \
--url https://api.tabby.ai/api/v2/payments/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tabby.ai/api/v2/payments/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tabby.ai/api/v2/payments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tabby.ai/api/v2/payments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tabby.ai/api/v2/payments/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tabby.ai/api/v2/payments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tabby.ai/api/v2/payments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"amount": "100",
"currency": "AED",
"buyer": {
"name": "John Doe",
"email": "[email protected]",
"phone": "500000001",
"dob": "2000-01-20"
},
"shipping_address": {
"city": "Dubai",
"address": "Dubai",
"zip": "1111"
},
"order": {
"reference_id": "1001",
"items": [
{
"title": "Name of the product",
"quantity": 1,
"unit_price": "0.00",
"category": "Clothes",
"reference_id": "SKU123",
"description": "Description of the product",
"image_url": "https://example.com/",
"product_url": "https://example.com/",
"gender": "Kids",
"color": "white",
"product_material": "cotton",
"size_type": "EU",
"size": "M",
"brand": "Name of the Brand",
"is_refundable": true
}
],
"updated_at": "2023-11-07T05:31:56Z",
"tax_amount": "0.00",
"shipping_amount": "0.00",
"discount_amount": "0.00"
},
"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",
"status": "new",
"buyer": {
"name": "John Doe",
"email": "[email protected]",
"phone": "500000001",
"dob": "2000-01-20"
},
"shipping_address": {
"city": "Dubai",
"address": "Dubai",
"zip": "1111"
},
"payment_method": "card",
"items": [
{
"title": "Name of the product",
"quantity": 1,
"unit_price": "0.00",
"category": "Clothes",
"reference_id": "SKU123",
"description": "Description of the product",
"image_url": "https://example.com/",
"product_url": "https://example.com/",
"gender": "Kids",
"color": "white",
"product_material": "cotton",
"size_type": "EU",
"size": "M",
"brand": "Name of the Brand",
"is_refundable": true,
"ordered": 0,
"captured": 0,
"shipped": 0,
"refunded": 0
}
]
}
],
"id": "payment id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"status": "CLOSED",
"is_test": true,
"description": "description",
"captures": [
{
"amount": "100",
"reference_id": "capture idempotency key",
"id": "capture id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"tax_amount": "0.00",
"shipping_amount": "0.00",
"discount_amount": "0.00",
"items": [
{
"title": "Name of the product",
"quantity": 1,
"unit_price": "0.00",
"category": "Clothes",
"reference_id": "SKU123",
"description": "Description of the product",
"image_url": "https://example.com/",
"product_url": "https://example.com/",
"gender": "Kids",
"color": "white",
"product_material": "cotton",
"size_type": "EU",
"size": "M",
"brand": "Name of the Brand",
"is_refundable": true
}
]
}
],
"refunds": [
{
"amount": "0.00",
"reference_id": "refund idempotency key",
"id": "refund id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"reason": "Reason for the refund",
"items": [
{
"title": "Name of the product",
"quantity": 1,
"unit_price": "0.00",
"category": "Clothes",
"reference_id": "SKU123",
"description": "Description of the product",
"image_url": "https://example.com/",
"product_url": "https://example.com/",
"gender": "Kids",
"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": "error",
"errorType": "bad_data",
"error": "invalid payment id"
}{
"status": "error",
"errorType": "not_authorized",
"error": "missing Bearer scheme"
}{
"status": "error",
"errorType": "not_found",
"error": "no such payment"
}{
"status": "error",
"errorType": "internal",
"error": "Internal Server Error"
}Retrieve a payment
Retrieves the specified payment. Returns the entire payment object, including the payment Status, Captures and Refunds objects.
curl --request GET \
--url https://api.tabby.ai/api/v2/payments/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tabby.ai/api/v2/payments/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tabby.ai/api/v2/payments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tabby.ai/api/v2/payments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tabby.ai/api/v2/payments/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tabby.ai/api/v2/payments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tabby.ai/api/v2/payments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"amount": "100",
"currency": "AED",
"buyer": {
"name": "John Doe",
"email": "[email protected]",
"phone": "500000001",
"dob": "2000-01-20"
},
"shipping_address": {
"city": "Dubai",
"address": "Dubai",
"zip": "1111"
},
"order": {
"reference_id": "1001",
"items": [
{
"title": "Name of the product",
"quantity": 1,
"unit_price": "0.00",
"category": "Clothes",
"reference_id": "SKU123",
"description": "Description of the product",
"image_url": "https://example.com/",
"product_url": "https://example.com/",
"gender": "Kids",
"color": "white",
"product_material": "cotton",
"size_type": "EU",
"size": "M",
"brand": "Name of the Brand",
"is_refundable": true
}
],
"updated_at": "2023-11-07T05:31:56Z",
"tax_amount": "0.00",
"shipping_amount": "0.00",
"discount_amount": "0.00"
},
"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",
"status": "new",
"buyer": {
"name": "John Doe",
"email": "[email protected]",
"phone": "500000001",
"dob": "2000-01-20"
},
"shipping_address": {
"city": "Dubai",
"address": "Dubai",
"zip": "1111"
},
"payment_method": "card",
"items": [
{
"title": "Name of the product",
"quantity": 1,
"unit_price": "0.00",
"category": "Clothes",
"reference_id": "SKU123",
"description": "Description of the product",
"image_url": "https://example.com/",
"product_url": "https://example.com/",
"gender": "Kids",
"color": "white",
"product_material": "cotton",
"size_type": "EU",
"size": "M",
"brand": "Name of the Brand",
"is_refundable": true,
"ordered": 0,
"captured": 0,
"shipped": 0,
"refunded": 0
}
]
}
],
"id": "payment id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"status": "CLOSED",
"is_test": true,
"description": "description",
"captures": [
{
"amount": "100",
"reference_id": "capture idempotency key",
"id": "capture id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"tax_amount": "0.00",
"shipping_amount": "0.00",
"discount_amount": "0.00",
"items": [
{
"title": "Name of the product",
"quantity": 1,
"unit_price": "0.00",
"category": "Clothes",
"reference_id": "SKU123",
"description": "Description of the product",
"image_url": "https://example.com/",
"product_url": "https://example.com/",
"gender": "Kids",
"color": "white",
"product_material": "cotton",
"size_type": "EU",
"size": "M",
"brand": "Name of the Brand",
"is_refundable": true
}
]
}
],
"refunds": [
{
"amount": "0.00",
"reference_id": "refund idempotency key",
"id": "refund id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"reason": "Reason for the refund",
"items": [
{
"title": "Name of the product",
"quantity": 1,
"unit_price": "0.00",
"category": "Clothes",
"reference_id": "SKU123",
"description": "Description of the product",
"image_url": "https://example.com/",
"product_url": "https://example.com/",
"gender": "Kids",
"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": "error",
"errorType": "bad_data",
"error": "invalid payment id"
}{
"status": "error",
"errorType": "not_authorized",
"error": "missing Bearer scheme"
}{
"status": "error",
"errorType": "not_found",
"error": "no such payment"
}{
"status": "error",
"errorType": "internal",
"error": "Internal Server Error"
}Authorizations
Bearer authentication header of the form Bearer <secret_key>, where <secret_key> is your secret_key.
Path Parameters
ID of the payment.
"payment id, uuid format"
Response
Success. Payment object is returned.
Payment object.
Total payment amount, including tax, shipping and any discounts. Allows to send up to 2 decimals for AED and SAR, up to 3 decimals for KWD.
"100"
ISO 4217 currency code for the payment amount. Currently there are 2 possible currency options - depending on the country where the store is located:
AED- United Arab Emirates DirhamSAR- Saudi Riyal
AED, SAR "AED"
Customer information
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Customer / user / student information from previous purchases with you.
Show child attributes
Show child attributes
Array of objects, should contain information on 5-10 previously placed via any payment method orders in any status, current order excluded.
Show child attributes
Show child attributes
Unique identifier for the payment (UUID), assigned by Tabby. Save it on your side!
"payment id, uuid format"
Date and time the payment was created, in UTC, and displayed in ISO 8601 datetime format.
Date and time the payment expires, in UTC, and displayed in ISO 8601 datetime format.
Status of the current payment:
CREATEDmeans that the payment is created successfully, but not finished yet;AUTHORIZEDandCLOSEDmark the successfully approved and captured payments accordingly;REJECTEDis returned when a customer is rejected during Tabby Checkout;EXPIREDis used when a customer cancels a payment or when Tabby doesn't receive a successfully paid transaction after timeout.
CREATED, AUTHORIZED, CLOSED, REJECTED, EXPIRED "CLOSED"
Indicates whether this is a test payment (created using the Test API keys or Production API Keys).
"description"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Merchant-defined data about the payment. This field is a key-value map. The example properties provided below.
Show child attributes
Show child attributes
Extra data (booking info, insurance, flight reservations, ...) as serialized JSON
Show child attributes
Show child attributes
Was this page helpful?