Create payment link

Creates a hosted payment link you can send to a customer or embed in your site. A link can take a one-off payment, be reused up to its capacity, or bill a customer on a schedule when you attach a subscription. The response includes the link's id and the payment_url to send your customer to.

Confirming the payment

When the customer finishes paying, Mamo redirects them to your return_url (or failure_return_url on failure) with these query params appended:

ParamMeaning
transactionIdThe payment ID
chargeUIDThe payment ID (same value as transactionId)
paymentLinkIdThe payment link ID
createdAtWhen the payment was created, YYYY-MM-DD-HH-MM-SS, UAE time
statusThe payment status, e.g. captured or failed

Each key of the link's custom_data is appended too, and can overwrite the names above.

Sample redirect after a successful payment:

https://example.com/paymentSuccess?chargeUID=PAY-2B3C4D5E6F&createdAt=2023-08-09-16-42-35&paymentLinkId=MB-LINK-6F7A8B9C0D&status=captured&transactionId=PAY-2B3C4D5E6F
🚧

Don't trust the redirect params

They're appended client-side and can be tampered with or missed. Confirm the final status server-side with a webhook, Fetch payment info, or Fetch payment link info.

Testing in the sandbox

Pay a sandbox link with the cards in Sandbox testing → Test cards, which cover successful and failed payments, with and without 3DS.

Subscriptions

To bill a customer on a schedule, create the subscription first with Create subscription, then pass its identifier as subscription_id with link_type set to inline.

📘

Inline subscription object

You can configure the schedule inline with the subscription object instead. If it sets both end_date and payment_quantity, end_date takes precedence. We recommend subscription_id.

Recipes
💳
Accept a payment with a payment link
Open Recipe
✅
Accept a payment and confirm it with a webhook
Open Recipe
📱
Add Apple Pay and Google Pay
Open Recipe
🔒
Hold a payment, capture it later, and refund
Open Recipe
🏪
Run a marketplace: collect, hold, split and pay sellers
Open Recipe
🧪
Get sandbox access and make your first test payment
Open Recipe
Body Params
Headers
Responses

404

Invalid request

429

Too many requests. You sent more than 100 requests in 30 seconds from one IP address. This response has no JSON body. See Rate limits.

500

Unexpected error

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json