Create an order
このページは 日本語 ではまだ利用できません。デフォルトの言語 (English) で表示しています。
Create an order
https://api.cekat.ai/api/ordersCreates an order and its invoice. Identify the customer with conversation_id, contact_id or phone_number; if no contact matches, a new one is created from phone_number and display_name.
For each product, send a product_id from your catalog (its catalog name and price are used) or a product_name and price for a custom item. The grand total (subtotal − discount + shipping fee + VAT) must be between 1 and 9,999,999,999.
Authorization
Your Cekat API key, from Settings → Developers & API in the Cekat dashboard.
Alternative to api_key: send the same key as Bearer YOUR_API_KEY.
Body application/jsonrequired
manual, xendit, custom1Show child attributes
A catalog product. Leave out for a custom item.
Name of a custom item.
Price of a custom item.
1Required with phone_number when the contact is new.
Required for manual. A payment bank account set up in Cekat.
Required for custom.
0min: 00min: 00min: 0Optional order ID (UUID v4) to use instead of a generated one.
Optional order date, for importing past orders.
Response
Order and invoice created.
An order with its contact, products and invoices. Additional fields may be present.
Show child attributes
pending, processing, shipping, cancelled, completedmanual, xendit, customShow child attributes
Show child attributes
The order's invoices, newest first.
Show child attributes
PENDING, PAID, EXPIRED, SETTLEDXendit payment link, for xendit orders.
Invoice PDF, or your own invoice URL for custom orders.
A required field is missing, or a value is out of range.
Show child attributes
Request ID. Include it when contacting Cekat support.
The API key is missing or invalid.
Show child attributes
Request ID. Include it when contacting Cekat support.
The bank account was not found.
Show child attributes
Request ID. Include it when contacting Cekat support.
Rate limit exceeded. Wait and retry.
curl --request POST \
--url 'https://api.cekat.ai/api/orders' \
--header 'api_key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"payment_method": "manual",
"orders_products": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product_name": "Kopi Susu",
"price": 10000,
"quantity": 1
}
]
}'
const response = await fetch('https://api.cekat.ai/api/orders', {
method: 'POST',
headers: { 'api_key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"payment_method": "manual",
"orders_products": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product_name": "Kopi Susu",
"price": 10000,
"quantity": 1
}
]
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api.cekat.ai/api/orders"
headers = {"api_key": "YOUR_API_KEY"}
payload = {
"payment_method": "manual",
"orders_products": [
{
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product_name": "Kopi Susu",
"price": 10000,
"quantity": 1
}
]
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.cekat.ai/api/orders',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['api_key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'payment_method' => 'manual',
'orders_products' => [[
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'product_name' => 'Kopi Susu',
'price' => 10000,
'quantity' => 1
]]
]),
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"message": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order_number": 1,
"created_at": "2026-01-15T09:30:00Z",
"order_status": "pending",
"payment_method": "manual",
"subtotal": 10000,
"discount": 10000,
"shipping_fee": 10000,
"vat": 10000,
"grand_total": 10000,
"currency": "<string>",
"address": "<string>",
"notes": "<string>",
"contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_name": "Jane Doe",
"phone_number": "6281234567890",
"email": "[email protected]"
},
"cekat_orders_products": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"product_name": "Kopi Susu",
"quantity": 1,
"price": 10000
}
],
"invoices": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"amount": 10000,
"payment_link": "<string>",
"pdf_link": "<string>",
"is_sent": true,
"expiry_date": "2026-01-15",
"paid_at": "2026-01-15T09:30:00Z",
"created_at": "2026-01-15T09:30:00Z"
}
]
}
}
{
"success": true,
"message": "<string>",
"statusCode": 1,
"error": {
"message": "<string>"
},
"correlationId": "<string>"
}
{
"success": true,
"message": "<string>",
"statusCode": 1,
"error": {
"message": "<string>"
},
"correlationId": "<string>"
}
{
"success": true,
"message": "<string>",
"statusCode": 1,
"error": {
"message": "<string>"
},
"correlationId": "<string>"
}
{
"message": "<string>"
}