Payment Ledger
This endpoint is used to retrieve the ledger history specifically associated with a single payment ID.
Every successful payment (paid) will print a credit (funds in) ledger entry into your tenant's balance. The ledger system is append-only, meaning entries are never deleted or modified to maintain financial integrity.
http
GET /v1/payments/{payment_id}/ledgerRequest Parameters
| Parameter | Type | Location | Required | Description |
|---|---|---|---|---|
payment_id | string (UUID) | URL Path | ✅ | The payment ID |
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | ✅ | Bearer {api_key} or Bearer {jwt_token} |
Response
The endpoint returns a list of ledger logs as an array.
Example Request
bash
curl -X GET https://gerbang-pay-api.gai.co.id/v1/payments/550e8400-e29b-41d4-a716-446655440000/ledger \
-H "Authorization: ApiKey gp_live_xxxxxxxxxxxx"Example Response (200 OK)
json
{
"success": true,
"data": [
{
"id": "771e8400-e29b-41d4-a716-446655440000",
"payment_id": "550e8400-e29b-41d4-a716-446655440000",
"tenant_id": "b6a3b2b8-f09d-4767-8fa0-68153c30a91f",
"entry_type": "credit",
"amount": 10000000,
"balance_after": 25000000,
"reference_id": "PAY-123",
"reason": "Payment received from provider",
"created_at": "2026-07-21T11:05:32Z"
}
]
}Array Fields Explanation
| Field | Type | Description |
|---|---|---|
entry_type | string | credit (balance increases) or debit (balance decreases, e.g., during a refund/fee) |
amount | integer | The amount of funds moved (in cents) |
balance_after | integer | The tenant's total final balance after this movement occurred (in cents) |
reason | string | A note regarding why this fund movement occurred |
created_at | string | The time the ledger entry was recorded |