Skip to main content
POST
/
customers
Create customer
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>",
  "address_city": "<string>",
  "address_country": "<string>",
  "address_line1": "<string>",
  "address_line2": "<string>",
  "address_postal_code": "<string>",
  "address_state": "<string>",
  "email": "<string>",
  "integration_entity_mapping": [
    {
      "entity_id": "<string>",
      "provider_entity_id": "<string>",
      "provider_type": "<string>",
      "metadata": {}
    }
  ],
  "metadata": {},
  "name": "<string>",
  "skip_onboarding_workflow": true,
  "tax_rate_overrides": [
    {
      "currency": "<string>",
      "tax_rate_code": "<string>",
      "auto_apply": true,
      "metadata": {},
      "priority": 123
    }
  ],
  "timezone": "<string>"
}
'
import requests

url = "https://us.api.flexprice.io/v1/customers"

payload = {
"external_id": "<string>",
"address_city": "<string>",
"address_country": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"address_postal_code": "<string>",
"address_state": "<string>",
"email": "<string>",
"integration_entity_mapping": [
{
"entity_id": "<string>",
"provider_entity_id": "<string>",
"provider_type": "<string>",
"metadata": {}
}
],
"metadata": {},
"name": "<string>",
"skip_onboarding_workflow": True,
"tax_rate_overrides": [
{
"currency": "<string>",
"tax_rate_code": "<string>",
"auto_apply": True,
"metadata": {},
"priority": 123
}
],
"timezone": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: '<string>',
address_city: '<string>',
address_country: '<string>',
address_line1: '<string>',
address_line2: '<string>',
address_postal_code: '<string>',
address_state: '<string>',
email: '<string>',
integration_entity_mapping: [
{
entity_id: '<string>',
provider_entity_id: '<string>',
provider_type: '<string>',
metadata: {}
}
],
metadata: {},
name: '<string>',
skip_onboarding_workflow: true,
tax_rate_overrides: [
{
currency: '<string>',
tax_rate_code: '<string>',
auto_apply: true,
metadata: {},
priority: 123
}
],
timezone: '<string>'
})
};

fetch('https://us.api.flexprice.io/v1/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://us.api.flexprice.io/v1/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => '<string>',
'address_city' => '<string>',
'address_country' => '<string>',
'address_line1' => '<string>',
'address_line2' => '<string>',
'address_postal_code' => '<string>',
'address_state' => '<string>',
'email' => '<string>',
'integration_entity_mapping' => [
[
'entity_id' => '<string>',
'provider_entity_id' => '<string>',
'provider_type' => '<string>',
'metadata' => [

]
]
],
'metadata' => [

],
'name' => '<string>',
'skip_onboarding_workflow' => true,
'tax_rate_overrides' => [
[
'currency' => '<string>',
'tax_rate_code' => '<string>',
'auto_apply' => true,
'metadata' => [

],
'priority' => 123
]
],
'timezone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://us.api.flexprice.io/v1/customers"

payload := strings.NewReader("{\n \"external_id\": \"<string>\",\n \"address_city\": \"<string>\",\n \"address_country\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"address_postal_code\": \"<string>\",\n \"address_state\": \"<string>\",\n \"email\": \"<string>\",\n \"integration_entity_mapping\": [\n {\n \"entity_id\": \"<string>\",\n \"provider_entity_id\": \"<string>\",\n \"provider_type\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"metadata\": {},\n \"name\": \"<string>\",\n \"skip_onboarding_workflow\": true,\n \"tax_rate_overrides\": [\n {\n \"currency\": \"<string>\",\n \"tax_rate_code\": \"<string>\",\n \"auto_apply\": true,\n \"metadata\": {},\n \"priority\": 123\n }\n ],\n \"timezone\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://us.api.flexprice.io/v1/customers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"<string>\",\n \"address_city\": \"<string>\",\n \"address_country\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"address_postal_code\": \"<string>\",\n \"address_state\": \"<string>\",\n \"email\": \"<string>\",\n \"integration_entity_mapping\": [\n {\n \"entity_id\": \"<string>\",\n \"provider_entity_id\": \"<string>\",\n \"provider_type\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"metadata\": {},\n \"name\": \"<string>\",\n \"skip_onboarding_workflow\": true,\n \"tax_rate_overrides\": [\n {\n \"currency\": \"<string>\",\n \"tax_rate_code\": \"<string>\",\n \"auto_apply\": true,\n \"metadata\": {},\n \"priority\": 123\n }\n ],\n \"timezone\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://us.api.flexprice.io/v1/customers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"<string>\",\n \"address_city\": \"<string>\",\n \"address_country\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"address_postal_code\": \"<string>\",\n \"address_state\": \"<string>\",\n \"email\": \"<string>\",\n \"integration_entity_mapping\": [\n {\n \"entity_id\": \"<string>\",\n \"provider_entity_id\": \"<string>\",\n \"provider_type\": \"<string>\",\n \"metadata\": {}\n }\n ],\n \"metadata\": {},\n \"name\": \"<string>\",\n \"skip_onboarding_workflow\": true,\n \"tax_rate_overrides\": [\n {\n \"currency\": \"<string>\",\n \"tax_rate_code\": \"<string>\",\n \"auto_apply\": true,\n \"metadata\": {},\n \"priority\": 123\n }\n ],\n \"timezone\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "address_city": "<string>",
  "address_country": "<string>",
  "address_line1": "<string>",
  "address_line2": "<string>",
  "address_postal_code": "<string>",
  "address_state": "<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>",
      "environment_id": "<string>",
      "id": "<string>",
      "metadata": {},
      "provider_entity_id": "<string>",
      "provider_type": "<string>",
      "tenant_id": "<string>",
      "updated_at": "2023-11-07T05:31:56Z",
      "updated_by": "<string>"
    }
  ],
  "metadata": {},
  "name": "<string>",
  "tenant_id": "<string>",
  "timezone": "<string>",
  "updated_at": "2023-11-07T05:31:56Z",
  "updated_by": "<string>"
}
{
"http_status_code": 123,
"message": "<string>"
}
{
"http_status_code": 123,
"message": "<string>"
}

