API Reference

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/v1

The typical lifecycle is: create an ordertrigger a callthe agent dials your customeryou 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_here

Step-by-step integration

  1. 01

    Get an API key

    Create a key in the dashboard and store it securely — it is shown only once.

  2. 02

    Create an order

    POST the order with customer phone and items to /ingest/orders.

  3. 03

    Trigger a confirmation call

    Queue a call with POST /ingest/orders/:id/calls, optionally choosing an agent.

  4. 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

FieldTypeDescription
order_idstringYour store's order reference.
customer_namestringFull name of the customer.
customer_phonestringE.164 phone number, e.g. +8801712345678.
customer_addressstringDelivery address read back during the call.
countrystringISO country code, e.g. BD.
languagestringSpoken language: bn or en.
itemsarrayLine 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.

Agentagent_idDescription
Friendly Confirmera0000001-0000-4000-8000-000000000001Warm, conversational tone. Great default for most stores.
Concise Confirmera0000002-0000-4000-8000-000000000002Short and to the point. Best for repeat customers.
Bengali Voicea0000003-0000-4000-8000-000000000003Native 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.

Loading diagram…

Examples

Each request needs the X-API-Key header. Values below use realistic Bangladesh data.

curl
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 }
    ]
  }'
Request — application/json
{
  "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 }
  ]
}
Response — 201 Created
{
  "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.

EventDescription
call.placedThe customer answered and the confirmation call is in progress.
call.completedThe call finished. Carries the business result, duration, and recording.
call.failedThe 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.

FieldTypeDescription
call_idstringThe call this event belongs to.
order_idstringThe order the call confirms.
statusstringCall lifecycle: pending | scheduled | in_progress | in_redial | completed | failed | cancelled.
resultstringBusiness outcome: pending | confirmed | rejected | failed | human_intervention_needed.
reasonstring | nullWhy 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.
dispositionstring | nullPhone response: received | rejected | busy | no_answer | unreachable.
duration_secondsnumber | nullTalk time of the finished call.
recording_urlstring | nullRecording of the finished call, when available.
Example webhook delivery
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"