Skip to main content
curl --request GET 'https://api.mayar.id/hl/v2/credit/customer/paginate-credit-history/a1b2c3d4-e5f6-4789-a012-3456789abcde?productId=7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f&page=1&limit=10' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here'
{
    "statusCode": 200,
    "messages": "success",
    "data": [
        {
            "id": "f1e2d3c4-b5a6-4789-9012-3456789abcdef",
            "datetime": "2026-06-20T09:10:57.994Z",
            "type": "CREDIT_USAGE",
            "amount": 10000,
            "balanceBefore": 60000,
            "balanceAfter": 50000,
            "walletType": "MAIN",
            "description": "Credit usage for product order",
            "customerId": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
            "productId": "7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
        },
        {
            "id": "a1b2c3d4-e5f6-4789-9012-3456789abcdef",
            "datetime": "2026-06-19T15:30:00.000Z",
            "type": "MERCHANT_TOPUP",
            "amount": 50000,
            "balanceBefore": 10000,
            "balanceAfter": 60000,
            "walletType": "ADD_ON",
            "description": "Merchant top-up",
            "customerId": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
            "productId": "7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f"
        }
    ],
    "metadata": {
        "page": 1,
        "limit": 10,
        "totalPages": 1,
        "totalData": 2
    }
}
Endpoint:
https://api.mayar.id/hl/v2/credit/customer/paginate-credit-history/(customerId)?productId=(productId)&page=1&limit=10

Authorization

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

Path Parameters

customerId
string
required
The unique identifier of the customer whose credit history you want to retrieve.

Query Parameters

productId
string
required
The unique identifier of the product to filter credit history by.
membershipTierId
string
The unique identifier of the membership tier to filter by.
page
integer
default:"1"
Page number for pagination.
limit
integer
default:"10"
Number of records per page.
sortField
string
default:"datetime"
Field to sort by (for example datetime, amount).
sortOrder
string
default:"desc"
Sort order: asc or desc.
startDate
string
Start date filter (ISO 8601 format).
endDate
string
End date filter (ISO 8601 format).
walletType
string
Filter by wallet type: MEMBERSHIP, ADD_ON, or MAIN.
type
string
Filter by transaction type: TOPUP, MERCHANT_TOPUP, TRIAL_TOPUP, EXPIRE_VOID, CREDIT_USAGE.

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code from the API.
messages
string
Status message that describes the status code.
data
array of object
Array of credit transaction records.
metadata
object
Pagination metadata containing page, limit, totalPages, and totalData.

data Structure (Array Of Object)

id
string<uuid>
Unique identifier of the credit transaction.
datetime
string
ISO 8601 timestamp (UTC) of the transaction.
type
string
Transaction type: TOPUP, MERCHANT_TOPUP, TRIAL_TOPUP, EXPIRE_VOID, or CREDIT_USAGE.
amount
integer
The amount of credit involved in the transaction.
balanceBefore
integer
Customer balance before the transaction.
balanceAfter
integer
Customer balance after the transaction.
walletType
string
Wallet type affected: MAIN, MEMBERSHIP, or ADD_ON.
description
string
Description of the transaction.
customerId
string<uuid>
Customer identifier associated with the transaction.
productId
string<uuid>
Product identifier associated with the transaction.

Errors

400 Invalid query parameters
object
Returned when required parameters are missing or fail validation.
404 Customer not found
object
Returned when the specified customer is not found.