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:
| Param | Meaning |
|---|---|
transactionId | The payment ID |
chargeUID | The payment ID (same value as transactionId) |
paymentLinkId | The payment link ID |
createdAt | When the payment was created, YYYY-MM-DD-HH-MM-SS, UAE time |
status | The 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 paramsThey'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.
InlinesubscriptionobjectYou can configure the schedule inline with the
subscriptionobject instead. If it sets bothend_dateandpayment_quantity,end_datetakes precedence. We recommendsubscription_id.
404Invalid request
429Too many requests. You sent more than 100 requests in 30 seconds from one IP address. This response has no JSON body. See Rate limits.
500Unexpected error