Authorizations

x-api-key
string
header
required

Enter your API key in the format x-api-key <api-key>*

Body

application/json

Customer

Request object for creating a new customer in the system

external_id
string
required

external_id is the unique identifier from your system to reference this customer (required)

address_city
string

address_city is the city name with maximum 100 characters

Maximum string length: 100
address_country
string

address_country is the two-letter ISO 3166-1 alpha-2 country code

address_line1
string

address_line1 is the primary address line with maximum 255 characters

Maximum string length: 255
address_line2
string

address_line2 is the secondary address line with maximum 255 characters

Maximum string length: 255
address_postal_code
string

address_postal_code is the ZIP code or postal code with maximum 20 characters

Maximum string length: 20
address_state
string

address_state is the state, province, or region name with maximum 100 characters

Maximum string length: 100
email
string

email is the customer's email address and must be a valid email format if provided

integration_entity_mapping
object[]

integration_entity_mapping contains provider integration mappings for this customer

metadata
object

metadata contains additional key-value pairs for storing extra information

name
string

name is the full name or company name of the customer

skip_onboarding_workflow
boolean

skip_onboarding_workflow when true, prevents the customer onboarding workflow from being triggered This is used internally when a customer is created via a workflow to prevent infinite loops Default: false

tax_rate_overrides
object[]

tax_rate_overrides contains tax rate configurations to be linked to this customer

timezone
string

timezone is the customer's IANA timezone name (e.g. "Asia/Kolkata", "America/New_York") Defaults to "UTC" if not provided

Response

Created

Customer response object containing all customer information

address_city
string

AddressCity is the city of the customer's address

address_country
string

AddressCountry is the country of the customer's address (ISO 3166-1 alpha-2)

address_line1
string

AddressLine1 is the first line of the customer's address

address_line2
string

AddressLine2 is the second line of the customer's address

address_postal_code
string

AddressPostalCode is the postal code of the customer's address

address_state
string

AddressState is the state of the customer's address

created_at
string<date-time>
created_by
string
email
string

Email is the email of the customer

environment_id
string

EnvironmentID is the environment identifier for the customer

external_id
string

ExternalID is the external identifier for the customer

id
string

ID is the unique identifier for the customer

integrations
object[]
metadata
object

Metadata

name
string

Name is the name of the customer

status
enum<string>
Available options:
published,
deleted,
archived
tenant_id
string
timezone
string

Timezone is the customer's IANA timezone name (e.g. "Asia/Kolkata"). Defaults to "UTC". Inherited by subscriptions at creation time.

updated_at
string<date-time>
updated_by
string