Credits
Get transaction history
Retrieves the credit transaction history of the authenticated user with pagination.
Pagination
Transactions are returned with pagination:
- limit: Maximum number of transactions to return (default: 50, max: 100)
- offset: Number of transactions to skip (default: 0)
Transactions are sorted by creation date descending (most recent first).
Transaction Types
Transactions can be of different types:
- purchase: Credit purchase via Stripe
- consumption: Credit consumption for a payment
- expiration: Credit expiration (if applicable)
- refund: Credit refund
- adjustment: Manual adjustment by an administrator
Amount Format
Amounts are in cents:
- Positive amount for purchases and additions
- Negative amount for consumptions
Multi-Tenant Isolation
The returned transactions are automatically filtered by:
- tenant_id extracted from the JWT
- user_id extracted from the JWT (claim sub)
A user can only see their own transactions, and only within their tenant.
Usage Example
# Retrieve the first 20 transactions
curl -X GET "https://api.faireplace.com/v1/credits/transactions?limit=20&offset=0" \
-H "Authorization: Bearer YOUR_API_KEY"
# Retrieve the next transactions (pagination)
curl -X GET "https://api.faireplace.com/v1/credits/transactions?limit=20&offset=20" \
-H "Authorization: Bearer YOUR_API_KEY"
Response:
{
"transactions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"amount": 1000,
"transaction_type": "purchase",
"reason": "Credit purchase via Stripe Checkout Session cs_test_123",
"balance_before": 2000,
"balance_after": 3000,
"created_at": "2026-01-28T10:30:00Z"
},
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"amount": -2990,
"transaction_type": "consumption",
"reason": "Consumption for lease signing lease_789",
"balance_before": 5000,
"balance_after": 2010,
"created_at": "2026-01-27T15:20:00Z"
}
],
"total": 2,
"limit": 20,
"offset": 0
}
get/credits/transactions
Request
- Base URL: https://api.faireplace.com/api
- URL: https://api.faireplace.com/api/credits/transactions
- Auth: HTTP bearer
Query parameters
limitinteger
Maximum number of transactions to return.
- Default: 50
- Maximum: 100
- Minimum: 1
offsetinteger
Offset for pagination (number of transactions to skip).
- Default: 0
- Minimum: 0
Response
Transaction history retrieved successfully.
Always returns an array (empty if the user has never had transactions).
Example response
{
"transactions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"amount": 1000,
"transaction_type": "purchase",
"reason": "Credit purchase via Stripe Checkout Session cs_test_123",
"balance_before": 2000,
"balance_after": 3000,
"created_at": "2026-01-28T10:30:00Z"
}
],
"total": 10,
"limit": 50
}Changes
No recorded changes to this operation across all 1 revision of this API.