Skip to main content
curl --request POST 'https://api.mayar.id/hl/v2/products/payment-link/21d84338-b46d-42d7-9b49-d402520407a5/update' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--data-raw '{
        "id": "21d84338-b46d-42d7-9b49-d402520407a5",
        "name": "Jasa Buat Website Kece Editan",
        "description": "Deskripsinya diubah",
        "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/payment-link/{id}/update
The product to edit is identified by the id field in the request body, not by the {id} segment in the URL path. This endpoint shares the same handler as Update Payment Link (POST /payment-links/{id}/update).

Authorization

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

Request Body

id
string
required
Unique identifier of the generic payment link product to edit. This is read from the request body.
name
string
Generic payment link product name.
description
string
Generic payment link product description.
amount
integer
Product price amount.
redirectUrl
string
URL where the customer will be redirected after completing payment.
notes
string
Additional notes for the payment link.
expiredAt
string | datetime
Payment link expiration date in ISO 8601 format.

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code from API.
messages
string
Status message that describes the status code.
data
object
The updated generic payment link product data.

data Structure (Object)

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

Errors

200 OK (validation failed)
object
When the request body fails validation, this endpoint still responds with HTTP 200 but sets messages to failed and returns the validator errors in data: { "statusCode": 200, "messages": "failed", "data": { ... } }.
401 Unauthorized
object
Returned when the product does not belong to the authenticated account: { "statusCode": 401, "messages": "Unauthorized" }.
404 Not Found
object
Returned when the product does not exist: { "statusCode": 404, "messages": "Product not found" }.