Skip to main content

Create or update a customer

Route

POST
/api/v1/customers

Usage

LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"

curl --location --request POST "$LAGO_URL/api/v1/customers" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"customer": {
"customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"city": "Woodland Hills",
"country": "US",
"email": "dinesh@piedpiper.test",
"legal_name": "Coleman-Blair",
"legal_number": "49-008-2965",
"logo_url": "http://hooli.com/logo.png",
"name": "Gavin Belson",
"phone": "1-171-883-3711 x245",
"state": "CA",
"url": "http://hooli.com",
"vat_rate": 12.5,
"zipcode": "91364",
"billing_configuration": {
"payment_provider": "stripe",
"provider_customer_id": "cus_12345",
"sync": true
}
}
}'

Arguments

{
"customer": {
"customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"city": "Woodland Hills",
"country": "US",
"email": "dinesh@piedpiper.test",
"legal_name": "Coleman-Blair",
"legal_number": "49-008-2965",
"logo_url": "http://hooli.com/logo.png",
"name": "Gavin Belson",
"phone": "1-171-883-3711 x245",
"state": "CA",
"url": "http://hooli.com",
"vat_rate": 12.5,
"zipcode": "91364",
"billing_configuration": {
"payment_provider": "stripe",
"provider_customer_id": "cus_12345",
"sync": true
}
}
}
info

If the customer already exists, the call will work as an update

AttributesTypeDescription
customer_idString      RequiredCustomer unique identifier in your application
address_line1String      OptionalFirst line of the billing address
address_line2String      OptionalSecond line of the billing address
cityString      OptionalCity of the customer's billing address
countryString      Optional
ISO 3166 alpha 2 Country code.
Country code of the customer's billing address
emailString      OptionalEmail of the customer
legal_nameString      OptionalLegal company name of the customer
legal_numberString      OptionalLegal company number of the customer
logo_urlString      OptionalLogo URL of the customer
nameString      RequiredFull name of the customer
phoneString      OptionalPhone number of the customer
stateString      OptionalState of the customer's billing address
urlString      OptionalCustom URL of the customer
vat_rateFloat      OptionalCustom VAT applied to the customer.
It will override the one defined at organization level
zipcodeString      OptionalZipcode of the customer's billing address
billing_configurationObject      OptionalPayment provider specific configuration used to bill the customer

Billing configuration

AttributesTypeDescription
payment_providerString      OptionalPayment provider used to bill the customer.
Only accepted value: stripe
provider_customer_idString      OptionalCustomer ID on the payment provider.
If not provided, Lago can optionally create the provider customer
syncBoolean      OptionalSet to true is you want to create the provider customer synchronously with the customer creation.
Apply only when provider_customer_id is null and payment provider is configured to create customer.
Default value: false

Responses

The customer was succesfuly created or updated.

Returns a customer object.