# Relay plan

Transactional notifications on the shared LocalTech number.

# Relay plan

Relay is the entry tier: send **transactional notifications** (order, payment, OTP) **without connecting your own WhatsApp number**. Messages go out from the **shared LocalTech number**.

This is not a full shop: no customer catalog, no cart, no Mobile Money collection for the merchant. For a dedicated number, inbox and campaigns, move to [Starter](/docs/billing) or above.

## Who it is for

- A shop or service that wants to confirm / prepare / deliver an order over WhatsApp right away.
- A partner testing the platform before investing in a dedicated WABA.
- Moderate volume (Relay plan quota and daily cap).

## What is included

| Capability | Relay |
|---|---|
| Shared LocalTech number | yes |
| Dedicated WhatsApp number | no |
| Transactional scenarios | yes |
| Shop orders (track + notify) | yes |
| Shop documents / receipts | yes |
| Inbox | no |
| Campaigns | no |
| WhatsApp Calling | no |

The `relay`, `scenarios`, `orders` and `shop_documents` features are enforced by the API (`402 plan_feature_required` otherwise). Quotas are detailed under [Subscription and quotas](/docs/billing).

## Portal

After sign-up and a Relay subscription (or during the trial), the portal **Relay** menu offers:

1. **Scenarios** — send a scenario (e.g. order confirmed) to a phone number.
2. **Orders** — create an order, change status, notify the customer.
3. **Documents** — generate and send a receipt / invoice linked to an order.

## API

Requirements: an [API key](/docs/authentication) and a [company](/docs/conventions) (`companyId`). No `connectionId`: the platform number is chosen server-side.

### List scenarios

```bash
curl https://hira.localtechstudio.com/api/v1/relay/scenarios \
  -H "Authorization: Bearer pk_live_..."
```

### Send a scenario

```bash
curl -X POST https://hira.localtechstudio.com/api/v1/relay/messages \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "companyId": "cmp_...",
    "to": "+237670000001",
    "scenario": "order_confirmed",
    "variables": {
      "customer_name": "Ada",
      "order_reference": "CMD-1",
      "shop_name": "My Shop"
    }
  }'
```

Typical response: `201` with `data.scenarioKey`, `data.status` (`sent`) and the Relay send id.

### Orders

```bash
curl -X POST https://hira.localtechstudio.com/api/v1/relay/orders \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "companyId": "cmp_...",
    "reference": "CMD-1",
    "customerName": "Ada",
    "customerPhone": "+237670000001",
    "status": "confirmed",
    "currency": "XAF"
  }'

curl -X POST https://hira.localtechstudio.com/api/v1/relay/orders/ord_.../notify \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"scenario":"order_confirmed"}'
```

A second `notify` with the same scenario returns `409 already_notified`.

### Documents

```bash
curl -X POST https://hira.localtechstudio.com/api/v1/relay/documents \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "companyId": "cmp_...", "orderId": "ord_...", "type": "receipt" }'

curl -X POST https://hira.localtechstudio.com/api/v1/relay/documents/doc_.../generate \
  -H "Authorization: Bearer pk_live_..."

curl -X POST https://hira.localtechstudio.com/api/v1/relay/documents/doc_.../send \
  -H "Authorization: Bearer pk_live_..."
```

## LocalTech number pool (ops)

Several shared numbers can coexist. Admin `/admin/relay` lets you add numbers via **Connect with Meta** (Cloud API Embedded Signup), enable / disable each, set the **primary**, or disconnect. Manual token paste remains available as an advanced path.

Routing (`RELAY_ROUTING`):

| Value | Behaviour |
|---|---|
| `primary` (default) | *enabled* number with the lowest `relay_priority` |
| `round_robin` | rotates across enabled numbers |
| `country` | prefers a number whose dial code matches the recipient |

Closing a number for Relay = **Disable** (it stays in the database). Sends then use the other enabled numbers.

## Important rules

- **Opt-out**: a recipient who opts out of the platform number blocks further Relay sends.
- **Meta** still bills conversations on the **number used** WhatsApp Business account (not yours): you do not manage a Meta payment method for Relay.
- To send from **your** brand / number, [connect a number](/docs/connect-number) and upgrade to Starter+.

## Next

- [Notify an order](/docs/guides/order-notifications) — same idea with a dedicated number via `POST /messages`.
- [Subscription and quotas](/docs/billing) — Relay → Starter → Pro → …
- [Webhooks](/docs/webhooks) — track delivery of Relay sends.
