Skip to main content
PATCH
/
accounts
/
{account_id}
Update an account
curl --request PATCH \
  --url https://api.togai.com/accounts/{account_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "New Account Name",
  "primaryEmail": "[email protected]",
  "address": {
    "phoneNumber": "+919876543210",
    "line1": "2281 Broadway Street",
    "line2": "G-31",
    "postalCode": "29501",
    "city": "Florence",
    "state": "South Carolina"
  }
}
'
{
  "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": "[email protected]",
  "billingInformation": {
    "emailRecipients": [
      "[email protected]",
      "[email protected]",
      "[email protected]"
    ],
    "additionalEmailRecipients": [
      "[email protected]"
    ]
  },
  "aliases": [
    {
      "alias": "[email protected]"
    },
    {
      "alias": "+1234567890"
    }
  ],
  "status": "ACTIVE"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

account_id
string
required

account_id corresponding to an account

Maximum string length: 50
Example:

"ACC00001"

Body

application/json

Payload to update account

Payload to update account

name
string

Name of the Account

Required string length: 3 - 255
Example:

"ACME Enterprise"

status
enum<string>
Available options:
ACTIVE,
DRAFT
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"

netTermDays
integer<int32>
primaryEmail
string

Primary email of the account

Maximum string length: 320
billingInformation
object

Billing information of an account

address
object

billing address of the customer

metadata
object

Additional information associated with the account. Example: GSTN, VATN NOTE: This replaces the existing metadata if the metadata in the request is not null. To remove all existing metadata, use empty object

tags
string[]

Tag for accounts are stored in lowercase

Response

Response for Create and Get account requests

Structure of an account

id
string
required

Identifier of the account

Maximum string 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
AccountAliases · object[]

list of aliases of the account

Maximum array length: 10
netTermDays
integer<int32>
address
object

billing address of the customer

primaryEmail
string

Primary email of the customer

Maximum string length: 320
billingInformation
object

Billing information of an account

settings
object[]
Maximum array length: 10
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