Customers
Create a customer
This API let’s you to create customers and corresponding accounts.
POST
/
customers
curl --request POST \
--url https://api.togai.com/customers \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"name": "ACME Enterprise",
"primaryEmail": "admin@example.com",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"settings": [
{
"id": "customerSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
],
"account": {
"id": "ACC00001",
"name": "Primary Account",
"invoiceCurrency": "USD",
"aliases": [
"acme_primary",
"admin@example.com"
],
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
]
}
}'
{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"name": "ACME Enterprise",
"primaryEmail": "admin@example.com",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"settings": [
{
"id": "customerSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
],
"account": {
"id": "G234DZZKBKACATFFGVGEMERFH",
"name": "ACME Enterprise - Account",
"invoiceCurrency": "USD",
"status": "ACTIVE",
"aliases": [
{
"alias": "G234DZZKBKACATFFGVGEMERFH",
"status": "ACTIVE"
}
],
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
]
}
}
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
id
string
requiredCustomer identifier
name
string
requiredName of the Customer
primaryEmail
string
requiredPrimary email of the customer
address
object
requiredbilling address of the customer
settings
object[]
account
object
Payload to create account
Response
201 - application/json
id
string
requiredIdentifier of customer
name
string
requiredName of the Customer
primaryEmail
string
requiredPrimary email of the customer
billingAddress
string
address
object
billing address of the customer
settings
object[]
account
object
Structure of an account
curl --request POST \
--url https://api.togai.com/customers \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"name": "ACME Enterprise",
"primaryEmail": "admin@example.com",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"settings": [
{
"id": "customerSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
],
"account": {
"id": "ACC00001",
"name": "Primary Account",
"invoiceCurrency": "USD",
"aliases": [
"acme_primary",
"admin@example.com"
],
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
]
}
}'
{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"name": "ACME Enterprise",
"primaryEmail": "admin@example.com",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"settings": [
{
"id": "customerSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
],
"account": {
"id": "G234DZZKBKACATFFGVGEMERFH",
"name": "ACME Enterprise - Account",
"invoiceCurrency": "USD",
"status": "ACTIVE",
"aliases": [
{
"alias": "G234DZZKBKACATFFGVGEMERFH",
"status": "ACTIVE"
}
],
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
]
}
}