curl --request GET \
--url https://us.api.flexprice.io/v1/customers/external/{external_id} \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.customers.get_customer_by_external_id(external_id="<id>")
# 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.getCustomerByExternalId("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Customers.GetCustomerByExternalID(ctx, "<id>")
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>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Get customer by external ID
Use when resolving a customer by your app’s id (e.g. from your user table). Ideal for integrations that key by external id.
curl --request GET \
--url https://us.api.flexprice.io/v1/customers/external/{external_id} \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.customers.get_customer_by_external_id(external_id="<id>")
# 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.getCustomerByExternalId("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Customers.GetCustomerByExternalID(ctx, "<id>")
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>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Path Parameters
Customer External ID
Response
OK
Customer response object containing all customer information
AddressCity is the city of the customer's address
AddressCountry is the country of the customer's address (ISO 3166-1 alpha-2)
AddressLine1 is the first line of the customer's address
AddressLine2 is the second line of the customer's address
AddressPostalCode is the postal code of the customer's address
AddressState is the state of the customer's address
BillingCurrency is the fiat currency invoices are issued in; nil means charge currency is used as-is.
Contact is an optional contact number for the customer (e.g. phone)
Show child attributes
Show child attributes
Email is the email of the customer
EnvironmentID is the environment identifier for the customer
ExternalID is the external identifier for the customer
ID is the unique identifier for the customer
Show child attributes
Show child attributes
Metadata
Show child attributes
Show child attributes
Name is the name of the customer
published, deleted, archived taxable, exempt Timezone is the customer's IANA timezone name (e.g. "Asia/Kolkata"). Defaults to "UTC". Inherited by subscriptions at creation time.

