v1

latestOpenAPI 3.0.02026-07-1412068.2 KB
Payment Links

Create Payment Link

API to generate vanilla and subscription payment links. <br> <h3>Payment Status</h3> Once your customer completes a payment, the redirect URL will be appended with the following params<br> - createdAt: The date the charge was captured at<br> - paymentLinkId: The payment link id<br> - status: indicates the payment status, whether captured or failed<br> - transactionId: The transaction / charge id related to the payment<br> <br> You may also get notified about a payment's status by setting up a webhook. Details here<br> <br> A third approach to check the transaction status is by calling our transaction info API here<br> <br> Sample redirect url after a successful payment<br> https://www.mamopay.com/?createdAt=2023-08-09-16-42-35&paymentLinkId=MB-LINK-3216D27C9D&status=captured&transactionId=MPB-CHRG-BEE56990A9<br> <br>

<h3>For Payment Testing</h3> <p>To make payments with different use cases on the test environment, you can use the card details below alongside the below CVV and expiry date.</p> - CVV: 123<br> - Expiry: 01/28 <table> <thead> <tr> <th>Card Number</th> <th>Payment Status</th> <th>3DS</th> <th>Address Required</th> <th>Country</th> </tr> </thead> <tbody> <tr> <td>4659 1055 6905 1157</td> <td>Success</td> <td>X</td> <td>X</td> <td>GB</td> </tr> <tr> <td>4242 4242 4242 4242</td> <td>Success</td> <td>✓</td> <td>X</td> <td>GB</td> </tr> <tr> <td>4111 1111 1111 1111</td> <td>Success</td> <td>✓</td> <td>✓</td> <td>US</td> </tr> <tr> <td>4567 3613 2598 1788</td> <td>Fail</td> <td>X</td> <td>X</td> <td>GB</td> </tr> <tr> <td>4095 2548 0264 2505</td> <td>Fail</td> <td>X</td> <td>✓</td> <td>US</td> </tr> </tbody> </table>

<br> <h3>3DS</h3> If prompted for a password, enter Checkout1!<br> <br> <h3>Subscriptions</h3> When setting up subscriptions, if both end_date and payment_quantity were defined, end_date takes precedence.<br><br>

post/links

Headers

Content-Typestring
Authorizationstring

Request body

titlestring required

The title of the payment link

descriptionstring

Payment description. This will appear on the payment checkout page.

capacityinteger

The number of times a payment link can be used, if null the link can be used indefinitely. The capacity will be ignored when the subscription params exist.

activeboolean
return_urlstring uri

The URL which the customer will be redirected to after a successful payment.

failure_return_urlstring uri

The URL which the customer will be redirected to after a failure payment.

terms_and_conditions_urlstring uri

The URL to the terms and conditions page, if provided, the customer will be required to accept the terms before proceeding to payment.

processing_fee_percentagenumber

Processing fee that you as a merchant can impose on your customers

amountnumber

amount could be 0 with save_card 'required' option for card verification

amount_currency'AED' | 'USD' | 'EUR' | 'GBP' | 'SAR'

Currency code for the payment amount. See examples for more details.

link_type'standalone' | 'modal' | 'inline'

Type of link to be created.

enable_tabbyboolean

Enables the ability for customers to buy now and pay later.

enable_messageboolean

Enables the ability for customers to add a message during the checkout process.

enable_tipsboolean

Enables the tips option. This will be displayed on the first screen.

save_card'off' | 'optional' | 'required'

Allows the merchant to enable the option to store card details to be used later on for Merchant Initiated Transactions.

enable_customer_detailsboolean

Enables adding customer details such as the name, email, and phone number. This screen will be displayed before the payment details screen.

enable_quantityboolean

When enabled, customers can specify the number of items they intend to purchase. This quantity will serve as a multiplier for the base amount.

enable_qr_codeboolean

Adds the ability to verify a payment through a QR code.

send_customer_receiptboolean

Enables the sending of customer receipts.

first_namestring

The first name of customer which will pre-populate in card info step.

last_namestring

The last name of customer which will pre-populate in card info step.

emailstring

The email of customer which will pre-populate in card info step.

custom_dataobject
external_idstring

The external ID of your choice to associate with payments captured by this payment link.

hold_and_charge_laterboolean

Indicates whether to place the payment on hold and charge it later using the "captures" API.

Example request

{
  "title": "Chocolate Box - Small",
  "description": "12pcs Chocolate Box",
  "capacity": 1,
  "active": true,
  "return_url": "https://myawesomewebsite.com/paymentSuccess",
  "failure_return_url": "https://failurewebsite.com/paymentFailure",
  "terms_and_conditions_url": "https://myawesomewebsite.com/terms",
  "processing_fee_percentage": 3,
  "amount": 119.99,
  "amount_currency": "AED",
  "enable_message": true,
  "enable_tips": true,
  "save_card": "optional",
  "enable_tabby": true,
  "link_type": "modal",
  "enable_customer_details": true,
  "payment_methods": [
    "card",
    "wallet"
  ],
  "rules": {
    "allowed": [
      {
        "type": "bins"
      },
      {
        "list": [
          "424242"
        ]
      },
      {
        "decline_message": "Custom decline message for this rule"
      }
    ]
  },
  "subscription": {
    "frequency": "monthly",
    "frequency_interval": 1,
    "start_date": "2023/01/01",
    "end_date": "2023/02/31",
    "payment_quantity": 5
  },
  "first_name": "first name",
  "last_name": "last name",
  "email": "email@mamopay.com",
  "custom_data": {
    "val1": true,
    "val2": "custom value"
  },
  "external_id": "ORDER-12345",
  "hold_and_charge_later": false
}

Response

Successful response

idstring
titlestring
descriptionstring
capacityinteger
activeboolean
return_urlstring
failure_return_urlstring
terms_and_conditions_urlstring
processing_fee_percentagenumber
link_typestring
amountnumber
amount_currencystring
send_customer_receiptboolean
enable_tabbyboolean
enable_messageboolean
enable_tipsboolean
save_cardstring
enable_quantityboolean
enable_customer_detailsboolean
payment_urlstring
first_namestring
last_namestring
emailstring
custom_dataobject
external_idstring
platformstring
prefilled_customerobject
hold_and_charge_laterboolean
internal_notestring
langstring
expiration_datestring
namestring
is_widgetboolean
max_amountnumber
processing_fee_amountnumber
payouts_shareobject

Example response

{
  "id": "MB-LINK-37D90AAF51",
  "title": "Test Payment Link",
  "name": "Test Payment Link",
  "description": "Test description",
  "capacity": 1,
  "active": true,
  "return_url": "https://myawesomewebsite.com/paymentSuccess",
  "failure_return_url": null,
  "amount": 10,
  "amount_currency": "AED",
  "send_customer_receipt": true,
  "platform": "client",
  "prefilled_customer": {},
  "external_id": null,
  "hold_and_charge_later": false,
  "internal_note": null,
  "lang": "en",
  "expiration_date": null,
  "enable_tabby": false,
  "is_widget": false,
  "link_type": "standalone",
  "max_amount": null,
  "processing_fee_percentage": 0,
  "processing_fee_amount": null,
  "enable_message": false,
  "enable_tips": false,
  "enable_quantity": false,
  "payment_methods": [
    "card",
    "wallet"
  ],
  "rules": {
    "allowed": []
  },
  "enable_customer_details": false,
  "payment_url": "https://sandbox.dev.business.mamopay.com/pay/mamo-c1f890",
  "save_card": "off",
  "terms_and_conditions_url": null,
  "subscription": null,
  "payouts_share": null,
  "custom_data": {}
}