Accept payments
Payment links
Share a link that takes a payment, with no integration to build.
A payment link is a page that collects money. Send it to somebody and they pay it; each payment is an ordinary charge.
Selling on your own website? Checkout creates a page per order from your server, and sends the customer back to your site afterwards.
Key requirements
- An API key with
payments:writeto create, disable and enable links, andpayments:readto read them. Or a dashboard sign-in with permission to move money. - A test key's links are test links, which collect test money only.
- One currency per link, fixed for the life of the link.
How it works
- You create a link: a title, a currency, and a fixed or open amount.
- You share its page,
https://business.inversepay.app/pay/{slug}. - The payer opens it, enters their number and approves the prompt.
- You receive
charge.succeeded, the same as for a direct charge.
Step 1 — Create the link
In the dashboard
- Sign in to the dashboard and open Payment links.
- Choose New payment link, fill in the title, currency and amount, and choose Create link.
- Copy the link and send it to your customer.
With an API key
curl -X POST https://api.inversepay.app/api/b/v1/payment-links \
-H "Authorization: Bearer $INVERSEPAY_TEST_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"title": "Invoice 1042",
"currency": "RWF",
"amount_type": "fixed",
"amount_minor": 2500000,
"usage": "single_use",
"redirect_url": "https://example.com/thanks",
"metadata": { "invoice": "INV-1042" }
}'{
"id": "7c2d…",
"slug": "pl_abc123",
"title": "Invoice 1042",
"amount_type": "fixed",
"amount_minor": 2500000,
"currency": "RWF",
"usage": "single_use",
"state": "active",
"redirect_url": "https://example.com/thanks",
"expires_at": null,
"payments": 0,
"account": null,
"is_test": true
}| Field | ||
|---|---|---|
title | required | The page's heading. Up to 140 characters. |
currency | required | RWF or UGX. |
amount_type | optional | fixed (the default) charges amount_minor. open lets the payer choose. |
amount_minor | fixed only | In minor units: 25,000 RWF is 2500000. Refused on an open link. |
min_amount_minor, max_amount_minor | open only | Bounds on what the payer may enter. |
usage | optional | reusable (the default) keeps collecting; single_use closes after the first payment. Use single_use for one invoice. |
expires_at | optional | RFC 3339, UTC. After it, the page refuses payment. |
redirect_url | optional | Where the payer goes after paying. Not proof of payment. |
description, metadata | optional | Shown under the title; and your own data, returned on every charge the link produces. |
account | optional | Which of your accounts the link's payments settle into, acct_…. Omit it for your main account. It must hold the link's currency; a frozen account still receives. |
Step 2 — Confirm the payment
Wait for charge.succeeded on your webhook endpoint, or list
your charges with GET /charges. Your
metadata comes back on the charge.
Arriving at redirect_url is not proof of payment. The payer's browser
controls it.
Link states
state | |
|---|---|
active | Accepting payments. |
paid | A single_use link that has been paid. |
expired | Past expires_at. |
disabled | Turned off. Turn it back on to collect again. |
Turn a link off in the dashboard, or, once API keys can, with
POST /payment-links/{id}/disable and /enable. Enabling does not revive an
expired or paid link.
Webhooks
A link sends no events of its own. Each payment is a charge and sends the
charge events: charge.created, then
charge.succeeded or charge.failed.
Errors
| Status | code | |
|---|---|---|
400 | INVALID_LINK | An amount that does not fit amount_type, bounds the wrong way round, an expiry in the past, or a redirect that is not http(s). |
403 | INSUFFICIENT_AUTHORITY | The key lacks the scope: payments:write to create, disable or enable, payments:read to read. |
404 | LINK_NOT_FOUND | No such link. |
404 | ACCOUNT_NOT_FOUND | account names no account of yours in this key's mode. |
409 | ACCOUNT_NOT_ACTIVE | account is closed. |
422 | CURRENCY_NOT_ACTIVATED | account does not hold the link's currency. |
All codes are on Errors.
Testing
A link made with a sk_test_ key is a test link: its page says no real money
moves, nobody's phone is prompted, and each payment is a test charge. A link
made with a sk_live_ key collects real money.
Developer notes
- One link, many charges. A
reusablelink produces a charge per payment;paymentscounts them. - The slug is the link. Anybody with it can pay; nobody with it can see your business's other links or payments.