MobileWalletPartner Gateway Docs
API referencePayment Links

Create a payment link

Creates a hosted payment page your customer pays on by MTN MoMo: send them the returned url (by SMS, WhatsApp, email, a QR code). Each payment is an ordinary MoMo deposit to your balance, with its own webhook; its partnerOrderId starts with pl-{code}-.

POST
/api/v1/payment-links

Authorization

PartnerBasic
headerAuthorizationBasic <token>

HTTP Basic auth: your AppId as the username and your AppKey as the password. Sandbox and Live have separate credentials.

Header Parameters

Idempotency-Key?string

Optional. A unique key for this request (e.g. a UUID), up to 255 characters. Retrying with the same key and the same body returns the first response again (marked Idempotent-Replayed: true) instead of running the request twice. Kept 24 hours.

Request Body

  1. body

A payment link to create.

title?string

What the customer pays for, shown on the page (max 100 characters).

description?|

More detail shown on the page (max 500 characters). Optional.

amount?|

The amount to pay, in whole XAF. Omit it to let the customer enter the amount (a donation, a top-up).

Formatdouble
reference?|

Your own reference (an invoice or order number), for your records. Optional.

singleUse?boolean

true to close the link after its first successful payment, e.g. for an invoice.

expiresAt?|

When the link stops accepting payments (ISO 8601). Optional.

Formatdate-time
redirectUrl?|

Where to send the customer after paying (http or https). The gateway adds ?status=success&reference={your reference}. Optional.

Response Body

OK

  1. response

A payment link: a hosted page where a customer pays you by MTN MoMo.

id?string

The link's id.

Formatuuid
code?string

The public code in the link's URL.

url?string

The page to send your customer to.

environment?string

Sandbox or Live.

title?string

What the customer pays for, shown on the page.

description?|

More detail shown on the page, if any.

amount?|

The amount to pay; null when the customer enters it.

Formatdouble
currency?string

Currency code, XAF.

reference?|

Your own reference, if you set one.

singleUse?boolean

Whether the link closes after its first successful payment.

status?string

OPEN, PAID (a single-use link that was paid), EXPIRED or DISABLED.

expiresAt?|

When the link stops accepting payments; null for never.

Formatdate-time
redirectUrl?|

Where the page sends the customer after paying, if set.

createdDate?string

When it was created (UTC).

Formatdate-time
paidCount?integer

How many payments succeeded through it.

Formatint32
paidTotal?number

Total of the successful payments.

Formatdouble
payments?array<>

The payments made through it, newest first (only when fetching one link).

Example Request
curl -X POST 'https://gateway.staging.wallet2cash.com/api/v1/payment-links' \  -H 'Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "code": "string",  "url": "string",  "environment": "string",  "title": "string",  "description": "string",  "amount": 0,  "currency": "string",  "reference": "string",  "singleUse": true,  "status": "string",  "expiresAt": "2019-08-24T14:15:22Z",  "redirectUrl": "string",  "createdDate": "2019-08-24T14:15:22Z",  "paidCount": 0,  "paidTotal": 0.1,  "payments": [    {      "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc",      "partnerOrderId": "string",      "msisdn": "string",      "amount": 0.1,      "status": "string",      "failureCode": "string",      "createdDate": "2019-08-24T14:15:22Z"    }  ]}