curl --request POST \
--url https://api.togai.com/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"name": "ACME Enterprise",
"primaryEmail": "[email protected]",
"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",
"[email protected]"
],
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
]
}
}'{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"togaiCustomerId": "customer.dsvvre314.dcs314",
"name": "ACME Enterprise",
"primaryEmail": "[email protected]",
"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",
"togaiAccountId": "account.safdla.c234ds",
"customerId": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"togaiCustomerId": "customer.savass.11e1a",
"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"
}
]
}
}This API let’s you to create customers and corresponding accounts.
curl --request POST \
--url https://api.togai.com/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"name": "ACME Enterprise",
"primaryEmail": "[email protected]",
"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",
"[email protected]"
],
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
]
}
}'{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"togaiCustomerId": "customer.dsvvre314.dcs314",
"name": "ACME Enterprise",
"primaryEmail": "[email protected]",
"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",
"togaiAccountId": "account.safdla.c234ds",
"customerId": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"togaiCustomerId": "customer.savass.11e1a",
"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"
}
]
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Payload to create customer
Payload to create customer
Customer identifier
50"01BX5ZZKBKACTAV9WEVGEMMVRZ"
Name of the Customer
3 - 255"ACME Enterprise"
billing address of the customer
Show child attributes
Contact number
Address line 1 (eg. Street, PO Box, Company Name)
Address line 2 (eg. apartment, suite, unit or building)
ZIP or postal code
City, district, suburb, town or village
State, county, province or region
Two letter country code ISO-3166-1 Alpha-2
Payload to create account
Show child attributes
Identifier of the account
50"ACC00001"
Name of the Account
3 - 255"Primary Account"
Aliases are tags that are associated with an account. Multiple aliases are allowed for a single account.
103 - 50"acme_primary"
Aliases which effective range
Show child attributes
1 - 50Effective from date, if not provided, it will be set to -infinity
Effective until date, if not provided, it will be set to +infinity
billing address of the customer
Show child attributes
Contact number
Address line 1 (eg. Street, PO Box, Company Name)
Address line 2 (eg. apartment, suite, unit or building)
ZIP or postal code
City, district, suburb, town or village
State, county, province or region
Two letter country code ISO-3166-1 Alpha-2
Billing information of an account
Show child attributes
Emails in this array will be added in to: in mail. Primary email will be added if left blank.
320Emails in this array will be added in cc: in mail.
320Net term for the invoices of the account
45
Tag for accounts are stored in lowercase
Status of the created account defaults to ACTIVE
ACTIVE, DRAFT Response for Create customer request
Identifier of customer
50Unique identifier of customer
Name of the Customer
3 - 255Primary email of the customer
320billing address of the customer
Show child attributes
Contact number
Address line 1 (eg. Street, PO Box, Company Name)
Address line 2 (eg. apartment, suite, unit or building)
ZIP or postal code
City, district, suburb, town or village
State, county, province or region
Two letter country code ISO-3166-1 Alpha-2
Structure of an account
Show child attributes
Identifier of the account
50Unique identifier of the account
Unique identifier of the customer
Name of the Account
3 - 255Identifier of the customer
Status of the account
ACTIVE, DRAFT, ARCHIVED "ACTIVE"
billing address of the customer
Show child attributes
Contact number
Address line 1 (eg. Street, PO Box, Company Name)
Address line 2 (eg. apartment, suite, unit or building)
ZIP or postal code
City, district, suburb, town or village
State, county, province or region
Two letter country code ISO-3166-1 Alpha-2
Billing information of an account
Show child attributes
Emails in this array will be added in to: in mail. Primary email will be added if left blank.
320Emails in this array will be added in cc: in mail.
320Invoice group details
Show child attributes
320billing address of the customer
Show child attributes
Contact number
Address line 1 (eg. Street, PO Box, Company Name)
Address line 2 (eg. apartment, suite, unit or building)
ZIP or postal code
City, district, suburb, town or village
State, county, province or region
Two letter country code ISO-3166-1 Alpha-2
Tag for accounts are stored in lowercase