Skip to Content
RateUp Documentation

External API

Call RateUp from your own systems — API keys and access, the v2 endpoints with examples, the MCP server for AI assistants, errors, retries, and moving off v1.

The External API (the partner API) lets your own systems drive RateUp: create contacts, fill audiences, launch campaigns, send WhatsApp templates, run a loyalty till, keep a POS or ERP in step with your shop and read survey responses. It is a REST API over HTTPS with JSON bodies, authenticated with an API key you create in Settings → Integrations → API Service.

The machine-readable contract is published as OpenAPI JSON: https://api.rateup.app/api/external/v2/openapi.json (and /api/external/v1/openapi.json for the legacy version). Import it into Postman, Insomnia or a client generator. A browsable reference is at api.rateup.app/reference, with v2 and v1 as separate documents. This page explains how the API behaves and shows worked examples.


Two Versions

v2 (current)v1 (legacy)
Base URLhttps://api.rateup.app/api/external/v2https://api.rateup.app/api/external/v1/{orgId}
OrganisationNamed by the key — no id in the URLIn the path
Key formatrk_live_… or rk_test_…No prefix
Test keysYesNo — v1 keys are always live
ListsCursor-pagedThe original shapes
ErrorsOne envelope everywhereOriginal shapes for business failures (see v1)
ForEvery new integrationIntegrations already built on v1

A key works on its own version only. Calling v2 with a v1 key, or v1 with a v2 key, answers 401 with a message naming the right base URL — This is a v1 key; it works on /api/external/v1/{orgId} or This is a v2 key; it works on /api/external/v2.

Both versions get the same security: keys are checked against their own organisation, feature limits are enforced, and every write accepts an Idempotency-Key.


Keys and Access

Keys are created and managed in Settings → Integrations → API Service — see Integrations → API Service for the screen itself. In short:

PropertyWhat it means
NameYour label, up to 80 characters — e.g. Production POS
API versionv2 (recommended) or v1 (legacy). Fixed once the key exists
ModeLive or Test (v2 only). Fixed once the key exists
AccessFull access, or Only selected features
ExpiryOptional. The key stops working at the end of the chosen day
Last usedWhen the key last made a request (updated at most every few minutes)

An organisation can hold 20 keys. Use one per integration, so you can rotate or revoke one without touching the others. The full key is shown once, when it is created or rotated — RateUp stores only a hash of it.

Create API key dialog with Only selected features chosen

Live and test keys

A test key (rk_test_…) works like a live one against your real data, but is refused on every route that sends a paid WhatsApp message:

  • POST /wa/templates/send, POST /wa/templates/send-with-file and POST /wa/templates/{templateId}/send/contacts
  • POST /campaigns/{campaignId}/send
  • POST /loyalty/members/card/send
  • In Commerce: POST /commerce/orders/{number}/payment-link, PATCH /commerce/orders/{number}/fulfillment, POST /commerce/orders/{number}/shipments, POST /commerce/orders/{number}/complete and POST /commerce/orders/{number}/invoice/send

There the answer is 403 test_key_not_allowed — "Test keys cannot send WhatsApp messages; use a live key". Everything else, including contact writes and loyalty points, really happens with a test key: test mode is about not spending money, not a sandbox.

Three commerce writes message the customer only when you ask them to, so a test key can call them with the message turned off: POST /commerce/orders with "send": "none", POST /commerce/sales without sendReceipt, and POST /commerce/orders/{number}/cancel with "notify": false (notify is true by default, so a test key must send it). With the message on, a test key gets 403 test_key_not_allowed — "Test keys cannot send WhatsApp messages; use a live key, or send nothing".

Limiting a key to features

A key with Full access can call every endpoint, including ones added later. A key limited to Only selected features can call only the endpoints in those features:

