CRUD Operations
Create
curl -X POST https://api.fluxrate.co/api/v1/customers \
-H "Content-Type: application/json" \
-H "Cookie: access_token=<token>" \
-d '{
"name": "Acme Corp",
"email": "billing@acme.com",
"external_id": "acme-corp-001"
}'
Read
# Get by ID
GET /api/v1/customers/<customer_id>
# List with pagination
GET /api/v1/customers?page=1&page_size=20
Update
curl -X PUT https://api.fluxrate.co/api/v1/customers/<customer_id> \
-H "Content-Type: application/json" \
-H "Cookie: access_token=<token>" \
-d '{
"name": "Acme Corporation",
"billing_address_country": "US",
"billing_address_state": "CA"
}'
Delete
DELETE /api/v1/customers/<customer_id>
Deleting a customer is permanent and will cascade-delete their subscriptions and associated data. Consider marking customers as inactive instead of deleting them.
Customer Response Object
{
"id": "550e8400-...",
"organization_id": "...",
"name": "Acme Corp",
"email": "billing@acme.com",
"external_id": "acme-corp-001",
"phone": "+1-555-0100",
"billing_address_line1": "123 Main St",
"billing_address_city": "San Francisco",
"billing_address_state": "CA",
"billing_address_country": "US",
"billing_address_postal_code": "94105",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
All list endpoints support pagination:
| Parameter | Default | Description |
|---|
page | 1 | Page number (1-indexed) |
page_size | 20 | Items per page (max 100) |
Response includes:
{
"data": [...],
"meta": {
"page": 1,
"page_size": 20,
"total": 342,
"total_pages": 18
}
}