API Documentation
Integrate OrderConfirm's AI confirmation calls into your store with a simple REST API.
Overview
The OrderConfirm API lets you submit e-commerce orders and have an AI voice agent call your customers to confirm them — in Bangla or English. Send an order, trigger a confirmation call, and receive the outcome (confirmed, edited, or cancelled) along with a recording and transcript via polling or webhooks.
All endpoints are relative to the base URL:
https://api.orderconfirm.io/api/v1The typical lifecycle is: create an order → trigger a call → the agent dials your customer → you receive the result via webhook or by polling the call.
Authentication
Create an API key in the dashboard at /app/tokens and send it as the X-API-Key header on every ingestion request.
X-API-Key: ocb_live_your_key_hereYour key is shown only once
Step-by-step integration
- 01
Get an API key
Create a key in the dashboard and store it securely — it is shown only once.
- 02
Create an order
POST the order with customer phone and items to /ingest/orders.
- 03
Trigger a confirmation call
Queue a call with POST /ingest/orders/:id/calls, optionally choosing an agent.
- 04
Receive results
Poll GET /ingest/calls/:id or receive a webhook when the call completes.
Create order — request body
POST https://api.orderconfirm.io/api/v1/ingest/orders
| Field | Type | Description |
|---|---|---|
| order_id | string | Your store's order reference. |
| customer_name | string | Full name of the customer. |
| customer_phone | string | E.164 phone number, e.g. +8801712345678. |
| customer_address | string | Delivery address read back during the call. |
| country | string | ISO country code, e.g. BD. |
| language | string | Spoken language: bn or en. |
| items | array | Line items: product_name, product_price, product_quantity. |
Trigger a call — available agents
POST https://api.orderconfirm.io/api/v1/ingest/orders/:id/calls — pass an optional agent_id to pick a voice.
| Agent | agent_id | Description |
|---|---|---|
| Friendly Confirmer | a0000001-0000-4000-8000-000000000001 | Warm, conversational tone. Great default for most stores. |
| Concise Confirmer | a0000002-0000-4000-8000-000000000002 | Short and to the point. Best for repeat customers. |
| Bengali Voice | a0000003-0000-4000-8000-000000000003 | Native Bangla agent for Bangladeshi customers. |
Omit agent_id to use the default agent for the order's language.
How a confirmation flows
This sequence shows the full lifecycle from creating an order to receiving the result.
Examples
Each request needs the X-API-Key header. Values below use realistic Bangladesh data.
curl -X POST https://api.orderconfirm.io/api/v1/ingest/orders \
-H "X-API-Key: ocb_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ORD-10231",
"customer_name": "Rahim Uddin",
"customer_phone": "+8801712345678",
"customer_address": "House 12, Road 5, Dhanmondi, Dhaka",
"country": "BD",
"language": "bn",
"items": [
{ "product_name": "Cotton Panjabi", "product_price": 1450, "product_quantity": 2 },
{ "product_name": "Leather Sandals", "product_price": 990, "product_quantity": 1 }
]
}'{
"order_id": "ORD-10231",
"customer_name": "Rahim Uddin",
"customer_phone": "+8801712345678",
"customer_address": "House 12, Road 5, Dhanmondi, Dhaka",
"country": "BD",
"language": "bn",
"items": [
{ "product_name": "Cotton Panjabi", "product_price": 1450, "product_quantity": 2 },
{ "product_name": "Leather Sandals", "product_price": 990, "product_quantity": 1 }
]
}{
"data": {
"id": "o1b2c3d4-0000-4000-8000-000000000abc",
"order_id": "ORD-10231",
"customer_name": "Rahim Uddin",
"customer_phone": "+8801712345678",
"customer_address": "House 12, Road 5, Dhanmondi, Dhaka",
"country": "BD",
"language": "bn",
"items": [
{ "product_name": "Cotton Panjabi", "product_price": 1450, "product_quantity": 2 },
{ "product_name": "Leather Sandals", "product_price": 990, "product_quantity": 1 }
],
"created_at": "2026-06-24T09:30:00Z"
}
}Webhooks
Instead of polling, configure a webhook URL at /app/webhook to receive call results as they happen. OrderConfirm POSTs each event to your endpoint.
| Event | Description |
|---|---|
| call.placed | The customer answered and the confirmation call is in progress. |
| call.completed | The call finished. Carries the business result, duration, and recording. |
| call.failed | The call never connected (no answer, busy, declined, or undialable). |
Every event carries the same payload schema: all of the fields below are always present, with null for values that don't apply to that event.
| Field | Type | Description |
|---|---|---|
| call_id | string | The call this event belongs to. |
| order_id | string | The order the call confirms. |
| status | string | Call lifecycle: pending | scheduled | in_progress | in_redial | completed | failed | cancelled. |
| result | string | Business outcome: pending | confirmed | rejected | failed | human_intervention_needed. |
| reason | string | null | Why the result needs attention, e.g. the agent's note on a human_intervention_needed call, not_answered, not_dialable, or max_duration_exceeded. Null when nothing needs explaining. |
| disposition | string | null | Phone response: received | rejected | busy | no_answer | unreachable. |
| duration_seconds | number | null | Talk time of the finished call. |
| recording_url | string | null | Recording of the finished call, when available. |
Verifying webhook requests
Authorization: Bearer <auth_token> header. Reject any request whose token does not match yours. POST https://your-store.com/webhooks/orderconfirm
Authorization: Bearer <your_webhook_auth_token>
Content-Type: application/json
{
"event": "call.completed",
"payload": {
"call_id": "c9f8e7d6-0000-4000-8000-000000000def",
"order_id": "o1b2c3d4-0000-4000-8000-000000000abc",
"status": "completed",
"result": "confirmed",
"reason": null,
"disposition": "received",
"duration_seconds": 74,
"recording_url": "https://recordings.orderconfirm.io/c9f8e7d6.mp3"
}
}
// Every event carries these exact fields; values that don't apply are null.
// A human_intervention_needed result always explains itself, e.g.
// "result": "human_intervention_needed",
// "reason": "customer wants to change the delivery address"