Skip to main content
curl --request POST 'https://api.mayar.id/hl/v2/invoices/6f8c19ff-5b97-4792-aa89-d2a12797b356/update' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--data-raw '{
        "id": "6f8c19ff-5b97-4792-aa89-d2a12797b356",
        "description": "Invoice yang sudah diedit",
        "items": [
            {
                "quantity": 2,
                "rate": 55000,
                "description": "Paket layanan B"
            }
        ]
    }'
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "id": "6f8c19ff-5b97-4792-aa89-d2a12797b356",
        "link": "https://testingmayar.myr.id/invoices/ibzfrf4880"
    }
}
Endpoint:
https://api.mayar.id/hl/v2/invoices/{uuId}/update
The invoice to update is selected by the id field in the request body, not by the {uuId} segment in the URL path. The path segment is cosmetic and is ignored by the API — always send the target invoice id in the body.

Authorization

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

Request Body

id
string<uuid>
required
A unique identifier obtained when creating an invoice. This selects the invoice to update (the {uuId} URL segment is ignored).Example:6f8c19ff-5b97-4792-aa89-d2a12797b356
items
array
List of invoice items.
items[].quantity
number
Quantity of the item.
items[].rate
number
Price per item.
items[].description
string
Description of the item.
description
string
Description or notes related to the invoice.
expiredAt
string
Invoice expiration time in ISO 8601 format (UTC).
notes
string
Additional notes for the invoice.
tax
integer
Tax amount applied to the invoice.
paymentMethod
string
Restrict the invoice to a specific payment method.
cashtag
string
Cashtag associated with the invoice.
extraData
object
Additional custom data attached to the invoice.

Response

Successful Response

Main Structure (Root)

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

data Structure (Object)

id
string<uuid>
Unique invoice ID.
The URL that customers can access to open the invoice.

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": "Invoice not found" }.
409 Conflict
object
Returned when the invoice has already been paid and can no longer be edited: { "statusCode": 409, "messages": "Transaction already paid. Cannot edit invoice." }.