Mark Order API

The Mark Order API records an order a lead placed outside the chat (e.g., on your website, in your store or over a call) and marks that lead as converted. TailorTalk keeps the order amount and the products bought on the lead, and adds the order to the Orders card on your Stats page.

Send one order per call. If a conversion has no order value, use the Mark Converted API instead.

API Endpoint

https://api.tailortalk.ai/api/v1/mark_order

Headers

Key Value
Authorization Agent <token>

You can find agent_token on the Developer page, under the API Keys tab. Click the eye icon to reveal it, or the copy icon to copy it.

text

Request Body

Parameter Required Description
contact_id ✅ WhatsApp number (with country code, e.g., "919876543210", a leading + is fine) or Instagram user ID of the buyer
amount ✅ Order total, greater than 0
currency ✅ Currency code, e.g., "INR" or "USD"
order_id ❌ Your own reference for the order. If you send the same order_id again for the same contact, it is recorded only once, so retries are safe
products ❌ List of products bought, each with a name and a quantity (defaults to 1)

Example Request

{
    "contact_id": "919876543210",
    "amount": 2550,
    "currency": "INR",
    "order_id": "A-1002",
    "products": [
        {"name": "Yellow Shrug With Crop Top", "quantity": 2},
        {"name": "Cotton Dupatta", "quantity": 1}
    ]
}

Response Format

The response payload is wrapped automatically under a data field with success: true:

{
    "data": {
        "message": "Order recorded.",
        "order_recorded": true
    },
    "success": true
}

If an order with the same order_id is already recorded on this lead, the order is not saved again and the response is "message": "Order already recorded." with "order_recorded": false.

Notes

  • Ensure that the agent access token is included in the request headers.
  • The contact must match a lead of this agent. If there is no lead, the request fails and nothing is recorded.
  • The lead is marked permanently converted (is_converted), the same as with the Mark Converted API. For sales leads, the lead_status is also set to converted.
  • Every order is kept, so a customer who buys again can have several orders recorded. Send a different order_id for each, or leave it out.
  • The Orders card on the Stats page shows the total and average order value of the orders recorded in the selected dates.
XLinkedIn