curl --request POST \
--url https://api.tabby.ai/api/v2/payments/{id}/captures \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"amount": "100.00",
"reference_id": "1001",
"tax_amount": "0.00",
"shipping_amount": "0.00",
"discount_amount": "0.00",
"created_at": "2023-11-07T05:31:56Z",
"items": [
{
"title": "Name of the product",
"description": "Description of the product",
"quantity": 1,
"unit_price": "0.00",
"discount_amount": "0.00",
"reference_id": "SKU123",
"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"
}
]
}'
{
"id": "payment id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"status": "CREATED",
"is_test": true,
"amount": "100",
"currency": "AED",
"description": "test payload",
"buyer": {
"phone": "500000001",
"email": "jsmith@example.com",
"name": "John Doe",
"dob": "2000-01-20T00:00:00.000Z"
},
"shipping_address": {
"city": "Dubai",
"address": "Dubai",
"zip": "1111"
},
"order": {
"tax_amount": "0.00",
"shipping_amount": "0.00",
"discount_amount": "0.00",
"updated_at": "2023-11-07T05:31:56Z",
"reference_id": "1001",
"items": [
{
"title": "Name of the product",
"description": "Description of the product",
"quantity": 1,
"unit_price": "0.00",
"discount_amount": "0.00",
"reference_id": "SKU123",
"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"
}
]
},
"captures": [
{
"id": "capture id, uuid format",
"amount": "100.00",
"reference_id": "1001",
"tax_amount": "0.00",
"shipping_amount": "0.00",
"discount_amount": "0.00",
"created_at": "2023-11-07T05:31:56Z",
"items": [
{
"title": "Name of the product",
"description": "Description of the product",
"quantity": 1,
"unit_price": "0.00",
"discount_amount": "0.00",
"reference_id": "SKU123",
"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"
}
]
}
],
"refunds": [
{
"id": "refund id, uuid format",
"amount": "0.00",
"reference_id": "1001",
"reason": "Reason for the refund",
"created_at": "2023-11-07T05:31:56Z",
"items": [
{
"title": "Name of the product",
"description": "Description of the product",
"quantity": 1,
"unit_price": "0.00",
"discount_amount": "0.00",
"reference_id": "SKU123",
"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.00",
"payment_method": "card",
"status": "new",
"buyer": {
"phone": "500000001",
"email": "jsmith@example.com",
"name": "John Doe",
"dob": "2000-01-20T00:00:00.000Z"
},
"shipping_address": {
"city": "Dubai",
"address": "Dubai",
"zip": "1111"
},
"items": [
{
"title": "Name of the product",
"description": "Description of the product",
"quantity": 1,
"unit_price": "0.00",
"discount_amount": "0.00",
"reference_id": "SKU123",
"image_url": "https://example.com/",
"product_url": "https://example.com/",
"ordered": 0,
"captured": 0,
"shipped": 0,
"refunded": 0,
"gender": "Other",
"category": "Skirt",
"color": "blue",
"product_material": "Synthetic",
"size_type": "UK",
"size": "8",
"brand": "Name of the Brand"
}
]
}
],
"meta": {
"order_id": "#1234",
"customer": "#customer-id"
},
"attachment": {
"body": "{\"flight_reservation_details\": {\"pnr\": \"TR9088999\",\"itinerary\": [...],\"insurance\": [...],\"passengers\": [...],\"affiliate_name\": \"some affiliate\"}}",
"content_type": "application/vnd.tabby.v1+json"
}
}
Send a Capture requests for Authorized payments only. If you capture the full payment amount, the payment will be automatically closed with full capture. If you capture partial amount, the payment will remain Authorized until the rest of the amount is captured or Close request sent.
curl --request POST \
--url https://api.tabby.ai/api/v2/payments/{id}/captures \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"amount": "100.00",
"reference_id": "1001",
"tax_amount": "0.00",
"shipping_amount": "0.00",
"discount_amount": "0.00",
"created_at": "2023-11-07T05:31:56Z",
"items": [
{
"title": "Name of the product",
"description": "Description of the product",
"quantity": 1,
"unit_price": "0.00",
"discount_amount": "0.00",
"reference_id": "SKU123",
"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"
}
]
}'
{
"id": "payment id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"status": "CREATED",
"is_test": true,
"amount": "100",
"currency": "AED",
"description": "test payload",
"buyer": {
"phone": "500000001",
"email": "jsmith@example.com",
"name": "John Doe",
"dob": "2000-01-20T00:00:00.000Z"
},
"shipping_address": {
"city": "Dubai",
"address": "Dubai",
"zip": "1111"
},
"order": {
"tax_amount": "0.00",
"shipping_amount": "0.00",
"discount_amount": "0.00",
"updated_at": "2023-11-07T05:31:56Z",
"reference_id": "1001",
"items": [
{
"title": "Name of the product",
"description": "Description of the product",
"quantity": 1,
"unit_price": "0.00",
"discount_amount": "0.00",
"reference_id": "SKU123",
"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"
}
]
},
"captures": [
{
"id": "capture id, uuid format",
"amount": "100.00",
"reference_id": "1001",
"tax_amount": "0.00",
"shipping_amount": "0.00",
"discount_amount": "0.00",
"created_at": "2023-11-07T05:31:56Z",
"items": [
{
"title": "Name of the product",
"description": "Description of the product",
"quantity": 1,
"unit_price": "0.00",
"discount_amount": "0.00",
"reference_id": "SKU123",
"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"
}
]
}
],
"refunds": [
{
"id": "refund id, uuid format",
"amount": "0.00",
"reference_id": "1001",
"reason": "Reason for the refund",
"created_at": "2023-11-07T05:31:56Z",
"items": [
{
"title": "Name of the product",
"description": "Description of the product",
"quantity": 1,
"unit_price": "0.00",
"discount_amount": "0.00",
"reference_id": "SKU123",
"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.00",
"payment_method": "card",
"status": "new",
"buyer": {
"phone": "500000001",
"email": "jsmith@example.com",
"name": "John Doe",
"dob": "2000-01-20T00:00:00.000Z"
},
"shipping_address": {
"city": "Dubai",
"address": "Dubai",
"zip": "1111"
},
"items": [
{
"title": "Name of the product",
"description": "Description of the product",
"quantity": 1,
"unit_price": "0.00",
"discount_amount": "0.00",
"reference_id": "SKU123",
"image_url": "https://example.com/",
"product_url": "https://example.com/",
"ordered": 0,
"captured": 0,
"shipped": 0,
"refunded": 0,
"gender": "Other",
"category": "Skirt",
"color": "blue",
"product_material": "Synthetic",
"size_type": "UK",
"size": "8",
"brand": "Name of the Brand"
}
]
}
],
"meta": {
"order_id": "#1234",
"customer": "#customer-id"
},
"attachment": {
"body": "{\"flight_reservation_details\": {\"pnr\": \"TR9088999\",\"itinerary\": [...],\"insurance\": [...],\"passengers\": [...],\"affiliate_name\": \"some affiliate\"}}",
"content_type": "application/vnd.tabby.v1+json"
}
}
Bearer authentication header of the form Bearer <secret_key>
, where <secret_key>
is your secret_key
.
ID of the payment.
"payment id, uuid format"
Success. Payment object is returned.
Payment object associated with the current session.
Was this page helpful?