> For the complete documentation index, see [llms.txt](https://startbutton.gitbook.io/startbutton-product-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://startbutton.gitbook.io/startbutton-product-api/collections/payment-links.md).

# Payment Links

This feature helps you accept payment for your products or services from your customers seamlessly via a unique URL. Once the basic details described below are provided a unique link is generated and can be shared with your customers to make payment via any of our supported currencies.

## Create payment link

See [Environments & Base URLs](/startbutton-product-api/getting-started/environments-and-base-urls.md).

**POST** — `{{baseurl}}/paymentlink`

| Header        | Value               |
| ------------- | ------------------- |
| Authorization | `Bearer SECRET_KEY` |
| Content-type  | `application/json`  |

| Param         | Required? | Description                                                                                                                                                                                                                                                                                                                                                |
| ------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| title         | Yes       | This should be the name/title of the payment link                                                                                                                                                                                                                                                                                                          |
| currency      | Yes       | Allowed values are: [Available Currencies](/startbutton-product-api/reference/available-currencies.md#for-collections)                                                                                                                                                                                                                                     |
| amount        | Yes       | This should be in fractional units (kobo for NGN, cents for USD). 300NGN will be passed as 30000                                                                                                                                                                                                                                                           |
| isFixedAmount | Yes       | <p>This should be either true or false.<br><br>If set to "true", your customers would be required to pay the amount in your request body.<br><br>If "false" it acts as a donation link; whereby the amount in your request will be displayed as a mere suggestion to your customers. However, your customers can enter their preferred payment amount.</p> |
| type          | Yes       | This should always be passed as easy                                                                                                                                                                                                                                                                                                                       |
| purpose       | No        | This is a description of the payment link that should appear on the your dashboard when viewing the link                                                                                                                                                                                                                                                   |

If the API call is successful, we will return a URL which you can share with your customers to input their payment information in order to complete the transaction.

Here's a sample request and response.

**Sample request:**

{% tabs %}
{% tab title="Required parameters" %}

```json
{ 
  "title": "The test link", 
  "currency": "NGN", 
  "amount": 10000, 
  "isFixedAmount": true, 
  "type": "easy" 
}
```

{% endtab %}

{% tab title="Optional parameters included" %}

```json
{ 
  "title": "The test link", 
  "currency": "NGN", 
  "amount": 10000, 
  "isFixedAmount": true, 
  "type": "easy", 
  "purpose": "Collect semo payment" 
}
```

{% endtab %}
{% endtabs %}

#### Sample response:

```json
{ 
    "success": true, 
    "message": "success", 
    "data": { 
        "paymentLink": { 
            "merchantId": "64c7bd870821e8xxxxxxxxxx", 
            "link": "{paymentCode}", 
            "title": "The test link", 
            "currency": "NGN", 
            "code": "8ad6d861ba6f", 
            "amount": 10000, 
            "isFixedAmount": true, 
            "active": true, 
            "deleted": false, 
            "type": "easy", 
            "customEmails": [], 
            "_id": "65d387381c37d1xxxxxxxxxx", 
            "createdAt": "2024-02-19T16:52:08.127Z", 
            "updatedAt": "2024-02-19T16:52:08.127Z", 
            "__v": 0 
        } 
    } 
}
```
