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",
"reference_id": "capture idempotency key",
"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"
}
]
}'
{
"id": "payment id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"status": "CLOSED",
"is_test": true,
"amount": "100",
"currency": "AED",
"description": "description",
"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",
"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
}
]
},
"captures": [
{
"id": "capture id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"amount": "100",
"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
}
],
"reference_id": "capture idempotency key"
}
],
"refunds": [],
"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",
"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,
"ordered": 0,
"captured": 0,
"shipped": 0,
"refunded": 0
}
]
}
],
"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"
}
}
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",
"reference_id": "capture idempotency key",
"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"
}
]
}'
{
"id": "payment id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"status": "CLOSED",
"is_test": true,
"amount": "100",
"currency": "AED",
"description": "description",
"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",
"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
}
]
},
"captures": [
{
"id": "capture id, uuid format",
"created_at": "2023-11-07T05:31:56Z",
"amount": "100",
"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
}
],
"reference_id": "capture idempotency key"
}
],
"refunds": [],
"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",
"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,
"ordered": 0,
"captured": 0,
"shipped": 0,
"refunded": 0
}
]
}
],
"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"
}
}
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.
Was this page helpful?