7 endpoints
Payment links
An amount, a description, a link to send. The customer pays on a page hosted by ChariPay — you host no card data.
Endpoint names and descriptions come from the OpenAPI contract, in English — they cannot drift from the API.
In plain English
A ready-to-share payment page — no website needed.
When to use it
For an invoice, a quote, a remote sale, a WhatsApp sale or a cash payment at an agency. It is the fastest integration: one call is enough to get paid.
How to integrate it
- 1Create the link with the amount and a description; add your
externalIdso you can replay the call safely. - 2Share the link you get back — or its QR code, or the print-ready PDF poster for payments at the counter.
- 3For a cash payment, create the link with
paymentMethod: CASH: the payer receives a code (cashinCode) to present at an agency, and thepayment.succeededwebhook confirms the payment — same mechanics as card. - 4Receive the payment-succeeded webhook and match it to your order through the
externalIdyou supplied. - 5Cancel the link if the sale falls through: a cancelled link can no longer be paid.
Sandbox test card
The sandbox runs on real rails against a test environment: the flows are genuine, the money is not. Only one card is accepted there.
Only this PAN is accepted. Any other number — including the 4242… cards from other platforms — is rejected upstream, usually with a 502 and the stable BAAS_CHARI_ERROR code. If you hit that error while testing, check the card number you entered first.
- POST
/v1/payment-links/{reference}/sendE-mail a payment link - POST
/v1/payment-links/{reference}/cancelCancel a payment link - GET
/v1/payment-linksList payment links - POST
/v1/payment-linksCreate a payment link - GET
/v1/payment-links/{reference}/qrPayment-link QR code - GET
/v1/payment-links/{reference}/posterPayment-link poster (PDF) - GET
/v1/payment-links/{reference}Retrieve a payment link
E-mail a payment link
Sends the payment link by e-mail to the given address, or the link's stored customer e-mail if no body is provided. Returns 202 Accepted.
Schema · SendPaymentLinkRequest
| Field | Type | In | Required | Description |
|---|---|---|---|---|
reference | string | path | Required | |
email | string | body | Optional | Recipient e-mail; falls back to the link's stored customer e-mail when omitted. |
Cancel a payment link
Deactivates the link so it can no longer be paid. Idempotent; returns the updated link.
| Field | Type | In | Required | Description |
|---|---|---|---|---|
reference | string | path | Required | Payment-link reference. |
List payment links
Returns the caller's payment links for the key's environment, most recent first, as a paginated Page.
| Field | Type | In | Required | Description |
|---|---|---|---|---|
origin | enum | query | Optional | Filter by creation origin (API or DASHBOARD).Values APIDASHBOARD |
pageable | Pageable | query | Required |
Create a payment link
Creates a reusable (or single-use) payment link. Supply an optional client-owned externalId (unique per merchant) to make the create idempotent: a duplicate externalId returns the existing link with 200 OK instead of creating a new one. Returns the link including its buyer-facing payUrl.
Schema · CreatePaymentLinkRequest
| Field | Type | In | Required | Description |
|---|---|---|---|---|
Idempotency-Key | string | header | Optional | Optional idempotency key; replaying the same value returns the first result. |
amount | number | body | Required | Amount to collect, in MAD major units. |
description | string | body | Required | Short description shown to the buyer. |
singleUse | boolean | body | Optional | true = link is consumed after one successful payment; false = reusable. Defaults to true. |
paymentMethod | enum | body | Optional | Default method shown on the hosted checkout. Defaults to CARD.Values CARDCASH |
customerName | string | body | Optional | Optional buyer name. |
customerEmail | string | body | Optional | Optional buyer e-mail. |
customerPhone | string | body | Optional | Optional buyer phone (E.164). |
expiresAt | string (date-time) | body | Optional | Optional expiry (ISO-8601 UTC). Must be in the future. |
acceptUrl | string | body | Optional | Buyer is redirected here after a successful payment (https:// only). |
declineUrl | string | body | Optional | Buyer is redirected here after a failed/declined payment (https:// only). |
notificationUrl | string | body | Optional | Per-link webhook target (https:// only), in addition to registered endpoints. |
externalId | string | body | Optional | Optional client-supplied id, unique per merchant. Creating a link with an externalId that already exists returns the existing link (idempotent replay). |
metadata | object | body | Optional | Optional free-form metadata object, echoed back on reads and in the payment webhook when the link is paid. |
Payment-link QR code
Returns a PNG QR code that encodes the link's buyer-facing payUrl.
| Field | Type | In | Required | Description |
|---|---|---|---|---|
reference | string | path | Required |
Payment-link poster (PDF)
Returns a printable A4 poster (PDF) with the QR code and amount, for display at a till.
| Field | Type | In | Required | Description |
|---|---|---|---|---|
reference | string | path | Required |
Retrieve a payment link
Fetches a single payment link by its reference.
| Field | Type | In | Required | Description |
|---|---|---|---|---|
reference | string | path | Required | Payment-link reference. |
A question about integration?
Our technical team supports integrators from the first sandbox call through to go-live.