Skip to content

API

Customers

Recognise who you are talking to, and pick up where their last order left off.

Find a customer by phone

GET/customers?phone={phone}&recent_orders=5

The phone may be written any way — +91 98765 43210, 09876543210, 9876543210. It is matched exactly as order creation matches it, so this is the customer an order from that number would be placed for. No match is 404 not_found.

Query parameters

phonestringrequired
7–20 characters, any format.
recent_ordersinteger
How many of their latest orders to include, 1–20. Default 5.
curl "https://www.chatcom.in/api/v1/urbanchat/customers?phone=%2B919876543210&recent_orders=5" \
  -H "X-API-KEY: $UC_API_KEY"
200 OK
{
  "data": {
    "customer_id": "cmg5a9c1x0003ab12cd34ef56",
    "name": "Anjali Menon",
    "phone": "+919876543210",
    "email": "anjali@example.com",
    "city": "Kochi",
    "state": "Kerala",
    "pincode": "682016",
    "shipping_address": "12/4 MG Road, Ravipuram, Opposite the bus stop",
    "whatsapp_opted_out": false,
    "recent_orders": [
      {
        "order_id": "cmg5a9d3k0007ab12cd34ef56",
        "order_number": "SO-2627-0042",
        "order_status": "shipped",
        "status_label": "Shipped",
        "amount": "1623.30",
        "currency": "INR",
        "order_date": "2026-10-13T00:00:00.000Z",
        "external_reference": "wa-conv-8f2c1e-order-1"
      }
    ]
  }
}

Worth knowing

whatsapp_opted_outboolean
The customer asked not to receive WhatsApp messages from this company. Respect it.
recent_ordersarray
Newest first, without lines. Fetch one with GET /orders/{reference} for its items, shipment and invoice.