The ReploChat store events API lets a custom-built store, a headless checkout or a WooCommerce plugin tell ReploChat that something happened to an order. Each event runs the same WhatsApp automations as a Shopify or WooCommerce webhook: order confirmation, COD confirmation, order shipped, order cancelled and the abandoned cart reminder. This page is the complete developer reference: endpoint, authentication, every accepted field, rate limit, responses and errors.
Shopify and WooCommerce stores don't need this API. Connect them on the Integrations page and ReploChat creates the webhooks for you, as described in Connect Shopify & WooCommerce. Use the API when your store is custom-built, or when a plugin (for example a cart-recovery plugin) has to send events itself.
What the store events API can and can't do
| It can | It can't |
|---|---|
| Accept four order events and trigger the WhatsApp automation you set up for each | Send arbitrary WhatsApp messages, read chats or manage contacts. It is not a general REST API. |
| Create or update the customer as a contact and log the message in your inbox | Call your store back. A custom store's COD answer is recorded in ReploChat but not written to your system. |
Ignore retries safely (idempotent with event_id) | Push webhooks out to you. There are no outgoing webhooks. |
Before you call the API
- Make sure your plan includes store integrations. If it doesn't, every call returns
403. See pricing. - In ReploChat open Integrations → Connect a store, choose Custom store (API), give it a Name and set Country for numbers without a code (Pakistan by default). A custom store has no webhooks; it only receives events through this API.
- On the store's tab, set up each automation you want: pick the WhatsApp number and an approved template, map the template variables to order fields, turn it on and Save. An event with no active automation is logged as skipped.
- In the API keys box, type a Name (for example "Website plugin"), choose the store under Runs the automations of and click Create key.
- Copy the key straight away. It is shown once ("Copy this key now — it won't be shown again"). ReploChat keeps only a SHA-256 hash; the list shows just the first characters.
Endpoint and authentication
POST https://replochat.com/api/v1/store-events
Authorization: Bearer rpc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
- Keys start with
rpc_. Send the key as a Bearer token in theAuthorizationheader. - Responses are always JSON, including validation errors, whatever
Acceptheader you send. - Each key belongs to one store connection, so the event runs that store's automations.
- Rate limit: 120 requests per minute, counted per client IP. Above that you get
429 Too Many Requestswith aRetry-Afterheader.
Request body
The body has an event, an optional event_id and an order object.
| Field | Type | Rules and meaning |
|---|---|---|
event | string, required | One of order_placed, order_shipped, order_cancelled, abandoned_cart. |
event_id | string, optional | Up to 150 characters. Your unique id for this event, used to ignore retries. |
order.id | string/number, required | Up to 100 characters. Your order id (or cart id for abandoned carts). |
order.number | optional | Up to 64 characters. The number customers see, e.g. #1001. Falls back to order.id in messages. |
order.customer_name | string, optional | Up to 255. Used for the "Customer name" variable; "there" when empty. |
order.phone | string, optional | Up to 32. The customer's WhatsApp number. Without a usable number the event is skipped. |
order.country | string, optional | Exactly 2 letters (ISO code, e.g. PK, AE). Adds the country code to local numbers like 0300 1234567. Otherwise the store's default country is used. |
order.email | string, optional | Up to 255. Stored with the event. |
order.total | number, optional | Order total. Shown with the currency in the "Order total" variable. |
order.currency | string, optional | Up to 8, e.g. PKR, USD. |
order.items | array, optional | Up to 100 items. Each needs name (string, up to 255) and may have quantity (integer, at least 1). Used for the "Items summary" variable. |
order.payment_method | string, optional | Up to 100. cod, cash on delivery or cash_on_delivery marks the order as COD. |
order.is_cod | boolean, optional | Marks the order as cash on delivery directly. Overrides the guess from payment_method. |
order.tracking_number | string, optional | Up to 100. For order_shipped. |
order.tracking_url | URL, optional | Up to 1000. Must be a valid URL. |
order.checkout_url | URL, optional | Up to 1000. The link that brings the customer back to their cart. |
order.checkout_id | string, optional | Up to 150. Links an abandoned cart to the order that completes it. |
order.completed | boolean, optional | For abandoned_cart: true means the checkout was finished, so no reminder is sent. |
Fields not in this table are ignored.
What each event does
order_placed
Sends the Order confirmation automation. If the order is COD and the COD confirmation automation is on, the customer gets that template instead, with Confirm and Cancel buttons. When they tap one, ReploChat replies with your "Reply after Confirm" or "Reply after Cancel" text and records the answer under Recent events. Because a custom store has no API for ReploChat to call, your system is not updated; check the log or ask your team to act on it. If checkout_id matches a waiting abandoned cart, that reminder is cancelled.
order_shipped and order_cancelled
Send the Order shipped and Order cancelled automations. Include tracking_number and tracking_url on shipped events if your template uses them. If a mapped variable comes out empty and you set no fallback text, the event fails with "Missing template values".
abandoned_cart
Abandoned-cart reminders are automatic only for Shopify. WooCommerce has no abandoned-cart webhook, so a WooCommerce store (or a custom store) needs a cart-recovery plugin or script that posts abandoned_cart events to this API.
The reminder doesn't send straight away. ReploChat waits for the delay set on the Abandoned cart reminder automation, then sends it. If you don't send checkout_id, order.id is used. While the reminder waits:
- Sending the same abandoned cart again (same
event_id, or noevent_idand the sameorder.id) updates its details. Add"completed": trueto cancel it. - An
order_placedwith the samecheckout_idcancels it with "Customer completed the order".
Example: a COD order from Pakistan
curl -X POST https://replochat.com/api/v1/store-events \
-H "Authorization: Bearer rpc_your_key" \
-H "Content-Type: application/json" \
-d '{
"event": "order_placed",
"event_id": "order-1001-placed",
"order": {
"id": "1001",
"number": "#1001",
"customer_name": "Ayesha Khan",
"phone": "03001234567",
"country": "PK",
"total": 4999,
"currency": "PKR",
"items": [{ "name": "Lawn suit 3-piece", "quantity": 1 }],
"payment_method": "cod",
"checkout_id": "cart-88f2"
}
}'
Example: an abandoned cart
{
"event": "abandoned_cart",
"event_id": "cart-88f2",
"order": {
"id": "cart-88f2",
"customer_name": "Ayesha Khan",
"phone": "+923001234567",
"total": 4999,
"currency": "PKR",
"checkout_url": "https://shop.example.com/cart/88f2"
}
}
Responses
| Status | Body | Meaning |
|---|---|---|
202 | {"status":"accepted","event_id":123,"duplicate":false} | Logged and queued. event_id here is ReploChat's own id for the logged event. |
200 | {"status":"duplicate","event_id":123,"duplicate":true} | Already received, so nothing new is sent. Safe to treat as success. |
401 | {"error":"unauthenticated","message":"Missing, invalid or revoked API key."} | Check the header and the key. |
403 | {"error":"plan_limit_exceeded","message":"This workspace's plan doesn't include store integrations."} | Upgrade the plan. |
422 | {"message":"…","errors":{"order.phone":["…"]}} | A field broke a rule in the table above. |
429 | {"message":"Too Many Attempts."} | Over 120 requests a minute. Wait for Retry-After. |
Retries and duplicates
- With
event_id, the same id sent again to the same store is a duplicate, whatever the event type. Make it unique per event, e.g.order-1001-shipped. - Without
event_id, the sameeventfor the sameorder.idis a duplicate. That means you can't send twoorder_shippedevents for one order without event ids. - On a timeout or a 5xx, retry with the same body. Back off on 429.
Good to know
- Customers who replied STOP are never messaged.
- Each chat gets the store's label, and the message appears in the shared inbox like any other.
- Meta bills template messages to your own WhatsApp Business Account by category and country. ReploChat adds no markup.