Skip to main content
curl --request GET 'https://api.mayar.id/hl/v2/invoices/6f8c19ff-5b97-4792-aa89-d2a12797b356' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here'
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "id": "6f8c19ff-5b97-4792-aa89-d2a12797b356",
        "amount": 110000,
        "status": "paid",
        "userId": "348e083d-315a-4e5c-96b1-5a2a98c48413",
        "link": "ibzfrf4880",
        "expiredAt": 1768371411000,
        "transactions": [
            {
                "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                "extraData": null
            },
            {
                "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
                "extraData": null
            }
        ],
        "customerId": "21d84338-b46d-42d7-9b49-d402520407a5",
        "customer": {
            "id": "21d84338-b46d-42d7-9b49-d402520407a5",
            "email": "budi.santoso@example.com",
            "mobile": "081234567890",
            "name": "Budi Santoso"
        },
        "transactionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "paymentUrl": "https://testingmayar.myr.id/invoices/ibzfrf4880",
        "paymentLinkId": "6f8c19ff-5b97-4792-aa89-d2a12797b356"
    }
}
Endpoint:
https://api.mayar.id/hl/v2/invoices/{id}

Authorization

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

Path Parameters

id
string<uuid>
required
A unique identifier obtained when creating an invoice. If accessed through the dashboard, it can be found at the URL on the invoice details page.Example:6f8c19ff-5b97-4792-aa89-d2a12797b356

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code form API.
messages
string
Status message that describes the status code.
data
object
The invoice detail object.

data Structure (Object)

id
string<uuid>
Unique invoice ID.
amount
integer
Invoice price or nominal value.
status
string
Invoice status (e.g. paid, unpaid, closed).
userId
string<uuid>
Identifier of the merchant that owns this invoice.
Invoice slug/short URL.
expiredAt
integer
Invoice expiration time in timestamp form (epoch millis).
transactions
array of object
List of invoice related transactions.
customerId
string<uuid>
Unique customer ID.
customer
object
Details of the customer associated with this invoice.
transactionId
string<uuid>
The primary transaction ID for this invoice.
paymentUrl
string
URL for the invoice payment page.
Unique ID of the payment link (usually the same as invoice ID).

transactions Structure (Array Of Object)

id
string <uuid>
Unique transaction ID.
extraData
object | null
Additional custom data attached to the transaction, can be null.

customer Structure (Object)

id
string <uuid>
Unique customer ID.
email
string
Customer’s email address.
mobile
string
Customer’s mobile phone number.
name
string
Customer’s name.

Errors

401 Unauthorized
object
Returned when the API key is missing or invalid: { "statusCode": 401, "messages": "Unauthorized" }.
404 Not Found
object
Returned when no invoice matches the provided ID: { "statusCode": 404, "messages": "Not Found" }.