Store Events API Reference (Custom Stores)

Developer reference for POST /api/v1/store-events: API keys, fields per event, rate limit, responses and errors for custom-built stores and plugins.

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 canIt can't
Accept four order events and trigger the WhatsApp automation you set up for eachSend 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 inboxCall 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

  1. Make sure your plan includes store integrations. If it doesn't, every call returns 403. See pricing.
  2. 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.
  3. 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.
  4. In the API keys box, type a Name (for example "Website plugin"), choose the store under Runs the automations of and click Create key.
  5. 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.
Keep the key on your server. Never put it in browser JavaScript or a mobile app. A key can only send store events, but anyone holding it could send messages to your customers through your automations. Revoke a leaked key with Revoke on the Integrations page; it stops working immediately.

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 the Authorization header.
  • Responses are always JSON, including validation errors, whatever Accept header 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 Requests with a Retry-After header.

Request body

The body has an event, an optional event_id and an order object.

FieldTypeRules and meaning
eventstring, requiredOne of order_placed, order_shipped, order_cancelled, abandoned_cart.
event_idstring, optionalUp to 150 characters. Your unique id for this event, used to ignore retries.
order.idstring/number, requiredUp to 100 characters. Your order id (or cart id for abandoned carts).
order.numberoptionalUp to 64 characters. The number customers see, e.g. #1001. Falls back to order.id in messages.
order.customer_namestring, optionalUp to 255. Used for the "Customer name" variable; "there" when empty.
order.phonestring, optionalUp to 32. The customer's WhatsApp number. Without a usable number the event is skipped.
order.countrystring, optionalExactly 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.emailstring, optionalUp to 255. Stored with the event.
order.totalnumber, optionalOrder total. Shown with the currency in the "Order total" variable.
order.currencystring, optionalUp to 8, e.g. PKR, USD.
order.itemsarray, optionalUp 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_methodstring, optionalUp to 100. cod, cash on delivery or cash_on_delivery marks the order as COD.
order.is_codboolean, optionalMarks the order as cash on delivery directly. Overrides the guess from payment_method.
order.tracking_numberstring, optionalUp to 100. For order_shipped.
order.tracking_urlURL, optionalUp to 1000. Must be a valid URL.
order.checkout_urlURL, optionalUp to 1000. The link that brings the customer back to their cart.
order.checkout_idstring, optionalUp to 150. Links an abandoned cart to the order that completes it.
order.completedboolean, optionalFor 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 no event_id and the same order.id) updates its details. Add "completed": true to cancel it.
  • An order_placed with the same checkout_id cancels 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

StatusBodyMeaning
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.
Accepted doesn't mean sent. The WhatsApp message goes out right after the response. Check the outcome under Integrations → Recent events: each event shows Sent, Scheduled, Skipped or Failed with a reason such as "No usable phone number on the order", "Customer opted out of WhatsApp messages", "No active automation for …" or the error Meta returned.

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 same event for the same order.id is a duplicate. That means you can't send two order_shipped events 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.

Related guides

Put this into action

ReploChat runs on the official WhatsApp Business API — campaigns, chatbot flows, a shared inbox, and analytics in one place.

Chat with us 👋

Sales

+92 335 5265622

Support

+92 339 4683250