Skip to main content
curl --request POST 'https://api.mayar.id/hl/v2/payments/create' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--data-raw '{
        "name": "Penagihan",
        "amount": 100000,
        "email": "budi.santoso@example.com",
        "mobile": "081234567890",
        "description": "Pembayaran jasa konsultasi",
        "expiredAt": "2026-07-19T16:43:23.000Z"
    }'
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "id": "6f8c19ff-5b97-4792-aa89-d2a12797b356",
        "transactionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "link": "https://testingmayar.myr.id/pl/rqp9x2k7m3a"
    }
}
Endpoint:
https://api.mayar.id/hl/v2/payments/create

Authorization

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

Request Body

name
string
required
Name/title of the payment request.
amount
integer
required
Nominal amount of payment.
email
string
Customer email used to send proof of payment or payment reminders.
mobile
string
Customer telephone number.
description
string
General description of the transaction or order.
notes
string
Additional notes for the payment request.
expiredAt
string (format ISO 8601 date-time)
The transaction expiration date and time. After this time, the payment link is no longer valid.
paymentMethod
string
Restrict the payment request to a specific payment method.
cashtag
string
Cashtag associated with the payment request.
extraData
object
Additional custom data attached to the payment request.

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code form API.
messages
string
Status message that describes the status code.
data
object
The created payment request data.

data Structure (Object)

id
string<uuid>
Unique request payment ID.
transactionId
string<uuid>
Unique transaction ID associated with this payment request.
The URL that customers can access to open the payment request.

Errors

400 Bad Request
object
Returned when the request body fails validation: { "statusCode": 400, "messages": "Validation Error" }.
409 Conflict
object
Returned when a payment request with the same identifier already exists: { "statusCode": 409, "messages": "already exist" }.
429 Too Many Requests
object
Returned when a duplicate create request is detected: { "statusCode": 429, "messages": "Duplicate request detected. Please wait 1 minute before trying again." }.