Credits

List available credit packages

Retrieves the list of credit packages available for purchase for the tenant.

Filtering

By default, only active packages are returned. To include inactive packages, use active_only=false.

Sorting

Packages are sorted by:

  1. display_order ascending (configured display order)
  2. Creation date ascending (in case of display_order tie)

Multi-Tenant Isolation

The returned packages are automatically filtered by:

  • tenant_id extracted from the JWT

Each tenant can have its own configured credit packages.

Prerequisites for Purchase

For a package to be purchasable, it must:

  • Be active (active: true)
  • Have a stripe_price_id configured
  • Belong to the user's tenant

Usage Example

# List only active packages (default)
curl -X GET "https://api.faireplace.com/v1/credits/packages" \
  -H "Authorization: Bearer YOUR_API_KEY"

# List all packages (active and inactive)
curl -X GET "https://api.faireplace.com/v1/credits/packages?active_only=false" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response:

{
  "packages": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Pack Starter",
      "description": "Starter pack ideal for small landlords",
      "credits_amount": 1000,
      "price_cents": 2990,
      "active": true,
      "display_order": 1
    },
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Pack Pro",
      "description": "Professional pack for active landlords",
      "credits_amount": 5000,
      "price_cents": 12990,
      "active": true,
      "display_order": 2
    },
    {
      "id": "550e8400-e29b-41d4-a716-446655440002",
      "name": "Pack Business",
      "description": "Business pack for large portfolio owners",
      "credits_amount": 20000,
      "price_cents": 49990,
      "active": true,
      "display_order": 3
    }
  ]
}
get/credits/packages

Request

  • Base URL: https://api.faireplace.com/api
  • URL: https://api.faireplace.com/api/credits/packages
  • Auth: HTTP bearer

Query parameters

active_onlyboolean

Filter only active packages.

  • Default: true (only active packages are returned)
  • false: Also include inactive packages

Inactive packages cannot be purchased but may be visible for traceability or administration purposes.

Response

Package list retrieved successfully.

Always returns an array (empty if no packages are configured for the tenant).

Example response

{
  "packages": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Pack Starter",
      "description": "Starter pack ideal for small landlords",
      "credits_amount": 1000,
      "price_cents": 2990,
      "active": true,
      "display_order": 1
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.