Use this endpoint when onboarding a new billing customer (e.g., sign-up or CRM sync). Ideal for linking via external_id to your app’s user ID.
Request Body
The unique identifier from your system to reference this customer. This is required and should match your internal user or account ID.
The full name or company name of the customer.
The customer’s email address. Must be a valid email format if provided.
The primary address line. Maximum 255 characters.
The secondary address line. Maximum 255 characters.
The city name. Maximum 100 characters.
The state, province, or region name. Maximum 100 characters.
The ZIP code or postal code. Maximum 20 characters.
The two-letter ISO 3166-1 alpha-2 country code (e.g., “US”, “GB”, “CA”).
Additional key-value pairs for storing extra information about the customer.{
"internal_id": "user_12345",
"signup_source": "web"
}
The internal FlexPrice ID of the parent customer for hierarchical customer relationships.
parent_customer_external_id
The external ID of the parent customer from your system. Provide either parent_customer_id or parent_customer_external_id, but not both.
integration_entity_mapping
Provider integration mappings for this customer (e.g., Stripe, Razorpay, PayPal).Show Integration Entity Mapping Object
The integration provider name. Must be one of: stripe, razorpay, paypal.
The external entity ID from the provider.
When true, prevents the customer onboarding workflow from being triggered. Used internally to prevent infinite loops.
Response
The unique FlexPrice customer ID (e.g., cust_abc123).
The external identifier you provided.
The customer’s name or company name.
The customer’s email address.
The parent customer ID if this is a child customer.
Custom metadata key-value pairs.
The environment ID this customer belongs to.
The tenant ID this customer belongs to.
The status of the customer (e.g., published).
ISO 8601 timestamp of when the customer was created.
ISO 8601 timestamp of when the customer was last updated.
The ID of the user who created the customer.
The ID of the user who last updated the customer.
curl -X POST https://api.flexprice.io/v1/customers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_id": "user_12345",
"name": "Acme Corporation",
"email": "billing@acme.com",
"address_line1": "123 Main Street",
"address_city": "San Francisco",
"address_state": "CA",
"address_postal_code": "94105",
"address_country": "US",
"metadata": {
"plan_tier": "enterprise",
"account_manager": "jane_doe"
}
}'
{
"id": "cust_abc123xyz789",
"external_id": "user_12345",
"name": "Acme Corporation",
"email": "billing@acme.com",
"address_line1": "123 Main Street",
"address_line2": "",
"address_city": "San Francisco",
"address_state": "CA",
"address_postal_code": "94105",
"address_country": "US",
"parent_customer_id": null,
"metadata": {
"plan_tier": "enterprise",
"account_manager": "jane_doe"
},
"environment_id": "env_prod_001",
"tenant_id": "tenant_001",
"status": "published",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"created_by": "user_admin",
"updated_by": "user_admin"
}