cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/customers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"external_id": "<string>",
"name": "<string>",
"address_city": "<string>",
"address_country": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"address_postal_code": "<string>",
"address_state": "<string>",
"billing_currency": "<string>",
"contact": "<string>",
"contact_persons": [
{
"first_name": "<string>",
"department": "<string>",
"designation": "<string>",
"email": "<string>",
"id": "<string>",
"is_primary": true,
"last_name": "<string>",
"mobile": "<string>",
"salutation": "<string>"
}
],
"email": "<string>",
"integration_entity_mapping": [
{
"entity_id": "<string>",
"provider_entity_id": "<string>",
"provider_type": "<string>",
"metadata": {}
}
],
"metadata": {},
"onboarding_workflow_name": "<string>",
"skip_onboarding_workflow": true,
"tax_rate_overrides": [
{
"currency": "<string>",
"tax_rate_code": "<string>",
"auto_apply": true,
"metadata": {},
"priority": 123
}
],
"timezone": "<string>"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.customers.create_customer(external_id="<id>", name="<value>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.customers.createCustomer({
externalId: "<id>",
name: "<value>",
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Customers.CreateCustomer(ctx, types.CreateCustomerRequest{
ExternalID: "<id>",
Name: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.CustomerResponse != nil {
// handle response
}
}{
"address_city": "<string>",
"address_country": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"address_postal_code": "<string>",
"address_state": "<string>",
"billing_currency": "<string>",
"contact": "<string>",
"contact_persons": [
{
"first_name": "<string>",
"department": "<string>",
"designation": "<string>",
"email": "<string>",
"id": "<string>",
"is_primary": true,
"last_name": "<string>",
"mobile": "<string>",
"salutation": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"email": "<string>",
"environment_id": "<string>",
"external_id": "<string>",
"id": "<string>",
"integrations": [
{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"entity_id": "<string>",
"entity_type": "customer",
"environment_id": "<string>",
"id": "<string>",
"metadata": {},
"provider_entity_id": "<string>",
"provider_type": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"metadata": {},
"name": "<string>",
"status": "published",
"tax_treatment": "taxable",
"tenant_id": "<string>",
"timezone": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Customers
Create customer
Use when onboarding a new billing customer (e.g. sign-up or CRM sync). Ideal for linking via external_customer_id to your app’s user id.
POST
/
customers
cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/customers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"external_id": "<string>",
"name": "<string>",
"address_city": "<string>",
"address_country": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"address_postal_code": "<string>",
"address_state": "<string>",
"billing_currency": "<string>",
"contact": "<string>",
"contact_persons": [
{
"first_name": "<string>",
"department": "<string>",
"designation": "<string>",
"email": "<string>",
"id": "<string>",
"is_primary": true,
"last_name": "<string>",
"mobile": "<string>",
"salutation": "<string>"
}
],
"email": "<string>",
"integration_entity_mapping": [
{
"entity_id": "<string>",
"provider_entity_id": "<string>",
"provider_type": "<string>",
"metadata": {}
}
],
"metadata": {},
"onboarding_workflow_name": "<string>",
"skip_onboarding_workflow": true,
"tax_rate_overrides": [
{
"currency": "<string>",
"tax_rate_code": "<string>",
"auto_apply": true,
"metadata": {},
"priority": 123
}
],
"timezone": "<string>"
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.customers.create_customer(external_id="<id>", name="<value>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.customers.createCustomer({
externalId: "<id>",
name: "<value>",
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Customers.CreateCustomer(ctx, types.CreateCustomerRequest{
ExternalID: "<id>",
Name: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.CustomerResponse != nil {
// handle response
}
}{
"address_city": "<string>",
"address_country": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"address_postal_code": "<string>",
"address_state": "<string>",
"billing_currency": "<string>",
"contact": "<string>",
"contact_persons": [
{
"first_name": "<string>",
"department": "<string>",
"designation": "<string>",
"email": "<string>",
"id": "<string>",
"is_primary": true,
"last_name": "<string>",
"mobile": "<string>",
"salutation": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"email": "<string>",
"environment_id": "<string>",
"external_id": "<string>",
"id": "<string>",
"integrations": [
{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"entity_id": "<string>",
"entity_type": "customer",
"environment_id": "<string>",
"id": "<string>",
"metadata": {},
"provider_entity_id": "<string>",
"provider_type": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}
],
"metadata": {},
"name": "<string>",
"status": "published",
"tax_treatment": "taxable",
"tenant_id": "<string>",
"timezone": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Body
application/json
Customer
Request object for creating a new customer in the system
Response
Created
Customer response object containing all customer information

