POST
/
accounts
curl --request POST \
  --url https://api.togai.com/accounts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "id": "ACC00001",
  "name": "Primary Account",
  "customerId": "C1234qwd",
  "aliases": [
    "acme_primary",
    "acme_1"
  ],
  "address": {
    "phoneNumber": "+919876543210",
    "line1": "2281 Broadway Street",
    "line2": "G-31",
    "postalCode": "29501",
    "city": "Florence",
    "state": "South Carolina",
    "country": "US"
  },
  "primaryEmail": "admin@example.com",
  "settings": [
    {
      "id": "accountSettingId",
      "value": "INR",
      "namespace": "USER",
      "name": "Settings Name",
      "dataType": "STRING"
    }
  ],
  "netTermDays": 45
}'
{
  "id": "G234DZZKBKACATFFGVGEMERFI",
  "togaiAccountId": "account.safdla.c234ds",
  "customerId": "ACME",
  "togaiCustomerId": "customer.savass.11e1a",
  "name": "ACME Enterprise - Account2",
  "invoiceCurrency": "USD",
  "address": {
    "phoneNumber": "+919876543210",
    "line1": "2281 Broadway Street",
    "line2": "G-31",
    "postalCode": "29501",
    "city": "Florence",
    "state": "South Carolina",
    "country": "US"
  },
  "primaryEmail": "admin@example.com",
  "billingInformation": {
    "emailRecipients": [
      "admin@example.com",
      "acme@acme.com",
      "acmeacme@acme.com"
    ],
    "additionalEmailRecipients": [
      "admin@acme.com"
    ]
  },
  "aliases": [
    {
      "alias": "account2@acme.com"
    },
    {
      "alias": "+1234567890"
    }
  ],
  "status": "ACTIVE"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
Payload to create account

Payload to create account

id
string
required

Identifier of the account

Maximum length: 50
Example:

"ACC00001"

name
string
required

Name of the Account

Required string length: 3 - 255
Example:

"Primary Account"

customerId
string
required

Customer Identifier for whom the account is being created

Required string length: 1 - 255
Example:

"C1234ewf"

invoiceCurrency
string

Use ISO 4217 currency code in which the account must be invoiced.
For example: AED is the currency code for United Arab Emirates dirham.

Required string length: 3
aliases
string[]

Aliases are tags that are associated with an account. Multiple aliases are allowed for a single account.

Example:

"acme_primary"

accountAliases
object[]

Aliases which effective range

An alternative account identifier for event ingestion with a defined effective duration.

address
object

billing address of the customer

primaryEmail
string

Primary email of the account

Maximum length: 320
Example:

"admin@example.com"

billingInformation
object

Billing information of an account

settings
object[]

Represents a setting

netTermDays
integer

Net term for the invoices of the account

Example:

45

metadata
object

Additional information associated with the account. Example: GSTN, VATN

tags
string[]

Tag for accounts are stored in lowercase

status
enum<string>

Status of the created account defaults to ACTIVE

Available options:
ACTIVE,
DRAFT

Response

201
application/json
Response for Create and Get account requests

Structure of an account

id
string
required

Identifier of the account

Maximum length: 50
togaiAccountId
string
required

Unique identifier of the account

togaiCustomerId
string
required

Unique identifier of the customer

name
string
required

Name of the Account

Required string length: 3 - 255
customerId
string
required

Identifier of the customer

status
enum<string>
required

Status of the account

Available options:
ACTIVE,
DRAFT,
ARCHIVED
Example:

"ACTIVE"

invoiceCurrency
string

ISO_4217 code of the currency in which the account must be invoiced Defaults to Base currency.

Required string length: 3
Example:

"USD"

aliases
object[]

list of aliases of the account

netTermDays
integer
address
object

billing address of the customer

primaryEmail
string

Primary email of the customer

Maximum length: 320
Example:

"admin@example.com"

billingInformation
object

Billing information of an account

settings
object[]

Represents a setting

invoiceGroupDetails
object

Invoice group details

metadata
object

Additional information associated with the account. Example: GSTN, VATN

tags
string[]

Tag for accounts are stored in lowercase