> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mayar.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Generic Link

> Endpoint used to create generic link product

```bash Request Example theme={null}
curl --request POST 'https:api.mayar.id//hl/v1/product/paymentlink/create'\
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--header 'Content-Type: application/json' \
--data-raw'{
        "name": "Jasa Buat Website Kece",
        "description": "Untuk testing API",
        "amount": 150000,
        "redirectUrl": "https://example.com/thank-you",
        "notes": "catatan opsional",
        "expiredAt": "2026-06-15T12:00:00.000Z"
    }'

```

```json Response Example 200 theme={null}
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "id": "21d84338-b46d-42d7-9b49-d402520407a5",
        "link": "https://testingmayar.myr.id/pl/Jasa-Buat-Website-Kece/"
    }
}
```

Endpoint:

```Production Production theme={null}
https://api.mayar.id/hl/v1/product/paymentlink/create
```

```Sandbox Sandbox theme={null}
https://api.mayar.io/hl/v1/product/paymentlink/create
```

## Authorization

**Authorization** `string` *required*

Example:

`Authorization | Bearer Paste-Your-API-Key-Here`

## Request Body

**name** `string` *required*

Generic payment link product name.

**description** `string` *required*

Generic payment link product description.

**amount** `integer` *required*

Product price amount.

**redirectUrl** `string`

URL where the customer will be redirected after completing payment.

**notes** `string`

Additional notes for the payment link.

**expiredAt** `string | datetime`

Payment link expiration date in ISO 8601 format.

## Response

Successful Response

### Main Structure (Root)

**statusCode** `integer`

Status code from API.

**messages** `string`

Status message that describes the status code.

**data** `object`

The created generic payment link product data.

### data Structure (Array of Object)

**data.id** `string`

Unique identifier of the generic payment link product.

**data.link** `string`

Public URL of the created generic payment link product.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.