---
title: "Create Payment Link"
method: POST
path: "/links"
tags: ["Payment Links"]
---

# Create Payment Link

`POST /links`

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](https://mamopay.readme.io/reference/post_webhooks)<br> <br> A third approach to check the transaction status is by calling our transaction info API [here](https://mamopay.readme.io/reference/get_charges-chargeid)<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>

## Headers

- `Content-Type` string
- `Authorization` string

## Request body

- object
  - `title` string, required — The title of the payment link
  - `description` string — Payment description. This will appear on the payment checkout page.
  - `capacity` integer — 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.
  - `active` boolean
  - `return_url` string, uri — The URL which the customer will be redirected to after a successful payment.
  - `failure_return_url` string, uri — The URL which the customer will be redirected to after a failure payment.
  - `terms_and_conditions_url` string, 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_percentage` number — Processing fee that you as a merchant can impose on your customers
  - `amount` number — 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](https://help.mamopay.com/en/articles/8225989-supported-currencies) for more details.
  - `link_type` 'standalone' | 'modal' | 'inline' — Type of link to be created.
  - `enable_tabby` boolean — Enables the ability for customers to buy now and pay later.
  - `enable_message` boolean — Enables the ability for customers to add a message during the checkout process.
  - `enable_tips` boolean — 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_details` boolean — Enables adding customer details such as the name, email, and phone number. This screen will be displayed before the payment details screen.
  - `enable_quantity` boolean — 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_code` boolean — Adds the ability to verify a payment through a QR code.
  - `send_customer_receipt` boolean — Enables the sending of customer receipts.
  - `payment_methods` unknown[] — An array of the accepted payment methods, with 'card' always included as the default option, and wallet for Apple Pay and Google Pay. Example to accept all: ['card', 'wallet']
    - unknown
  - `rules` object — Setting the rule for payment link
    - `allowed` object[] — An array of one or more rules
      - `type` 'bins' — name of rules
      - `list` unknown[] — value of bins
        - unknown
      - `decline_message` string — Custom decline message for this rule
  - `subscription` object — to be populated if this payment link is for a subscription. Otherwise, this property can be left out.
    - `frequency` 'annually' | 'monthly' | 'weekly' — defines the interval that this subscription will be run on.
    - `frequency_interval` integer — defines how often this subscription will run. This will be based on the frequency property defined above.
    - `start_date` string — the first date this subscription will run on.
    - `end_date` string — the last date this subscription could run on.
    - `payment_quantity` integer — number of times this subscription will occur. If end_date defined, end_date takes precedence.
  - `first_name` string — The first name of customer which will pre-populate in card info step.
  - `last_name` string — The last name of customer which will pre-populate in card info step.
  - `email` string — The email of customer which will pre-populate in card info step.
  - `custom_data` object
  - `external_id` string — The external ID of your choice to associate with payments captured by this payment link.
  - `hold_and_charge_later` boolean — Indicates whether to place the payment on hold and charge it later using the "captures" API.
  - `payouts_share` object
    - `recipient_id` string — The ID of an already added recipient that the transaction amount will be shared with.
    - `percentage_to_recipient` number — The percentage of the transaction amount that will be sent to the recipient.
    - `recipient_pays_fees` boolean — Whether Mamo fees for a given transaction will be passed on to the recipient.

## Response `200`

Successful response

- object
  - `id` string
  - `title` string
  - `description` string
  - `capacity` integer
  - `active` boolean
  - `return_url` string
  - `failure_return_url` string
  - `terms_and_conditions_url` string
  - `processing_fee_percentage` number
  - `link_type` string
  - `amount` number
  - `amount_currency` string
  - `send_customer_receipt` boolean
  - `enable_tabby` boolean
  - `enable_message` boolean
  - `enable_tips` boolean
  - `save_card` string
  - `enable_quantity` boolean
  - `enable_customer_details` boolean
  - `payment_url` string
  - `first_name` string
  - `last_name` string
  - `email` string
  - `custom_data` object
  - `external_id` string
  - `payment_methods` unknown[]
    - unknown
  - `rules` object
    - `allowed` unknown[]
      - unknown
  - `subscription` object
    - `identifier` string
    - `repeats_every` string
    - `frequency_interval` integer
    - `start_date` string
    - `end_date` string
    - `payment_quantity` integer
    - `frequency` string
  - `platform` string
  - `prefilled_customer` object
  - `hold_and_charge_later` boolean
  - `internal_note` string
  - `lang` string
  - `expiration_date` string
  - `name` string
  - `is_widget` boolean
  - `max_amount` number
  - `processing_fee_amount` number
  - `payouts_share` object

## Other responses

- `403` — Unauthorised
- `404` — Invalid request
- `422` — Unprocessable entity
- `500` — Unexpected error

---

[API](https://skmtc.net/mamopay/apis/payments.md) · [All operations](https://skmtc.net/mamopay/apis/payments/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mamopay/payments/revisions/65bb3871a425/schema)
