List credit transactions
GET
/api/v1/credits/transactions
Authentication
Bearer Token API Key (cookie: better-auth.session_token)
Responses
200
Credit transaction history
application/jsontransactions
object[]
REQUIRED
Array of:
id
string
REQUIRED
user_id
string
REQUIRED
type
string
REQUIRED
Enum:
purchase, auto_topoff, deduct, refund, bonusamount
number
REQUIRED
balance_after
number
REQUIRED
pack_id
string | null
REQUIRED
description
string | null
REQUIRED
created_at
string
REQUIRED
401
Unauthorized
curl -X GET 'https://littledemo.com/api/v1/credits/transactions' \ -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://littledemo.com/api/v1/credits/transactions', { method: 'GET', headers: { "Authorization": "Bearer YOUR_API_TOKEN" }});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.get('https://littledemo.com/api/v1/credits/transactions', headers=headers)print(response.json())
200
Response
{ "transactions": [ { "id": "<string>", "user_id": "<string>", "type": "purchase", "amount": 123, "balance_after": 123, "pack_id": "<string>", "description": "<string>", "created_at": "<string>" } ]}
API Playground
Try this endpoint
GET
/api/v1/credits/transactions