FeatureCoversPermissions behind it
ContactsContacts and audiences, including contact identitiescontacts.read, contacts.manage
Merge contactsMerging two contacts into one (POST /contacts/{contactId}/merge)contacts.merge
TeamsListing teams, to route sendsteams.read
CampaignsCreating and sending campaigns, reading their responsescampaigns.read, campaigns.manage, campaigns.send
SurveysSurveys and their responsessurveys.read
WhatsApp messagingSending approved templates, reading message statustemplates.read, inbox.read, inbox.reply
LoyaltyMembers, points, rewards and vouchersloyalty.read, loyalty.cashier
Commerce"Read products, stock and orders; move stock; create orders, send payment links and update orders. For a POS or ERP." Also counter sales, returns and checking a couponcommerce.read, commerce.sell, commerce.orders.manage
Products"Create and edit products, variants and prices." Also collections, images and stock movescommerce.read, commerce.products.manage
Refunds"Refund orders and returns, through the payment gateway or as cash. Money leaves your account."commerce.payments.manage
Coupons"Create, edit and delete coupon codes."commerce.read, commerce.discounts.manage
Webchat widgetOnly the support widget on your website — its chat socket and /api/support/*. No endpoint on this pagewidget.connect

Merge contacts is separate from Contacts because a merge deletes a contact for good. A key limited to Contacts cannot merge until you add Merge contacts to it; a Full access key can.

The shop is split the same way. Commerce is what a till or order desk needs; it cannot change the catalogue, so a till key can book its sales without being able to edit products. Products edits the catalogue. Refunds is on its own because the money cannot be called back: a key with Commerce cannot refund until you add Refunds. Refunds alone cannot read orders, so give it together with Commerce. Stock moves (/commerce/inventory/adjust, /set and /bulk) are open to a key with either Commerce or Products.

POST /wa/templates/{templateId}/send/contacts is open to a key with either WhatsApp messaging or Campaigns.

Webchat widget is for the key you put in the support widget. That key ships in your web page, so anyone can read it: a key with only Webchat widget opens no endpoint here, and the widget refuses a key limited to other features (403 — "This API key cannot run the webchat widget"). A Full access key still runs the widget.

A call outside the key's features answers 403 insufficient_scope, with the missing permission in details.permission:

{
  "error": {
    "code": "insufficient_scope",
    "message": "This API key lacks the campaigns.send scope",
    "details": { "permission": "campaigns.send" },
    "requestId": "req-1x9k"
  }
}

A key created before features existed may have been limited to individual permissions; the keys table shows it as Custom permissions until you edit and save it.

A key is organisation-wide: it is not limited by team or channel, whatever the person who created it can see. Full access reaches every contact, conversation and loyalty balance in the organisation. Keep keys on your server — never in a browser, a mobile app or a repository — and give each integration only the features it needs.

Rotating and revoking

ActionEffect
RotateIssues a new key with the same name, version, mode and access. The old key keeps working for the grace period you pick — Immediately, After 1 hour, After 24 hours or After 7 days — then stops
RevokeDeletes the key. Requests using it are refused straight away
EditChanges the name or access. The key's value stays the same; changes apply at once

A key that has already been rotated cannot be rotated again — rotate its replacement. An expired key cannot be rotated; create a new one.


Authenticate

Send the key as a bearer token on every request:

curl "https://api.rateup.app/api/external/v2/loyalty/ping" \
  -H "Authorization: Bearer $RATEUP_API_KEY"

There is no session and no refresh. A key is valid until it expires, is rotated out or is revoked.

AnswerCause
401 unauthorized — "Send your API key as Authorization: Bearer rk_live_…"No Authorization header, or no token in it
401 unauthorized — "Invalid access token"Wrong key, revoked, expired, or past its rotation grace period
401 unauthorized — "This is a v1 key…" / "This is a v2 key…"Key from the other version
403 org_suspendedThe RateUp account is suspended; its keys stop working too
403 insufficient_scopeThe key's features do not include this endpoint
403 test_key_not_allowedA test key on a paid send

How Every Request Behaves

Errors

Every v2 error has the same envelope:

{
  "error": {
    "code": "insufficient_points",
    "message": "Insufficient points. Required: 500, Available: 320",
    "details": { "required": 500, "available": 320 },
    "requestId": "req-3b"
  }
}

Branch on code, show message to a person, and quote requestId when you contact support. The HTTP status means what it says: a 4xx is something about your request or the organisation's state, a 5xx is RateUp's problem.

StatusCodes
400validation_failed (with details.issues[] — path and message per problem), phone_invalid, card_code_invalid, member_ref_invalid, idempotency_key_invalid, idempotency_key_required, cursor_invalid, file_invalid
401unauthorized
403insufficient_scope, test_key_not_allowed, org_suspended, subscription_required, subscription_expired, campaign_credits_exhausted
404not_found, contact_not_found, contact_group_not_found, team_not_found, campaign_not_found, survey_not_found, template_not_found, message_not_found, identity_not_found, program_not_found, member_not_found, reward_not_found, voucher_not_found, product_not_found, sku_not_found, order_not_found, collection_not_found, return_not_found, discount_not_found, invoice_not_issued
409contact_already_exists, identity_in_use, last_identity, contact_group_already_exists, already_exists, member_already_exists, campaign_send_in_progress, reward_already_assigned, reward_already_redeemed, voucher_already_redeemed, voucher_not_approved, reward_in_use, idempotency_key_reused, request_in_progress, sku_ambiguous, product_managed_elsewhere, conflict
422insufficient_points, redemption_rules_violated, reward_out_of_stock, program_not_active, member_not_active, invalid_amount, template_not_approved, template_not_sendable, contact_limit_reached, campaign_incomplete, no_recipients, marketing_messages_not_onboarded, send_failed (WhatsApp refused the message), and for commerce insufficient_stock, out_of_stock, discount_invalid, payment_unavailable, payment_failed, checkout_expired, order_limit, invalid
429rate_limited
502send_failed — WhatsApp could not be reached; details.retryable is true
503internal_error "Temporarily unavailable" on a send whose rate limiter could not be checked; send_failed when a campaign could not be queued
500internal_error — the real error is logged against the requestId

Pagination

v2 lists are cursor-paged, newest first:

curl "https://api.rateup.app/api/external/v2/contacts?limit=100" \
  -H "Authorization: Bearer $RATEUP_API_KEY"
{ "data": [ … ], "nextCursor": "MjAyNi0xMC0xNlQwOToz…" }
ParameterRule
limit1–100, default 50
cursorThe nextCursor from the previous page. Opaque — pass it back, never build one. A cursor RateUp did not issue is 400 cursor_invalid
nextCursornull on the last page

Rows created while you page neither repeat nor go missing.

The loyalty member and transaction lists are the exception. GET /loyalty/members and GET /loyalty/points/transactions take page (from 1) and limit (1–100, default 20) and answer { data, pagination: { page, limit, total, totalPages } }.

Retries and the Idempotency-Key header

Every write (POST, PUT, PATCH, DELETE) accepts an optional Idempotency-Key header. It is your choice per request:

  • With a key, the first answer is stored for 24 hours. Sending the same key and the same body again returns that stored answer with the header Idempotent-Replay: true, and nothing is done twice.
  • Without a key, the request simply runs. A retry runs again.

Always send an Idempotency-Key on sends and loyalty writes. Without one, a retry after a timeout sends the WhatsApp message again, launches the campaign again, or awards the points twice. Use a fresh UUID per operation, or something derived from your own record such as shopify:mystore:1042.

SituationAnswer
Key is not 8–200 characters of A-Z a-z 0-9 _ . : @ -400 idempotency_key_invalid
Same key, different body, same endpoint409 idempotency_key_reused
Same key while the first request is still running409 request_in_progress, with Retry-After: 1
The first request failed (any non-2xx)The key is released — fix the problem and retry with the same key

Keys are scoped per organisation and per endpoint. For loyalty awards the key is also written to the points ledger, so an award with a reused key comes back with replayed: true and the balance untouched — and you can look a lost write up with GET /loyalty/points/transactions?idempotencyKey=….

Phone numbers

v2 phone numbers are digits with the country code and no + — "919876543210", the same shape v1 uses. Send them as a string or as a JSON number (919876543210). A leading + and spaces, brackets, dots or dashes are tolerated and stripped, so "+91 98765-43210" also works. A number without its country code is refused with 400 validation_failed.

Every response carries phones the same way: digits only, country code first, no +.

Customers without a phone number

A WhatsApp customer who uses a WhatsApp username can message you without sharing their phone number. Their contact then has phone: null and a businessScopedUserId instead — WhatsApp's business-scoped user ID (BSUID), such as "US.13491208655302741918". To send them a template, pass the BSUID as phone exactly as you received it. Template sends to contacts (/wa/templates/{templateId}/send/contacts) and campaigns use it automatically. Authentication (one-time code) templates cannot be sent to a BSUID; WhatsApp refuses them.

Loyalty endpoints are more forgiving: a member's phone may also be local to the programme's country (9876543210 on an Indian programme). Digits are read as including a country code first, and as a local number only when that is not a valid number.

Rate limits

LimitCeiling
Any request, per IP address (checked before the key)300 a minute
Any request, per organisation, across both versions1,200 a minute
Contact writes · audience writes300 a minute each
POST /contacts/bulk · POST /audiences/{id}/contacts/import30 a minute each
Campaign writes120 a minute
POST /campaigns/{id}/send10 a minute
POST /wa/templates/send and /send-with-file (shared)600 a minute
POST /wa/templates/{id}/send/contacts30 a minute
Every loyalty request600 a minute
POST /loyalty/members60 an hour, and 3 a day per phone number
POST /loyalty/members/card/send30 an hour
Every commerce request · commerce writes600 a minute · 300 a minute
POST /commerce/sales300 a minute
POST /commerce/orders300 an hour
POST /commerce/orders/{number}/payment-link · /invoice/send120 an hour each
POST /commerce/orders/{number}/refund · /commerce/returns/{id}/refund (shared)60 an hour
POST /commerce/inventory/bulk · /commerce/reports/sales60 a minute each
POST /commerce/products/bulk-upsert · /commerce/variants/prices/bulk30 a minute each
POST /commerce/products/{productRef}/images · /republish120 an hour each

Over a limit the answer is 429 rate_limited. The limits on sends, enrolments, new shop orders and refunds fail closed: if RateUp cannot check them, the request is refused with 503 rather than let through. Back off and retry — with the same Idempotency-Key.

Plan requirements

Campaign endpoints need a subscription that includes WhatsApp campaigns, loyalty endpoints a subscription with loyalty, and commerce endpoints a subscription with Commerce ("Commerce is not included in this subscription"); otherwise 403 subscription_required. An expired subscription blocks writes with 403 subscription_expired; reads keep working. Loyalty writes also need the programme to be active (422 program_not_active).


v2 Endpoints

All paths below are relative to https://api.rateup.app/api/external/v2.

Contacts

Feature: Contacts.

Method & pathDoes
GET /contactsList contacts. Filters: search (name, email or phone digits), labelId, contactGroupId
GET /contacts/lookup?kind=&value=Find one contact by any identity — phone, email, BSUID, Instagram or Messenger id, your own id (see Find a contact by any identity). ?phone= still works
GET /contacts/{contactId}Get a contact, with its identities
POST /contactsCreate a contact. Runs the organisation's contact-created automations
POST /contacts/bulkCreate up to 1,000 contacts. No automations run
PATCH /contacts/{contactId}Change only the fields you send
DELETE /contacts/{contactId}Delete the contact and its conversation history
GET /contacts/{contactId}/identitiesList the contact's identities
POST /contacts/{contactId}/identitiesAdd a phone, email or your own id to the contact
DELETE /contacts/{contactId}/identities/{identityId}Remove one identity
POST /contacts/{contactId}/mergeMerge another contact into this one. Feature: Merge contacts

Create a contact

curl -X POST "https://api.rateup.app/api/external/v2/contacts" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "919876543210",
    "name": "Priya Shah",
    "email": "[email protected]",
    "externalId": "crm-4821",
    "customFields": { "city": "Pune" },
    "labels": ["7a1c2e4b-0d3f-4b8e-9a51-2f6d8c3e1b07"]
  }'
{
  "id": "3f6c1d2a-8b4e-4f0a-9c7d-1e2b3a4c5d6e",
  "name": "Priya Shah",
  "phone": "919876543210",
  "businessScopedUserId": null,
  "whatsappUsername": null,
  "email": "[email protected]",
  "externalId": "crm-4821",
  "source": "external",
  "consent": true,
  "labels": [{ "id": "7a1c2e4b-0d3f-4b8e-9a51-2f6d8c3e1b07", "name": "VIP" }],
  "customFields": { "city": "Pune" },
  "createdAt": "2026-10-16T09:30:00.000Z"
}
FieldRule
phoneRequired on create. Digits with the country code, no + (see Phone numbers)
externalIdYour own id. Unique within the organisation
customFieldsAn object keyed by the custom field's slug (see Custom Fields). An unknown slug is 400 validation_failed — "Unknown custom field"
labelsLabel ids. An id that is not the organisation's is "Unknown label"

A phone or externalId already in use answers 409 contact_already_exists with details.contactId and details.field, so a retried create is harmless.

On PATCH, customFields merge into the contact's values (send null for a field to remove it), labels replace the contact's labels ([] removes them all), and email or externalId set to null clears them.

POST /contacts/bulk takes { "contacts": [ … ] } and always answers 200:

{
  "created": [ { "id": "…", "phone": "919876543210", … } ],
  "skipped": [ { "index": 3, "phone": "919812345678", "reason": "already_exists" } ]
}

reason is already_exists or duplicate_in_request; index is the row's position in your array.

Contact identities

One person can reach a business several ways: two phone numbers, an email, a WhatsApp business-scoped user ID (BSUID) when they message with a username instead of a phone, an Instagram account, a Facebook Page conversation, or an id in your own system. Each of these is an identity on the contact, and a contact can hold any number of each.

kindvalueScope
PHONEDigits with the country code, no +Organisation
EMAILLowercasedOrganisation
WA_BSUIDThe business-scoped user ID (BSUID), e.g. US.13491208655302741918Organisation
IG_SCOPEDThe Instagram-scoped user IDOne Instagram account (channelId)
FB_PSIDThe Page-scoped user IDOne Facebook Page (channelId)
WEBCHATThe website widget's visitor idOne widget (channelId)
EXTERNALAn id in another systemOne integration, e.g. shopify or my-crm

GET /contacts/{contactId}, the lookup and the merge return the contact with its identities; lists (GET /contacts, audience members) do not, to stay one query per page — call GET /contacts/{contactId}/identities when you need them.

{
  "id": "3f6c1d2a-8b4e-4f0a-9c7d-1e2b3a4c5d6e",
  "name": "Priya Shah",
  "phone": "919876543210",
  "businessScopedUserId": "IN.20781945361027384",
  "email": "[email protected]",
  "…": "…",
  "identities": [
    {
      "id": "a1b2c3d4-0000-4000-8000-000000000001",
      "kind": "PHONE",
      "value": "919876543210",
      "channelId": null,
      "integration": null,
      "source": "INBOUND",
      "verified": true,
      "primary": true,
      "username": null,
      "displayName": "Priya",
      "lastSeenAt": "2026-11-04T10:12:00.000Z",
      "createdAt": "2026-10-16T09:30:00.000Z"
    },
    {
      "id": "a1b2c3d4-0000-4000-8000-000000000002",
      "kind": "EXTERNAL",
      "value": "cus_8812",
      "channelId": null,
      "integration": "shopify",
      "source": "IMPORT",
      "verified": true,
      "primary": true,
      "username": null,
      "displayName": null,
      "lastSeenAt": "2026-11-05T08:00:00.000Z",
      "createdAt": "2026-11-05T08:00:00.000Z"
    }
  ]
}
  • primary marks the identity shown as the contact's phone, email or businessScopedUserId; the others are extra ways to reach and find the same person.
  • verified is true when the platform issued the id (an inbound message) or the customer proved it, and false for one someone typed in.
  • source is where it came from: INBOUND (a message), META_LINK (Meta linked a BSUID and a phone), HANDOFF (a signed link the customer followed), CUSTOMER (they typed it in a Journey or form), AGENT (staff added it or merged it in), IMPORT (CSV, an integration or this API).
  • channelId is the channel a per-channel id belongs to; for other kinds it is the channel the identity was last seen on, or null.

Identities recorded before contact identities existed are filled in from each contact's phone, email and platform ids by a one-time backfill; until then a contact may list none, but the lookup still finds it.

Add an identity

Only PHONE, EMAIL and EXTERNAL can be added; platform ids (BSUID, Instagram, Messenger, webchat) only ever come from the platform. EXTERNAL needs integration.

curl -X POST "https://api.rateup.app/api/external/v2/contacts/3f6c1d2a-8b4e-4f0a-9c7d-1e2b3a4c5d6e/identities" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7" \
  -d '{ "kind": "EXTERNAL", "value": "cus_8812", "integration": "shopify" }'

Answers 201 with the identity, or 200 when the contact already had it. The first phone or email a contact gets becomes its phone or email; later ones are added as extra identities.

When another contact already has that phone, email or id, nothing is moved and the answer is 409 identity_in_use with that contact's id — merge the two if they are the same person:

{
  "error": {
    "code": "identity_in_use",
    "message": "Another contact already has that identity",
    "details": { "contactId": "9d8e7f60-1a2b-4c3d-8e9f-0a1b2c3d4e5f" },
    "requestId": "req-7f2a"
  }
}

A clash on a phone or email also shows up in the dashboard as a duplicate to review.

Remove an identity

DELETE /contacts/{contactId}/identities/{identityId} answers { "id": "…", "deleted": true }. Removing the primary phone or email promotes the next one of that kind, or clears the field. A contact's last identity cannot be removed (409 last_identity) — delete the contact instead.

Find a contact by any identity

curl "https://api.rateup.app/api/external/v2/contacts/lookup?kind=WA_BSUID&value=IN.20781945361027384" \
  -H "Authorization: Bearer $RATEUP_API_KEY"
Parameter
kind + valueThe identity to match exactly. A PHONE value is normalised like every phone (+91 98765-43210 → 919876543210), an EMAIL is matched case-insensitively
phoneShorthand for kind=PHONE&value=…, as before. Send either phone or kind and value
channelIdIG_SCOPED, FB_PSID, WEBCHAT: only an id recorded on this channel
integrationEXTERNAL: only an id from this system. Without it, any integration's id matches, and so does the contact's externalId

It finds a merged contact by any of its phones, emails or ids, not only the ones shown on the contact, and answers the contact with its identities, or 404 contact_not_found.

Merge two contacts

When two contacts are the same person — a customer who wrote from a username (BSUID only) and later from their phone, or the same shopper on WhatsApp and Instagram — merge one into the other. Feature: Merge contacts (contacts.merge).

curl -X POST "https://api.rateup.app/api/external/v2/contacts/3f6c1d2a-8b4e-4f0a-9c7d-1e2b3a4c5d6e/merge" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 0b8c2f3e-5d1a-4e7b-9c6f-2a4d8e1b3c5f" \
  -d '{
    "sourceContactId": "9d8e7f60-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
    "fieldChoices": { "name": "source", "customFields": { "city": "source" } }
  }'

The contact in the path is kept; sourceContactId is merged into it and deleted:

  • every identity moves over (the kept contact's phone, email and BSUID stay primary);
  • conversations, messages, calls, notes, orders and survey responses move over;
  • labels, audiences and assignees are combined;
  • where both have a value and they differ, the kept contact's wins unless fieldChoices says "source"; a blank on the kept contact is filled from the source. fieldChoices takes name, email, address, dob, gender, notes, lifecycleId, and customFields keyed by slug;
  • in a loyalty programme both belong to, the larger account (higher balance, then older) is kept.

Answers 200 with the kept contact and its identities, and fires the contact.merged webhook. A merge cannot be undone. Merging a contact into itself is 400 validation_failed; a contact that is not found — including a source that was already merged — is 404 contact_not_found with its id in details.contactId, so a retry without an Idempotency-Key does no harm. Merges are limited to 30 a minute per organisation.

Audiences

Feature: Contacts.

Audiences were called contact groups before. In v2 they live at /audiences. The field names keep the old spelling: the path parameter is contactGroupId, campaigns take contactGroupIds, contacts filter on contactGroupId, and the error codes are contact_group_not_found and contact_group_already_exists.

Method & pathDoes
GET /audiencesList audiences. Filters: search, teamId, type (NORMAL or LOYALTY)
POST /audiencesCreate an audience: name, teamId, optional icon and tags
GET /audiences/{contactGroupId}An audience with its memberCount
PATCH /audiences/{contactGroupId}Change name, icon or tags (null clears icon or tags)
DELETE /audiences/{contactGroupId}Delete the audience and its memberships — the contacts stay. Answers 204
GET /audiences/{contactGroupId}/contactsThe audience's contacts, newest first
POST /audiences/{contactGroupId}/contactsAdd up to 1,000 existing contacts by id
POST /audiences/{contactGroupId}/contacts/removeRemove up to 1,000 contacts by id. The contacts are not deleted
POST /audiences/{contactGroupId}/contacts/importUp to 1,000 contacts by phone: unknown numbers are created, known ones reused unchanged, all are added

Audience names are unique within a team — a clash is 409 contact_group_already_exists.

Import contacts into an audience

curl -X POST "https://api.rateup.app/api/external/v2/audiences/$AUDIENCE_ID/contacts/import" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: import-2026-10-16-batch-1" \
  -d '{
    "contacts": [
      { "phone": "919876543210", "name": "Priya Shah" },
      { "phone": "14155552671", "customFields": { "city": "Austin" } }
    ]
  }'
{
  "created": 1,
  "existing": 1,
  "added": 2,
  "alreadyMembers": 0,
  "contacts": [
    { "phone": "919876543210", "contactId": "3f6c…", "status": "existing", "reason": null },
    { "phone": "14155552671", "contactId": "9b2e…", "status": "created", "reason": null }
  ]
}

A row that could not be resolved has status: "failed" and a reason such as external_id_conflict. Adding by id answers { "added", "alreadyMembers", "notFound": [ids] }; removing answers { "removed" }.

Teams

Feature: Teams.

Method & pathDoes
GET /teamsList teams — { "data": [{ "id", "name" }], "nextCursor" }

A team id is what campaigns and audiences belong to, and what a template send can be attributed to.

Campaigns

Feature: Campaigns. Needs a plan with WhatsApp campaigns.

Method & pathDoes
GET /campaignsList campaigns. Filters: status, type, teamId
GET /campaigns/{campaignId}The campaign, its audiences (contactGroupIds), drip stages, recipient count and latest send
POST /campaignsCreate a campaign as a DRAFT, with its recipients
POST /campaigns/{campaignId}/sendLaunch it now or at scheduledAt. Paid — live keys only
GET /campaigns/{campaignId}/responsesResponses to the WhatsApp Flow on the campaign's template
DELETE /campaigns/{campaignId}Delete it in any state; anything queued or scheduled is cancelled first

Create, then send

curl -X POST "https://api.rateup.app/api/external/v2/campaigns" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Diwali offer",
    "type": "WHATSAPP",
    "teamId": "c1d2…",
    "templateId": "0e9f…",
    "dynamicTags": ["name"],
    "contactGroupIds": ["5a6b…"]
  }'
FieldRule
typeWHATSAPP or DRIP
templateIdRequired for WHATSAPP
dripStagesRequired for DRIP: 1–20 of { templateId, delay, delayUnit: "minutes" | "hours" | "days", sendAtTime?: "HH:mm" }
dynamicTagsTemplate variable mappings, in {{1}}, {{2}} order
contactGroupIds, contactIdsThe recipients: audience ids and individual contact ids — up to 1,000 of each

The status cannot be set; a campaign starts as a draft. Then:

curl -X POST "https://api.rateup.app/api/external/v2/campaigns/$CAMPAIGN_ID/send" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: diwali-offer-launch" \
  -d '{ "scheduledAt": "2026-10-20T10:00:00+05:30", "dailySendLimit": 5000 }'
{
  "campaignId": "8c7d…",
  "campaignStatus": "SCHEDULED",
  "send": {
    "id": "f1e2…",
    "attemptNo": 1,
    "trigger": "MANUAL",
    "status": "SCHEDULED",
    "targetStatuses": ["PENDING"],
    "scheduledFor": "2026-10-20T04:30:00.000Z",
    "startedAt": null,
    "completedAt": null,
    "createdAt": "2026-10-16T09:31:00.000Z",
    "totals": { "targeted": 1200, "sent": 0, "delivered": 0, "read": 0, "failed": 0, "completed": 0 }
  }
}

The send answers 202. An empty body means send to every pending recipient, now.

Body fieldRule
sendToStatusesWhich recipients to (re)send to. Default ["PENDING"]; e.g. ["FAILED"] retries failures
scheduledAtISO 8601 with offset, in the future. Not allowed for a DRIP
dailySendLimitSpread recipients across days, at most this many a day

A DRIP campaign is started instead, and send is null — its stages go out on their own delays.

RefusalMeaning
409 campaign_send_in_progressIt is already queuing or sending
422 campaign_incompleteNo template, or a drip with no stages
422 no_recipientsNobody with those statuses
403 campaign_credits_exhaustedThis month's campaign credits are used up
422 marketing_messages_not_onboardedA marketing template would send from a WhatsApp Business Account not yet set up for Meta's Marketing Messages API (details.wabaIds)
503 send_failedIt could not be queued — retry with the same key

Stopping or pausing a campaign, and re-sending to named participants, are dashboard-only — see Campaign Details.

WhatsApp templates

Feature: WhatsApp messaging. Sends are paid — live keys only.

Method & pathDoes
GET /wa/templatesList templates. Filters: templateType, status (Meta's review status)
POST /wa/templates/sendSend an approved template by name to one phone number
POST /wa/templates/send-with-fileThe same, uploading the header media as multipart/form-data
POST /wa/templates/{templateId}/send/contactsSend to up to 1,000 contacts by id (feature WhatsApp messaging or Campaigns)
GET /wa/templates/messages/{messageId}/statusDelivery status of a message a send returned

Send a template

curl -X POST "https://api.rateup.app/api/external/v2/wa/templates/send" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1042-shipped" \
  -d '{
    "templateName": "order_shipped",
    "language": "en_US",
    "phone": "919876543210",
    "header": { "type": "image", "link": "https://cdn.example.com/banner.jpg" },
    "bodyVariables": ["Priya", "1042"]
  }'
{ "status": "accepted", "messageId": "wamid.HBgMOTE5ODc2NTQzMjEw…" }
FieldRule
templateNameThe approved template's name
languagee.g. en_US. Required when the template exists in several languages
phoneDigits with the country code, no + — 919876543210. Or a contact's businessScopedUserId (see Customers without a phone number)
headerOptional { type: "image" | "video" | "document", link, filename? }. Overrides the template's default media. link must be public — WhatsApp fetches it
bodyVariablesValues for the body's {{1}}, {{2}}, … in order. Leave it out if the body has no variables
buttonVariableThe dynamic part of a URL button, or a copy-code button's code
quickReplyPayloadOne payload per quick-reply button, in the template's button order
teamId, tagOptional — attribute the send to a team, label it for reporting
scheduleInMinutesSend later: 15 to 43,200 (30 days). The answer is then { "status": "scheduled", "scheduleId", "scheduledAt" }

Authentication (OTP) templates: pass the code once, as the first body variable. For a copy-code button RateUp reuses the first body variable as the button's value — do not set buttonVariable. Generate and expire the code in your system; the API only delivers it.

Send with an uploaded file

curl -X POST "https://api.rateup.app/api/external/v2/wa/templates/send-with-file" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Idempotency-Key: invoice-1042" \
  -F "templateName=invoice_ready" \
  -F "phone=919876543210" \
  -F "headerType=document" \
  -F "filename=Invoice-1042.pdf" \
  -F 'bodyVariables=["Priya","1042"]' \
  -F "file=@/path/to/invoice-1042.pdf"

Send every text field before the file. The file is streamed to WhatsApp as it arrives, so a field after it is refused. The Idempotency-Key cannot cover the file's contents — use a fresh key for every distinct send.

Header typeSize limitFormats
image5 MBJPEG, PNG
video16 MBMP4, 3GPP
document100 MB—

headerType is required with a file. bodyVariables and quickReplyPayload may be a JSON array (["Ann","500"]) or the same field repeated; a single plain value is a one-item list.

Send to contacts

{
  "contactIds": ["3f6c…", "9b2e…"],
  "bodyVariables": ["Weekend sale"],
  "header": { "type": "image", "link": "https://cdn.example.com/sale.jpg" }
}

It answers once every send has been tried:

{
  "sent": [{ "contactId": "3f6c…", "messageId": "wamid.…" }],
  "failed": [{ "contactId": "9b2e…", "code": "contact_limit_reached", "metaCode": null }],
  "skipped": [{ "contactId": "77aa…", "reason": "no_phone" }]
}

no_phone means the contact has neither a phone number nor a businessScopedUserId (BSUID).

Check delivery

{
  "messageId": "wamid.…",
  "status": "delivered",
  "createdAt": "2026-10-16T09:32:00.000Z",
  "sentAt": "2026-10-16T09:32:01.000Z",
  "deliveredAt": "2026-10-16T09:32:03.000Z",
  "readAt": null,
  "failedAt": null,
  "error": null
}

status is pending, sent, delivered, read or failed. Prefer the message.status webhook to polling.

Send failureMeaning
422 template_not_approved / template_not_sendableThe template cannot be sent as it stands (details.reason)
422 contact_limit_reachedThis month's active-contact allowance is used up — see Billing
422 send_failedWhatsApp refused it. details.metaCode, details.metaSubcode and details.retryable say why
502 send_failedWhatsApp could not be reached. Retry with the same key

Surveys

Feature: Surveys.

Method & pathDoes
GET /surveysWeb, WhatsApp and WhatsApp Flow surveys. Filter: type (web, whatsapp, waFlow)
GET /surveys/{surveyId}The survey and its questions (titles keyed by language code)
GET /surveys/{surveyId}/responsesResponses, newest first, across every team the survey is shared with
{
  "data": [
    {
      "id": "d4c3…",
      "createdAt": "2026-10-16T08:12:00.000Z",
      "teamId": "c1d2…",
      "language": "en",
      "tag": null,
      "phone": "919876543210",
      "encrypted": false,
      "encryptedAnswers": null,
      "answers": [
        { "questionId": "q1", "type": "rating", "title": "How was your visit?", "value": 5 }
      ]
    }
  ],
  "nextCursor": null
}

When the organisation encrypts responses, encrypted is true, answers is empty and encryptedAnswers carries the ciphertext for you to decrypt with your own key.

Loyalty

Feature: Loyalty. Needs a plan with loyalty. Members are named by phone or card code, never by id: send exactly one of phone or cardCode (a query parameter on reads, a member object on writes). A card code may be bare, grouped (ABC-DEF-GHJ), lower case or the card URL.

Method & pathDoes
GET /loyalty/pingChecks the key and the programme — { ok, orgId, programStatus }. Cheap to call at start-up
GET /loyalty/programCurrency wording, signup bonus and tier settings
GET /loyalty/tiers · /earning-rules · /rewards · /rewards/{rewardCode}The catalogue. Rewards and tiers are named by code and name
GET /loyalty/members/lookup?phone= or ?cardCode=Everything a till needs: balance, what they can buy, vouchers waiting, tier progress, recent history
GET /loyalty/membersPage through members. search, status, page, limit
GET /loyalty/members/preflight?phone=Whether the number is already a contact or a member
POST /loyalty/membersEnrol: phone, name, optional email, dob, gender, referralCode
PATCH /loyalty/membersUpdate a member: member plus name, email, dob, gender, status
POST /loyalty/members/card/sendSend the member's card on WhatsApp. Paid — live keys only
POST /loyalty/points/awardAward points for a purchase
POST /loyalty/points/adjustCorrect a balance (negative undoes an award). Filed for staff approval
GET /loyalty/points/transactionsThe ledger. Filters: phone, cardCode, orderId, idempotencyKey, type, from, to
POST /loyalty/rewards/{rewardCode}/issueGive a reward without charging points
POST /loyalty/rewards/{rewardCode}/redeemSpend points on a reward
GET /loyalty/vouchers/{code}Check a voucher before handing anything over
POST /loyalty/vouchers/{code}/redeemMark a voucher used

Award points for a purchase

curl -X POST "https://api.rateup.app/api/external/v2/loyalty/points/award" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: pos-store7-order-1042" \
  -d '{
    "member": { "phone": "919876543210" },
    "purchaseAmount": 1250,
    "orderId": "1042"
  }'
{
  "replayed": false,
  "transactionId": "tx_5e6f…",
  "pointsAwarded": 125,
  "balance": { "current": 845, "lifetime": 2310 },
  "rule": { "name": "Standard", "multiplier": 1, "bonusPoints": 0 },
  "tier": {
    "current": { "name": "Silver", "color": "#C0C0C0" },
    "upgraded": false,
    "next": { "name": "Gold", "threshold": 25000 },
    "amountToNext": 4800
  }
}

Spend points, then hand the voucher over

curl -X POST "https://api.rateup.app/api/external/v2/loyalty/rewards/FREE-COFFEE/redeem" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: pos-store7-redeem-883" \
  -d '{ "member": { "cardCode": "ABC-DEF-GHJ" } }'
{
  "voucherCode": "RDM-7Q2K",
  "status": "approved",
  "pointsSpent": 500,
  "balance": { "current": 345, "lifetime": 2310 },
  "expiresAt": "2026-11-15T00:00:00.000Z"
}

GET /loyalty/vouchers/{code} returns valid and, when it is false, an invalidReason — read it before handing anything over. POST /loyalty/vouchers/{code}/redeem takes optional appliedBy and notes.

RefusalMeaning
404 member_not_foundNo member with that phone or card
400 phone_invalid / card_code_invalidThe identifier itself is malformed
422 insufficient_pointsdetails carries the points required and available
422 redemption_rules_violated / reward_out_of_stockThe reward cannot be bought right now
409 voucher_already_redeemed / voucher_not_approvedThe voucher was used, or still awaits approval
409 member_already_existsThat number is already enrolled

The card send only delivers inside the member's 24-hour WhatsApp window; outside it the answer is { "sent": false, "skippedReason": "session_closed" } rather than an error.

Commerce

Features: Commerce, Products, Refunds and Coupons (see Limiting a key to features). Needs a plan with Commerce. This is what a POS, ERP or warehouse system needs to keep products, stock and orders in step with your shop. Every path starts with /commerce.

Things are named the way your own system names them:

ThingNamed by
A productIts RateUp id, or ext:<externalId> for one you created with the upsert (add ?source= if it is not pos, the only source today)
A variantIts sku, case-insensitive. A variant without a SKU is named by the id Meta's catalog knows it by (retailerId)
An orderIts store number — 1042 for order #1042
A collectionIts slug, made from its name
A couponIts code
A delivery rateIts id, from GET /commerce/store

Reads need any of Commerce, Products or Coupons; the column below names the feature a write needs.

Store

Method & pathDoesFeature
GET /commerce/pingChecks the key and names the store — { ok, orgId, store: { name, currency }, metaCatalogConnected }Read
GET /commerce/storeCurrency, tax, low-stock threshold, invoice prefix, checkout and delivery ratesRead

Products, variants and collections

Method & pathDoesFeature
GET /commerce/productsNewest first, with variants, stock and Meta catalog state. status (everything but ARCHIVED by default), search (title or SKU), collection, source, updatedSinceRead
GET /commerce/products/{productRef}One productRead
PUT /commerce/products/upsertCreate or update a product by your own externalId — 201 the first time, 200 afterProducts
POST /commerce/products/bulk-upsertUp to 100 upserts, each succeeding or failing on its ownProducts
PATCH /commerce/products/{productRef}Change only the fields you sendProducts
PATCH /commerce/products/{productRef}/statusACTIVE, DRAFT or ARCHIVED. Archived hides it everywhere, Meta included; past orders keep itProducts
POST /commerce/products/{productRef}/imagesUpload a JPEG, PNG or WebP of up to 5 MB, base64-encoded. A product holds at most 10 imagesProducts
GET /commerce/products/{productRef}/meta-statusIts Meta catalog state and, when it is not live, the reasonRead
POST /commerce/products/{productRef}/republishSend it to Meta again after fixing what Meta rejectedProducts
POST /commerce/products/{productRef}/variantsAdd a variant with its starting stock. The SKU must be newProducts
GET /commerce/variants/{sku}What a till needs after a scan: price, stock and the productRead
PATCH /commerce/variants/{sku}Price, sale price and stock settings (not the count itself)Products
DELETE /commerce/variants/{sku}Remove a variant, from Meta too. A product keeps at least oneProducts
POST /commerce/variants/prices/bulkA price list across up to 500 SKUs, each line reportedProducts
GET /commerce/collectionsEvery collection and its slugRead
POST /commerce/collections · PATCH · DELETE /commerce/collections/{slug}Create, rename (which changes the slug) or delete. Deleting keeps its productsProducts

Stock

Method & pathDoesFeature
GET /commerce/inventoryEvery variant's count. lowStock=true, outOfStock=true, updatedSinceRead
GET /commerce/inventory/{sku}One SKU's countRead
POST /commerce/inventory/adjustMove stock by delta — -2 for a sale, +50 for a delivery. Needs an Idempotency-KeyCommerce or Products
PUT /commerce/inventory/setSet the count after a stock take. Needs an Idempotency-KeyCommerce or Products
POST /commerce/inventory/bulkUp to 500 lines, each a delta or a stock, each reported. Needs an Idempotency-KeyCommerce or Products
GET /commerce/inventory/{sku}/movementsThe SKU's stock ledger, newest first. Filter by referenceRead
GET /commerce/inventory/{sku}/back-in-stockHow many customers asked to be told it is backRead

Orders

Method & pathDoesFeature
GET /commerce/ordersPlaced orders, newest first. status (DRAFT for drafts), paymentStatus, fulfillmentStatus, channel, phone, updatedSinceRead
GET /commerce/orders/{number}One orderRead
GET /commerce/customers/{phone}/ordersA customer's orders, online and at the counterRead
POST /commerce/ordersAn order the customer pays by link. Sends a link on WhatsApp unless send is none. Needs an Idempotency-KeyCommerce
POST /commerce/orders/{number}/payment-linkSend (or resend) a Razorpay or Stripe link on WhatsApp; the url comes back too, for a QR codeCommerce
POST /commerce/orders/{number}/confirm-codConfirm a cash-on-delivery order after calling the customerCommerce
POST /commerce/orders/{number}/mark-paidCash collected, transfer arrived, or paid at pickup. method: cash, bank, card, upi or manualCommerce
PATCH /commerce/orders/{number}/fulfillmentPACKED, SHIPPED, OUT_FOR_DELIVERY, DELIVERED or FAILED_DELIVERY; the customer gets the usual WhatsApp updateCommerce
POST /commerce/orders/{number}/shipmentsAdd carrier, trackingNumber, trackingUrl; the order moves to SHIPPEDCommerce
POST /commerce/orders/{number}/completeClick and collect: marks a paid order deliveredCommerce
POST /commerce/orders/{number}/cancelreason, restock (default true), notify (default true). A shipped order cannot be cancelled; start a returnCommerce
PATCH /commerce/orders/{number}/noteThe shop's own note, never shown to the customer. null clears itCommerce
POST /commerce/orders/{number}/invoiceIssue the invoice (paid orders only). The same invoice on every later callCommerce
GET /commerce/orders/{number}/invoiceA signed link to the PDF, valid for 10 minutesRead
POST /commerce/orders/{number}/invoice/sendSend the invoice on WhatsApp, issuing it first if neededCommerce
POST /commerce/orders/{number}/refundRefund without a return — all or amount, method original (back through the gateway) or cash. Needs an Idempotency-KeyRefunds

Counter sales, returns and coupons

Method & pathDoesFeature
POST /commerce/salesRecord a sale that already happened at the tillCommerce
GET /commerce/sales?reference=Find a sale by your bill numberRead
GET /commerce/returnsReturns, newest first, including those customers asked for on WhatsApp. status, orderNumberRead
POST /commerce/returnsStart a return: orderNumber, reason, items by SKU. Add receive when the goods are already in handCommerce
PATCH /commerce/returns/{id}action: approve, reject or receive (restocks unless restock: false)Commerce
POST /commerce/returns/{id}/refundRefund a return — all or amount, original or cash. Needs an Idempotency-KeyRefunds
GET /commerce/discountsUsable coupons, or every one with state=allRead
POST /commerce/discounts/{code}/validateWhether a code applies to these items (and this phone) and what it takes off. Spends nothingCommerce
POST /commerce/discounts · PATCH · DELETE /commerce/discounts/{code}Create, change or delete a coupon. A code already used is switched off instead of deletedCoupons
GET /commerce/reports/salesPaid orders in a window of at most a year, by channel, day or productRead

Keep a product in step with your POS

The upsert is the main catalogue call. Fields you leave out are kept; variants is the full list, matched by SKU — new SKUs are added, SKUs you no longer send are removed. A variant's stock is only its starting stock; after that, stock moves through /commerce/inventory.

curl -X PUT "https://api.rateup.app/api/external/v2/commerce/products/upsert" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "externalId": "TSHIRT-01",
    "title": "Classic T-shirt",
    "images": ["https://cdn.example.com/tshirt.jpg"],
    "collections": ["summer"],
    "variants": [
      { "sku": "TS-M-BLK", "title": "M / Black", "price": 799, "stock": 40 },
      { "sku": "TS-L-BLK", "title": "L / Black", "price": 799, "compareAtPrice": 999, "stock": 25 }
    ]
  }'
{
  "created": true,
  "product": {
    "id": "6b1f0c2e-…",
    "externalId": "TSHIRT-01",
    "source": "pos",
    "title": "Classic T-shirt",
    "collections": [{ "name": "Summer", "slug": "summer" }],
    "variants": [
      { "sku": "TS-M-BLK", "title": "M / Black", "price": 799, "compareAtPrice": null, "stock": 40, "available": true, … },
      …
    ],
    …
  }
}

Book stock off after a sale

curl -X POST "https://api.rateup.app/api/external/v2/commerce/inventory/adjust" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: pos-store7-bill-5521-TS-M-BLK" \
  -d '{ "sku": "TS-M-BLK", "delta": -2, "reason": "POS_SALE", "reference": "BILL-5521" }'
{ "sku": "TS-M-BLK", "tracked": true, "previousStock": 40, "stock": 38, "available": true }

reason is one of POS_SALE, POS_RETURN, RESTOCK, DAMAGE, ADJUSTMENT (the default) or SYNC; for PUT /inventory/set it is COUNT (the default), SYNC or ADJUSTMENT. A move that would take the count below 0 is refused with 422 insufficient_stock ("Only 1 in stock") unless you send allowNegative: true or the variant allows backorders. tracked: false means the variant's stock is not counted, so nothing changed. Lost the reply? Look for your reference in GET /commerce/inventory/{sku}/movements rather than retrying with a new key.

Record a counter sale

POST /commerce/sales records a sale that already happened as a paid, handed-over order: stock comes off, the coupon and points are spent, loyalty points are earned and it counts in the customer's history and in revenue. Nothing is sent to the customer unless sendReceipt is true.

curl -X POST "https://api.rateup.app/api/external/v2/commerce/sales" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "BILL-5521",
    "items": [{ "sku": "TS-M-BLK", "quantity": 2 }],
    "paymentMethod": "upi",
    "phone": "919876543210",
    "discountCode": "WELCOME10",
    "usePoints": false
  }'
{
  "replayed": false,
  "order": {
    "number": 1043,
    "reference": "BILL-5521",
    "status": "COMPLETED",
    "paymentStatus": "PAID",
    "fulfillmentStatus": "DELIVERED",
    "paymentMethod": "upi",
    "channel": "POS",
    "currency": "INR",
    "subtotal": 1598,
    "discountTotal": 159.8,
    "total": 1438.2,
    "items": [{ "sku": "TS-M-BLK", "title": "Classic T-shirt", "variantTitle": "M / Black", "quantity": 2, "unitPrice": 799, "lineTotal": 1598, … }],
    …
  },
  "receipt": null
}

reference is your bill number and is unique: sending the same one again returns the first sale with replayed: true and does nothing, so a sale needs no Idempotency-Key. unitPrice on an item overrides the product's price with what the counter charged; paymentMethod is cash (the default), card, upi, bank or other. phone links the sale to the customer and earns their points.

Do not also award points through /loyalty/points/award for a counter sale. The sale earns them already, so the customer would get them twice. When customers pay on your Shopify or WooCommerce checkout, that store keeps the stock and the answer is 409 conflict — record counter sales there.

Create an order the customer pays by link

curl -X POST "https://api.rateup.app/api/external/v2/commerce/orders" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: callcentre-ticket-8812" \
  -d '{
    "phone": "919876543210",
    "name": "Priya Shah",
    "items": [{ "sku": "TS-L-BLK", "quantity": 1 }],
    "shippingRateId": "0d4c8a7e-…",
    "send": "checkout_link"
  }'
{
  "order": { "number": 1044, "total": 878, "checkoutUrl": "https://rateup.app/c/…", … },
  "delivery": { "sent": true, "url": "https://rateup.app/c/…" }
}

send is payment_link (the default — a card or UPI link on WhatsApp), checkout_link (the checkout page, where they add their address, pick delivery and pay) or none. The order is priced at once, and its stock and coupon are held while the link is open. delivery.url is the checkout page either way, to show as a QR code or send yourself.

Refund a return

curl -X POST "https://api.rateup.app/api/external/v2/commerce/returns/3a9e…/refund" \
  -H "Authorization: Bearer $RATEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: pos-store7-return-77" \
  -d '{ "method": "cash", "note": "Refunded at the counter" }'

The answer is the return, now REFUNDED. Leave amount out to refund the return's whole refundAmount. original sends the money back through Razorpay or Stripe; cash records cash handed back at the counter.

Sales report

curl "https://api.rateup.app/api/external/v2/commerce/reports/sales?from=2026-11-01&groupBy=channel" \
  -H "Authorization: Bearer $RATEUP_API_KEY"
{
  "from": "2026-11-01T00:00:00.000Z",
  "to": "2026-11-26T09:30:00.000Z",
  "currency": "INR",
  "groupBy": "channel",
  "totals": { "orders": 212, "revenue": 184350, "refunded": 2400 },
  "rows": [
    { "key": "WHATSAPP", "label": "WhatsApp", "orders": 131, "units": null, "revenue": 112900 },
    { "key": "POS", "label": "the counter", "orders": 81, "units": null, "revenue": 71450 }
  ]
}

Orders count by when they were placed. to defaults to now; a window that ends before it starts or spans more than a year is 400 validation_failed. With groupBy=day the key is the UTC day (YYYY-MM-DD); with groupBy=product it is the product id.

What an order carries. Besides the amounts, items and shipments, an order has customFields — the customer's answers to your own checkout page questions, each { id, label, value } with the label as it was when they answered — and termsAcceptedAt, when they ticked the terms box. staffNote is the shop's own note and reviewReason says why staff must look at a paid order (stock or a coupon ran out).

RefusalMeaning
400 idempotency_key_requiredA stock move, new order or refund sent without an Idempotency-Key
404 product_not_found / sku_not_found / order_not_found / collection_not_found / return_not_found / discount_not_foundNothing by that name in this shop
404 invoice_not_issuedThe order has no invoice yet — POST /commerce/orders/{number}/invoice issues one
409 sku_ambiguousTwo variants share the SKU; details.matches lists them
409 product_managed_elsewhereThe product comes from your connected Shopify or WooCommerce store — edit it there
409 already_existsPOST …/variants with a SKU another variant has
409 conflictThe order is in the wrong state: already paid or cancelled, not a cash order waiting to be confirmed, not paid yet (for complete), or placed on your store's checkout and fulfilled there
422 insufficient_stockA stock move would go below 0; details carries the stock
422 out_of_stock / discount_invalid / payment_unavailableThe order cannot be placed or paid as asked
422 invalidThe shop's rules refused it — for example a return item not on the order, an 11th image, or removing a product's last variant

POST /commerce/orders/{number}/invoice/send answers { sent: false, reason: "window_closed" } rather than an error when there is no open WhatsApp chat with the customer: a document only delivers inside it.

What happened in the shop — orders placed, paid, cancelled or shipped, stock changes, product changes and return requests — reaches you as webhook events, so you need not poll.


MCP Server

The step-by-step setup for each assistant, Claude Code with the RateUp plugin, and the list of every tool are on the MCP Server page. In short:

The v2 API is also an MCP server, so an AI assistant — Claude, ChatGPT, Claude Code, Cursor, VS Code or any MCP client — can look up contacts, fill audiences, award points or send a template for you.

URLhttps://api.rateup.app/api/external/v2/mcp
TransportStreamable HTTP (stateless; no server-sent stream)
AuthSign in with your RateUp account (OAuth 2.1), or Authorization: Bearer rk_live_… with a v2 key

Connect with sign-in (Claude, ChatGPT)

Assistants that add servers as connectors sign you in instead of asking for a key. You need a role that can manage API keys for the whole organisation (owner or admin by default).

  • Claude (web, desktop, mobile): Settings → Connectors → Add custom connector, paste the URL, then Connect. On Team and Enterprise plans an owner adds it under Organization settings → Connectors first.
  • ChatGPT: turn on Developer mode under Settings → Apps & Connectors → Advanced, then Create a connector with the URL and OAuth authentication.
  • Claude Code: claude mcp add --transport http rateup https://api.rateup.app/api/external/v2/mcp, then run /mcp and pick Authenticate.

The assistant opens a RateUp page that names it, the organisation it will reach and what it is asking for. Untick anything you don't want it to have and press Allow access. The access is limited to the same features an API key can have, and never more than you hold yourself; it uses the organisation you are signed in to, so switch organisation in the dashboard first if you have more than one.

Connected assistants are listed under Settings → Integrations → API Service → AI assistants (MCP), with who connected them and when they were last used. Disconnect cuts one off at once. A connection also stops working when the member who made it leaves the organisation or can no longer manage API keys.

For client developers: discovery follows the MCP authorization spec — /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server on https://api.rateup.app, the authorization code flow with S256 PKCE, dynamic client registration or Client ID Metadata Documents, refresh-token rotation, and resource indicators naming the MCP URL. The scopes are the API key features (contacts, campaigns, loyalty, commerce, …) plus offline_access.

Connect with an API key

For clients that can send a header, a key works as before:

Create a key for the assistant

In Settings → Integrations → API Service, create a v2 key just for the assistant. Give it Only selected features with what it needs — a read-only Contacts key is a good start. A test key works too and cannot send paid WhatsApp messages.

Add the server to your client

Claude Code:

claude mcp add --transport http rateup https://api.rateup.app/api/external/v2/mcp \
  --header "Authorization: Bearer $RATEUP_API_KEY"

Clients configured with JSON (Cursor, VS Code and others; the exact key names vary a little):

{
  "mcpServers": {
    "rateup": {
      "type": "http",
      "url": "https://api.rateup.app/api/external/v2/mcp",
      "headers": { "Authorization": "Bearer rk_live_…" }
    }
  }
}

Each tool is one v2 endpoint — contacts_list, contacts_lookup, audiences_add_contacts, campaigns_send, templates_send, loyalty_award_points and so on. A tool takes the endpoint's path and query parameters as arguments, its JSON body as body, and on writes an optional idempotencyKey. It answers with exactly what the endpoint answers, errors included.

  • The key's (or the sign-in's) features decide the tools. The assistant is offered only the tools it may call; a test key is not offered the paid sends.
  • search and fetch find a contact, audience or product by name and read it in full, for assistants (such as ChatGPT's deep research) that look records up that way.
  • Everything else is the REST API's. Rate limits, plan requirements, validation, the error envelope and idempotency all apply unchanged, and calls show in the key's usage like any other.
  • Writes are real. An assistant that is allowed to delete, merge or send will do it. Most clients ask before running a tool that changes data; keep that on, and scope the key to what you want the assistant to touch.
  • POST /wa/templates/send-with-file is not offered: it takes a file upload, which tools cannot pass. Send media templates with a header link through templates_send instead.

Webhooks

The API is for actions; webhooks tell you what happened. There is one webhook per organisation, receiving every event you tick. It is set up in the dashboard under Settings → Integrations → Webhook, not through the API and not per API key: every key — and every integration — shares the same endpoint and secret. Among others it can deliver:

EventWhen
message.statusA new sent, delivered, read or failed status for any outbound WhatsApp message — with recipient, template, source and campaign
survey.response.createdA survey or WhatsApp Flow response is filed — in the same shape as GET /surveys/{id}/responses, plus the survey's type
flow.response.createdA WhatsApp Flow is completed — the same fields plus flow (id, metaFlowId, name, categories). A Flow also fires survey.response.created, so subscribe to one
loyalty.points.earned · loyalty.points.redeemed · loyalty.points.adjustedA ledger row moved points
contact.mergedTwo contacts were merged — from the dashboard, a signed handoff link or POST /contacts/{contactId}/merge
Shop events (orders, stock, products, returns)Under Commerce in the event list — orders and products are sent in the same shapes as the Commerce endpoints. See Integrations → Webhook for the events

contact.merged is posted like the other contact events, as { event, …fields }. contact is the contact that was kept; mergedContactId is the one merged into it, which no longer exists — repoint anything you stored against it:

{
  "event": "contact.merged",
  "contact": {
    "id": "3f6c1d2a-8b4e-4f0a-9c7d-1e2b3a4c5d6e",
    "name": "Priya Shah",
    "phone": "919876543210",
    "businessScopedUserId": "IN.20781945361027384",
    "email": "[email protected]",
    "source": "external",
    "lifecycleId": null
  },
  "mergedContactId": "9d8e7f60-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}

The other events in this table arrive in an envelope — { id, type, createdAt, orgId, data } — and are retried. Each delivery is signed with the organisation's signing secret (whsec_…, shown on the Signing secret card):

HeaderValue
X-Rateup-TimestampWhen this attempt was sent, in Unix seconds
X-Rateup-Signature-256t=<Unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">, keyed with the whole whsec_… string as shown
X-Webhook-IdThe same on every retry — drop repeats on it
X-Rateup-SignatureDeprecated: base64 HMAC-SHA256 of the body alone, kept for existing receivers

To verify: take the raw body, recompute the HMAC over <t>.<raw body>, compare it with v1 in constant time, and reject a t more than 5 minutes from your clock. Node and Python examples and a test vector are on the Integrations page.


v1 (Legacy)

v1 stays for integrations already built on it. It is mounted at https://api.rateup.app/api/external/v1/{orgId} and accepts v1 keys only — create one with API version → v1 (legacy). New work belongs on v2.

ModuleRoutes
ContactsPOST /contacts (one contact or an array), GET /contacts, GET /contacts/{contactId}, PUT /contacts/{contactId}, DELETE /contacts/{contactId}
Audiences (contact groups)POST /contact-groups, GET /contact-groups, GET /contact-groups/{id}/contacts, PUT /contact-groups/{id}, DELETE /contact-groups/{id}, POST /contact-groups/{id}/contacts/existing, POST /contact-groups/{id}/contacts/new, DELETE /contact-groups/{id}/contacts
TeamsGET /teams
CampaignsPOST /campaigns, GET /campaigns, GET /campaigns/{id}/responses, DELETE /campaigns/{id}, PUT /campaigns/{id}/send
SurveysGET /surveys, GET /surveys/{surveyId} (its responses)
WhatsApp templatesGET /wa/templates, POST /wa/templates/send, POST /wa/templates/send-with-file, POST /wa/templates/{templateId}/send/contacts, GET /wa/templates/message/{messageId}/status
LoyaltyThe same module and shapes as v2, under /loyalty

v1 is frozen at its original paths and wording: audiences are only at /contact-groups there, and its error messages still say "Contact group" (for example { "error": "Contact group not found" }). Use v2 for /audiences.

What v1 shares with v2 now:

  • Feature limits are enforced. A v1 key limited to features gets 403 insufficient_scope outside them, exactly as on v2.
  • Everything is checked against your organisation. A key only works for the orgId in its own URL, and contact writes that name another organisation's labels, groups, lifecycle stages, custom fields or users are refused with 400 instead of being saved.
  • Authentication, scope, rate-limit and idempotency failures use the v2 error envelope. A missing bearer token on v1 answers 400. Business failures from the original handlers keep their original shapes, such as { "error": "…" }.
  • Idempotency-Key works on every v1 write.

v1 read shapes to expect:

RouteAnswers
GET /contact-groupsA plain array of groups: id, name, icon (may be null), createdAt and the group's other stored fields
GET /contact-groups/{id}/contactsA plain array of stored contacts: id, createdAt, name (often null for WhatsApp contacts), phone, email, address, dob, external_id, igsId, psid, notes, lifecycleId, customFields: [{ id, value }]
POST /wa/templates/send with timeDelay{ "status", "scheduleId" } instead of the send result

v1 template sends take phone as a number (country code, no +), and body_variables on send-with-file as a JSON string — malformed JSON there is silently treated as an empty list, so the template sends with blanks.


Migrating from v1 to v2

Create a v2 key in Settings → Integrations → API Service, with only the features the integration uses. Start with a Test key if the integration sends messages.

Change the base URL from /api/external/v1/{orgId} to /api/external/v2, and the key to the new rk_… one.

Apply the field changes below, module by module.

Switch errors to the envelope — branch on error.code, not on message text or a bare { error } string.

Add Idempotency-Key to sends, campaign launches and loyalty writes.

Once it is live on a Live v2 key, revoke the v1 key.

Areav1v2
Organisation{orgId} in the pathNone — the key names it
Phone numbersNumber, no +Unchanged: digits with the country code, no +, as a string ("919876543210") or a number. A leading + is tolerated
ListsBare arrays, or page/limit on contacts{ data, nextCursor } with limit and cursor
ErrorsMixed shapes{ error: { code, message, details?, requestId } }
Contacts · your idexternal_idexternalId
Contacts · custom fieldscustomFields: [{ id, value }]customFields: { "<slug>": "value" }
Contacts · create manyPOST /contacts with an arrayPOST /contacts/bulk with { contacts }, reporting created and skipped
Contacts · updatePUT /contacts/{id}PATCH /contacts/{id} — only sent fields change
Contacts · find by phone—GET /contacts/lookup?phone=
Contacts · find by BSUID, email, Instagram/Messenger id or your id—GET /contacts/lookup?kind=&value=
Contacts · identities and merge—/contacts/{contactId}/identities, POST /contacts/{contactId}/merge
Audiences · path/contact-groups/audiences
Audiences · updatePUT /contact-groups/{id}PATCH /audiences/{id}
Audiences · add existingPOST …/contacts/existingPOST …/contacts with { contactIds }
Audiences · add newPOST …/contacts/newPOST …/contacts/import — matches by phone, creates the unknown ones
Audiences · removeDELETE …/contacts with a bodyPOST …/contacts/remove with { contactIds }
Campaigns · templatewaTemplateIdtemplateId
Campaigns · statusSettable on createAlways a DRAFT; launch with send
Campaigns · sendPUT /campaigns/{id}/sendPOST /campaigns/{id}/send — answers 202 with the send session
Campaigns · one campaign—GET /campaigns/{id}
Surveys · responsesGET /surveys/{surveyId}GET /surveys/{surveyId}/responses; GET /surveys/{surveyId} now returns the survey and its questions
Templates · variablesbody_variablesbodyVariables
Templates · schedulingtimeDelayscheduleInMinutes (15 – 43,200)
Templates · header mediaparameterData: [{ type, link, filename }]header: { type, link, filename }
Templates · send to contactsheader: { type: "header", parameters: [ … ] }header: { type, link, filename }, plus bodyVariables
Templates · sending numberfromNot available
Templates · send resultRaw send result{ status: "accepted", messageId } or { status: "scheduled", scheduleId, scheduledAt }
Templates · message statusGET /wa/templates/message/{id}/statusGET /wa/templates/messages/{id}/status
Loyalty—Unchanged — the same module serves both versions

Troubleshooting

SymptomCauseFix
401 "This is a v1 key…" on v2 (or the reverse)Key from the other versionUse the base URL the message names, or create a key for this version
401 "Invalid access token" after a rotationThe old key's grace period endedDeploy the new key; rotate with a longer grace period next time
403 insufficient_scopeThe key is limited to other featuresEdit the key's Access and add the feature in details.permission
403 test_key_not_allowedA test key on a paid sendUse a live key for sends
403 subscription_required on campaigns or loyaltyThe plan does not include that moduleUpgrade in Billing
409 idempotency_key_reusedThe same key was sent with a different bodyUse a new key per distinct operation
409 request_in_progressYou retried before the first attempt finishedWait a second and retry with the same key
A message or award happened twiceRetried without an Idempotency-KeySend one on every send and loyalty write
400 validation_failed — "Unknown custom field"The slug is not one of the organisation's custom fieldsUse the slug from Custom Fields
422 contact_limit_reachedThe month's active-contact allowance is used upSee Billing
429 rate_limitedOver a per-minute or per-hour ceilingBack off and retry with the same key
The usage chart shows nothingCalls are made with a different organisation's keyCheck the key's prefix in the keys table
The MCP client says it needs to sign in, or shows no toolsNo Authorization header in its config, or a v1 keyUse the client's sign-in, or add the header with a v2 rk_ key
The sign-in page says only some members can connect appsYour role can't manage API keys for the whole organisationAsk an owner or admin to connect it, or to change your role
An MCP tool you expected is missingThe key's features do not cover it, or it is a paid send and the key is a test keyAdd the feature to the key, or use a live key
Webhook signatures never verifyThe body was parsed and re-serialised, or the secret was trimmed or decodedSign <t>.<raw body> with the whole whsec_… string — see Verify the signature

On this page