Skip to content

Success responses

What a successful request answers with: the status code and the body, for each kind of operation.


Every successful request returns a 2xx status and a JSON body with two parts: data and meta.

{
"data": { … },
"meta": { "request_id": "req_Hy3k9QzT2LmN8vXa" }
}
Part What it holds
data The requested object, or an array of objects for a list
meta The request_id; for a list, it also contains pagination

Errors use the same meta object alongside error: see Errors. Read the request ID from meta.request_id in either response.

Operation Status data
Get one (GET /v1/payments/{id}) 200 The object
List (GET /v1/payments) 200 An array, with meta.pagination, see Pagination
Create (POST /v1/payments, POST /v1/payment-links, POST /v1/invoices) 201 The new object
Action (POST /v1/payments/{id}/cancel, POST /v1/payment-links/{id}/cancel, POST /v1/invoices/{id}/issue, or a simulation) 200 The object after the action
Update (PATCH /v1/webhook-endpoints/{id}) 200 The updated object
Create a webhook endpoint 201 The endpoint, with its secret: the secret is in this answer only
Delete a webhook endpoint or a draft invoice 200 The deleted object’s ID and "deleted": true
HTTP/1.1 200 OK
x-request-id: req_Hy3k9QzT2LmN8vXa
{
"data": {
"id": "pay_01k7q3m8x2v5t9n4b6c1d0e7fa",
"status": "paid",
"amount": 1000000,
"currency": "IDR"
},
"meta": { "request_id": "req_Hy3k9QzT2LmN8vXa" }
}

A list is an array in data. Use meta.pagination to check whether another page is available:

{
"data": [ { "id": "pay_01k7q3m8x2v5t9n4b6c1d0e7fa", "status": "paid" } ],
"meta": {
"request_id": "req_Hy3k9QzT2LmN8vXa",
"pagination": { "per_page": 20, "has_more": false, "next": null }
}
}

Creation returns 201 with the new object in data. For a payment, instruction contains the details the payer needs to complete it:

{
"data": {
"id": "pay_01k7q3m8x2v5t9n4b6c1d0e7fa",
"status": "pending",
"instruction": { "type": "qr", "qr_content": "…", "expires_at": "2026-10-26T03:19:05.000Z" }
},
"meta": { "request_id": "req_Hy3k9QzT2LmN8vXa" }
}

Creating a webhook endpoint adds the signing secret to the endpoint in data: data.secret.

Deleting a webhook endpoint or draft invoice returns 200 with the deleted object’s ID:

{
"data": { "id": "<deleted-object-id>", "deleted": true },
"meta": { "request_id": "req_Hy3k9QzT2LmN8vXa" }
}

Every response includes an x-request-id header whose value matches meta.request_id. A retry with the same Idempotency-Key returns the stored answer and includes Idempotent-Replayed: true; its request_id identifies the retry. See Idempotency. The X-RateLimit-* headers show your current rate limit usage; see Rate limits.

A request that fails answers with a 4xx or 5xx status and the error shape of Errors.