curl -X POST 'https://api.yativo.com/api/v1/card-checkout/orders' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'X-Api-Secret: YOUR_API_SECRET' \
-H 'Idempotency-Key: 3f1c2a1e-8b7d-4c1e-9f0a-6d2b5e7c9a10' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "4f0c1e1a-8d2b-4c7e-9b1a-3e5f6a7b8c9d",
"amount": "49.99",
"currency": "USD",
"description": "Pro plan, 1 month",
"reference": "INV-10023",
"customer_email": "ada@example.com",
"success_url": "https://shop.example.com/thanks",
"cancel_url": "https://shop.example.com/cart",
"metadata": { "plan": "pro" }
}'
{
"status": "success",
"status_code": 201,
"message": "Checkout created",
"data": {
"id": "cco_7wq2k9x0m3c8v1b5n6z4l2j8h0g4f6d1",
"customer_id": "4f0c1e1a-8d2b-4c7e-9b1a-3e5f6a7b8c9d",
"reference": "INV-10023",
"description": "Pro plan, 1 month",
"status": "pending",
"currency": "USD",
"amount": "49.99",
"platform_fee": "2.05",
"reserve": "0.00",
"net_amount": "47.94",
"refunded_amount": "0.00",
"disputed_amount": "0.00",
"checkout_url": "<string>",
"payment_methods": [
"<string>"
],
"metadata": {
"plan": "pro"
},
"expires_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"status": "failed",
"status_code": 403,
"message": "<string>",
"data": {
"error": "Card checkout is not enabled for your account. Contact support to request access.",
"code": "card_checkout_not_enabled"
},
"error": {
"code": "invalid_argument",
"message": "<string>",
"request_id": "req_5f2c9a1e7b3d4c8a6e0f1b2d"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 403,
"message": "<string>",
"data": {
"error": "Card checkout is not enabled for your account. Contact support to request access.",
"code": "card_checkout_not_enabled"
},
"error": {
"code": "invalid_argument",
"message": "<string>",
"request_id": "req_5f2c9a1e7b3d4c8a6e0f1b2d"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 403,
"message": "<string>",
"data": {
"error": "Card checkout is not enabled for your account. Contact support to request access.",
"code": "card_checkout_not_enabled"
},
"error": {
"code": "invalid_argument",
"message": "<string>",
"request_id": "req_5f2c9a1e7b3d4c8a6e0f1b2d"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 403,
"message": "<string>",
"data": {
"error": "Card checkout is not enabled for your account. Contact support to request access.",
"code": "card_checkout_not_enabled"
},
"error": {
"code": "invalid_argument",
"message": "<string>",
"request_id": "req_5f2c9a1e7b3d4c8a6e0f1b2d"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}Orders
Create order
Create a checkout order and get a checkout_url for the buyer
POST
/
card-checkout
/
orders
curl -X POST 'https://api.yativo.com/api/v1/card-checkout/orders' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'X-Api-Secret: YOUR_API_SECRET' \
-H 'Idempotency-Key: 3f1c2a1e-8b7d-4c1e-9f0a-6d2b5e7c9a10' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "4f0c1e1a-8d2b-4c7e-9b1a-3e5f6a7b8c9d",
"amount": "49.99",
"currency": "USD",
"description": "Pro plan, 1 month",
"reference": "INV-10023",
"customer_email": "ada@example.com",
"success_url": "https://shop.example.com/thanks",
"cancel_url": "https://shop.example.com/cart",
"metadata": { "plan": "pro" }
}'
{
"status": "success",
"status_code": 201,
"message": "Checkout created",
"data": {
"id": "cco_7wq2k9x0m3c8v1b5n6z4l2j8h0g4f6d1",
"customer_id": "4f0c1e1a-8d2b-4c7e-9b1a-3e5f6a7b8c9d",
"reference": "INV-10023",
"description": "Pro plan, 1 month",
"status": "pending",
"currency": "USD",
"amount": "49.99",
"platform_fee": "2.05",
"reserve": "0.00",
"net_amount": "47.94",
"refunded_amount": "0.00",
"disputed_amount": "0.00",
"checkout_url": "<string>",
"payment_methods": [
"<string>"
],
"metadata": {
"plan": "pro"
},
"expires_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"status": "failed",
"status_code": 403,
"message": "<string>",
"data": {
"error": "Card checkout is not enabled for your account. Contact support to request access.",
"code": "card_checkout_not_enabled"
},
"error": {
"code": "invalid_argument",
"message": "<string>",
"request_id": "req_5f2c9a1e7b3d4c8a6e0f1b2d"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 403,
"message": "<string>",
"data": {
"error": "Card checkout is not enabled for your account. Contact support to request access.",
"code": "card_checkout_not_enabled"
},
"error": {
"code": "invalid_argument",
"message": "<string>",
"request_id": "req_5f2c9a1e7b3d4c8a6e0f1b2d"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 403,
"message": "<string>",
"data": {
"error": "Card checkout is not enabled for your account. Contact support to request access.",
"code": "card_checkout_not_enabled"
},
"error": {
"code": "invalid_argument",
"message": "<string>",
"request_id": "req_5f2c9a1e7b3d4c8a6e0f1b2d"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 403,
"message": "<string>",
"data": {
"error": "Card checkout is not enabled for your account. Contact support to request access.",
"code": "card_checkout_not_enabled"
},
"error": {
"code": "invalid_argument",
"message": "<string>",
"request_id": "req_5f2c9a1e7b3d4c8a6e0f1b2d"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}You set the amount; the buyer cannot change it. Redirect them to
checkout_url exactly as returned. Only the card_checkout.order.paid webhook means the buyer paid.
The checkout link expires after 60 minutes. platform_fee, reserve and net_amount are fixed when the order is created.
See Create an order.
curl -X POST 'https://api.yativo.com/api/v1/card-checkout/orders' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'X-Api-Secret: YOUR_API_SECRET' \
-H 'Idempotency-Key: 3f1c2a1e-8b7d-4c1e-9f0a-6d2b5e7c9a10' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "4f0c1e1a-8d2b-4c7e-9b1a-3e5f6a7b8c9d",
"amount": "49.99",
"currency": "USD",
"description": "Pro plan, 1 month",
"reference": "INV-10023",
"customer_email": "ada@example.com",
"success_url": "https://shop.example.com/thanks",
"cancel_url": "https://shop.example.com/cart",
"metadata": { "plan": "pro" }
}'
Authorizations
Body
application/json