Documentation

API Documentation

RESTful API documentation for developers

Quick Info
Base URL
https://api.lotstech.com
Authentication

API Key (Bearer token or X-API-Key header)

Total Endpoints

12

Getting Started

Authentication

All API requests require authentication using an API key. You can create an API key from your dashboard.

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.lotstech.com/api/v1/lotstech/entitlements/acquire

billing

POST
/api/v1/lotstech/entitlements/acquire

Acquire Resource Entitlement

lotstech_entitlement_acquire

Atomically acquire a named resource and assess its current UTC service day.

POST
/api/v1/lotstech/create-checkout-link

Create Checkout Link

lotstech_create_checkout_link

Create a Polar checkout link for product purchase. Returns a checkout URL where users can complete payment. Supports monthly, yearly, and one-time (lifetime) billing cycles. For credits products with custom pricing ("Pay What You Want"), pass custom_amount to pre-fill the amount. The checkout link includes user email pre-fill and custom metadata for tracking.

POST
/api/v1/lotstech/create-customer-portal-link

Create Customer Portal Link

lotstech_create_customer_portal_link

Create a Polar customer portal link for the signed-in user's paid plan, where they can upgrade, downgrade, switch billing cycle or cancel. Returns { available: false } for gift or credits-only accounts.

GET
/api/v1/lotstech/project-products

Get Project Products

lotstech_get_project_products

Get all available products for a specific project (SaaS). Returns product listings with pricing details for monthly, yearly, and one-time purchases.

GET
/api/v1/lotstech/user-subscription

Get User Subscription

lotstech_get_user_subscription

Get the authenticated user's active subscription for a specific project. Returns subscription status, billing cycle, and product details.

GET
/api/v1/lotstech/entitlements

List Resource Entitlements

lotstech_entitlement_resources

List active resource holdings owned by the authenticated payer.

POST
/api/v1/lotstech/entitlements/project

Project Resource Entitlements

lotstech_entitlement_projection

Project every held resource against the contract active at a timestamp; use for cancellation and renewal previews.

POST
/api/v1/lotstech/entitlements/quote

Quote Resource Entitlement

lotstech_entitlement_quote

Quote plan coverage and credit-funded overflow without changing state.

POST
/api/v1/lotstech/entitlements/release

Release Resource Entitlement

lotstech_entitlement_release_v2

Release a named resource; future daily billing stops and the product resource is not deleted.

credits

POST
/api/v1/lotstech/deduct-user-credits

Deduct User Credits

lotstech_deduct_user_credits

Deduct credits from the authenticated user's balance for feature usage. Validates sufficient balance before deduction. Automatically calculates balance_after and sets transaction_type to 'usage'. Supports reference_type and reference_id for linking to external records.

GET
/api/v1/lotstech/credit-history

Get Credit History

lotstech_get_credit_history

Get the authenticated user's credit transaction history with pagination. Can optionally filter by project_id to show only transactions for a specific SaaS. Returns all credit transactions including purchases, usage, refunds, bonuses, and admin adjustments. Shows which project consumed credits and when.

GET
/api/v1/lotstech/user-credits

Get User Credits

lotstech_get_user_credits

Get the authenticated user's current credit balance. Credits are shared across all LOTS products and never expire.