Skip to main content
curl --request POST 'https://api.mayar.id/hl/v2/products/create' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--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"
    }'
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "id": "21d84338-b46d-42d7-9b49-d402520407a5",
        "link": "https://testingmayar.myr.id/pl/Jasa-Buat-Website-Kece"
    }
}
Endpoint:
https://api.mayar.id/hl/v2/products/create
This endpoint shares the same handler and request body as Create Payment Link (POST /products/payment-link/create). Both create a generic_link product.

Authorization

Authorization
string
required
Example:Authorization | Bearer Paste-Your-API-Key-Here

Request Body

name
string
required
Generic payment link product name.
amount
integer
Product price amount.
description
string
Generic payment link product description.
redirectUrl
string
URL where the customer will be redirected after completing payment.
coverImage
string
Cover image for the product.
expiredAt
string | datetime
Payment link expiration date in ISO 8601 format.
limit
integer
Maximum purchase limit.
notes
string
Additional notes for the payment link.
tax
integer
Tax amount applied to the product.

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 (Object)

data.id
string
Unique identifier of the generic payment link product.
Public URL of the created generic payment link product.

Errors

400 Bad Request
object
Returned when the request body fails validation: { "statusCode": 400, "messages": "Validation Error" }.
409 Conflict
object
Returned when a product with the same identifier already exists: { "statusCode": 409, "messages": "already exist" }.