Base URL
The FlexPrice API is available at the following base URLs depending on your deployment:All API endpoints are prefixed with
/v1 to indicate the API version. Make sure to include this in your requests.API Characteristics
REST Principles
The FlexPrice API follows REST conventions:- Uses standard HTTP methods (
GET,POST,PUT,DELETE) - Returns appropriate HTTP status codes
- Accepts and returns JSON payloads
- Uses resource-oriented URLs
Request Format
AllPOST and PUT requests should include a Content-Type: application/json header and JSON-formatted body.
Example Request
Response Format
All API responses return JSON with a consistent structure. Successful responses include the requested data:Success Response
API Resources
The FlexPrice API is organized around key resources:Core Billing
- Customers - Manage customer accounts and billing information
- Plans - Define pricing plans and billing models
- Subscriptions - Manage customer subscriptions to plans
- Invoices - Generate and manage invoices
- Payments - Process and track payments
Metering & Usage
- Events - Ingest usage events for billing
- Meters - Define what to measure and how
- Features - Manage feature flags and limits
- Entitlements - Control customer access to features
Pricing
- Prices - Define pricing models (per-unit, tiered, volume)
- Price Units - Units of measurement (API calls, GB, seats)
- Addons - Optional add-ons to plans
- Coupons - Discount codes and promotions
Credits & Wallets
- Wallets - Prepaid credit balances
- Credit Grants - Allocate credits to customers
- Credit Notes - Issue refunds or credits
Configuration
- Environments - Manage production and test environments
- Secrets - API keys and integration credentials
- Webhooks - Event notifications and integrations
Rate Limits
FlexPrice implements rate limiting to ensure API stability. Rate limit information is included in response headers:X-RateLimit-Limit- Maximum requests allowed per windowX-RateLimit-Remaining- Requests remaining in current windowX-RateLimit-Reset- Time when the rate limit resets
429 Too Many Requests status code.
Idempotency
For safe retries, include anIdempotency-Key header with a unique value (UUID recommended) in POST requests. The API will return the same result for requests with the same idempotency key:
Idempotent Request
Versioning
The current API version isv1, indicated by the /v1 prefix in all endpoints. Breaking changes will be introduced in new API versions while maintaining backward compatibility for existing versions.
SDKs & Tools
FlexPrice provides official SDKs and tools:- Go SDK -
github.com/flexprice/go-sdk - Python SDK -
pip install flexprice - TypeScript/JavaScript SDK -
npm i @flexprice/sdk - MCP Server -
npm i @flexprice/mcp-server
SDKs are automatically generated from the OpenAPI specification and include type safety, automatic retries, and idiomatic patterns for each language.
OpenAPI Specification
The complete API specification is available in OpenAPI 3.0 format:View OpenAPI Spec
Next Steps
Authentication
Learn how to authenticate API requests
Error Handling
Understand error codes and formats
Pagination
Work with paginated list responses
Swagger UI
Explore the interactive API documentation