# Send a WhatsApp payment link
Source: https://docs.lomi.africa/api/whatsapp/WhatsAppMerchantController_sendPaymentMessage

Send a hosted checkout link on the connected WhatsApp number.

***

title: "Send a WhatsApp payment link"
description: "Send a hosted checkout link on the connected WhatsApp number."
full: true
method: post
path: /whatsapp/payment-messages
operationId: WhatsAppMerchantController\_sendPaymentMessage
-----------------------------------------------------------

## Overview

Sends a `pay.lomi.africa` link to `to` on the connected number. This uses an approved template, so the customer does not need to have written first.

Pass `amount` as what the customer pays (`5000` XOF is 5000, `10` USD is 10.00), or `checkout_session_id` (UUID) for a checkout you already created. Optional `Idempotency-Key` when creating a checkout.

When the customer messages the number, lomi. can also reply in that chat with a pay button. That path is `inbound_payment_link` on `GET /whatsapp`.

## Authentication

Merchant routes require an API key in the `X-API-KEY` header (see [Integration overview](/api)). Use a **test** key against `https://sandbox.api.lomi.africa` and a **live** key against `https://api.lomi.africa`.

## Endpoint

`POST /whatsapp/payment-messages`

Base URLs:

* `https://sandbox.api.lomi.africa`
* `https://api.lomi.africa`

## Request

### Path parameters

*No path parameters.*

### Query parameters

*No query parameters.*

### Headers

| Name              | In     | Required | Schema | Description                                                      |
| ----------------- | ------ | -------- | ------ | ---------------------------------------------------------------- |
| `Idempotency-Key` | header | No       | string | Replays return the original response when a checkout is created. |

### Body

| Name                  | Required | Schema                  | Description                                                                                     |
| --------------------- | -------- | ----------------------- | ----------------------------------------------------------------------------------------------- |
| `to`                  | Yes      | string                  | Customer WhatsApp number.                                                                       |
| `amount`              | No       | number                  | What the customer pays. 10000 is 10000 in XOF, USD, EUR, GBP, CAD, XAF, GHS, KES, MAD, and ZAR. |
| `currency_code`       | No       | `XOF` \| `USD` \| `EUR` | Charge currency.                                                                                |
| `title`               | No       | string                  | Label on the payment link.                                                                      |
| `checkout_session_id` | No       | uuid                    | Existing checkout to send instead of creating one.                                              |

## Responses

| Status | Description                               |
| ------ | ----------------------------------------- |
| `200`  | Payment link sent on the connected number |
| `401`  | Invalid or missing API key                |

## Errors

Errors follow the standard JSON error format. **401** means the key is missing or invalid. **400** means `to` is missing, or neither `amount` nor `checkout_session_id` can build a link.

## Example

```bash
curl -sS -X POST "https://sandbox.api.lomi.africa/whatsapp/payment-messages" \
  -H "X-API-KEY: $LOMI_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"+2250100000000","amount":1500,"currency_code":"XOF"}'
```

## OpenAPI

* **operationId**: `WhatsAppMerchantController_sendPaymentMessage`
* **Operation**: `POST /whatsapp/payment-messages`

Full schemas and **Try it**: [API reference](/api). Machine-readable contract: repo `apps/docs/openapi.json`.
