Skip to main content
curl --request POST 'https://api.mayar.id/hl/v1/invoice/create' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--data-raw '{
        "name": "andre jago",
        "email": "alikusnadide@gmail.com",
        "mobile": "085797522261",
        "redirectUrl": "https://kelaskami.com/nexst23",
        "description": "testing dulu pak",
        "expiredAt": "2026-04-19T16:43:23.000Z",
        "items":[{
            "quantity": 3,
            "rate": 11000,
            "description": "1e 1 sayam jago"
        }],
        "extraData": {
            "noCustomer": "827hiueqy271hj",
            "idProd": "contoh aja"
        }
    }
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "id": "df65d192-8396-4f9a-b4e5-8244648c07c5",
        "transactionId": "ca87fd13-8742-4d48-af33-7de1a417bc34",
        "link": "https://korban-motivator.mayar.shop/invoices/ycfyxbj2h3",
        "expiredAt": 1776617003000,
        "extraData": {
            "noCustomer": "827hiueqy271hj",
            "idProd": "contoh aja"
        }
    }
}
Endpoint:
https://api.mayar.id/hl/v1/invoice/create

Authorization

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

Request Body

name
string
required
Full name of the customer.
email
string
required
Email address of the customer.
mobile
string
required
Mobile phone number of the customer.
redirectUrl
string
required
URL where the customer will be redirected after completing the payment.
description
string
required
Description or notes related to the invoice.
expiredAt
string
required
Invoice expiration time in ISO 8601 format (UTC).
items
array
required
List of invoice items.
items[].quantity
number
required
Quantity of the item.
items[].rate
number
required
Price per item.
items[].description
string
required
Description of the item.
extraData
object
required
Additional custom data attached to the invoice.
extraData.noCustomer
string
required
Custom customer reference number.
extraData.idProd
string
required
Custom product identifier associated with the invoice.

Response

Successful Response

Main Structure (Root)

statusCode
integer
required
Status code form API.
messages
string
required
Status message that describes the status code.
data
array of object
The main data returned (invoice details).

data Structure (Array Of Object)

data.id
string
required
Unique identifier of the invoice record.
data.transactionId
string
required
Unique identifier of the associated transaction.
Invoice URL that can be accessed by the customer.
data.expiredAt
number
required
Timestamp (in milliseconds) indicating when the invoice will expire.
data.extraData
object
required
Additional custom data attached to the invoice.
data.extraData.noCustomer
string
required
Custom customer reference number.
data.extraData.idProd
string
required
Custom product identifier associated with the invoice.