Skip to content

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}/ledger

Request Parameters

ParameterTypeLocationRequiredDescription
payment_idstring (UUID)URL PathThe payment ID

Request Headers

HeaderTypeRequiredDescription
AuthorizationstringBearer {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

FieldTypeDescription
entry_typestringcredit (balance increases) or debit (balance decreases, e.g., during a refund/fee)
amountintegerThe amount of funds moved (in cents)
balance_afterintegerThe tenant's total final balance after this movement occurred (in cents)
reasonstringA note regarding why this fund movement occurred
created_atstringThe time the ledger entry was recorded

Gerbang Pay API Documentation