TRANXACT.AI Help

CRM · Accounts & Contacts

Accounts

Open a customer for its sites, selling context, financial terms, credit profile and account relationships — ship-to, bill-to and payer are frequently three different places.

Type REST16 operationsBase path /api/crm/accountsPublished as /api/v1/accounts

Download specification (OpenAPI 3.1) Screen: Accounts

Overview

PackageCRM
AuthenticationBearer token: a service account's token (POST /api/auth/service-token) or, for the published path, an API key
AuthorizationThe caller's roles must hold CRM › Accounts on the Roles screen: display for GET, add for POST, change for PUT, delete for DELETE; an action needs the grant of the button that runs it on the screen.
Tablecrm.accounts · kept per company (and organisational unit where it has one)
RecordCreated, changed and (where the screen allows) deleted; key id
RulesThe same as the screen: validation, numbering, approvals, posting, the company the caller belongs to, and the audit trail.

API reference

16 operations. Open one for its parameters, bodies, responses and a sample request.

GET/api/crm/accountsList accounts

Query parameters

NameDescriptionExample
limitRows per page (50 by default, at most 200)limit=100
offsetRows to skipoffset=200
qFree-text search over the search columnsq=acme
sortcolumn:asc or column:desc, several separated by commassort=created_at:desc
filterA JSON condition or group (see the filter language), URL-encoded; any field below can be filtered and sortedfilter={"col":"status","op":"eq","value":"open"}
<field>=<value>Shorthand for "field is value" 

Response 200

{
  "rows": [
    {
      "id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
      "account_no": "ACC-000001",
      "name": "Example",
      "account_type": "prospect",
      "parent_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
      "industry": "text",
      "country": "US",
      "currency": "USD",
      "credit_limit": "1250.00",
      "owner_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
      "is_active": true,
      "org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
      "location_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
      "warehouse_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73"
    }
  ],
  "count": 1
}

Sample request

curl "https://demo.tranxact.ai/api/crm/accounts?limit=20" \
  -H "Authorization: Bearer $TOKEN"
GET/api/crm/accounts/{id}Read one accounts

Path parameters

NameTypeDescription
idstring (uuid)The record's id, as a list returns it.

Response 200

{
  "id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "account_no": "ACC-000001",
  "name": "Example",
  "account_type": "prospect",
  "parent_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "industry": "text",
  "country": "US",
  "currency": "USD",
  "credit_limit": "1250.00",
  "owner_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "is_active": true,
  "org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "location_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "warehouse_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73"
}

404 when no record with that id is visible to the caller.

Sample request

curl "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
  -H "Authorization: Bearer $TOKEN"
POST/api/crm/accountsCreate a accounts

Request body

The record as JSON. Fields marked Yes are required.

FieldTypeRequiredDescription
account_notextYesAccount number — Left blank, the platform allocates the next one from the number range.
nametextYesName
account_typetextNoType
Allowed: prospect customer partner distributor
parent_iduuidNoParent id
industrytextNoIndustry
countrytextNoCountry
currencytextYesCurrency
credit_limitnumericNoCredit limit — Blank or 0: no limit. Checked when a sales order is created or confirmed, and when an opportunity closes won (AR-005); the Credit tab sets a limit per business unit and what happens when it is reached.
is_activebooleanNoIs active
websitetextNoWebsite — The company’s web address, e.g. https://example.com
phonetextNoMain telephone
emailtextNoGeneral e-mail
legal_nametextNoLegal name — A change to the name, legal name or country here takes effect today; to date it otherwise, change it on the Party tab (Name, legal name and country). The registered address and the tax ids are kept on the Party tab.
address_line1textNoAddress line1
citytextNoCity
regiontextNoRegion
postal_codetextNoPostal code
employee_countintegerNoEmployees
founded_yearintegerNoFounded (year)
descriptiontextNoAbout the company
name_artextNoName in Arabic
cr_numbertextNoCr number
building_notextNoBuilding number — Four digits, from the national address.
districttextNoDistrict
additional_notextNoAdditional number — The four-digit additional number of the national address.
gstintextNoGstin
pantextNoPAN — India: five letters, four digits, a letter.
state_codetextNoGST state (place of supply) — India: the state supplies to this customer are made to. Same state as yours is CGST + SGST; another is IGST.
Allowed: 01 Jammu and Kashmir 02 Himachal Pradesh 03 Punjab 04 Chandigarh 05 Uttarakhand 06 Haryana 07 Delhi 08 Rajasthan 09 Uttar Pradesh 10 Bihar 11 Sikkim 12 Arunachal Pradesh
gst_registration_typetextNoGST registration — India: regular for a registered customer (B2B), unregistered for a consumer (B2C).
Allowed: regular composition unregistered sez_unit sez_developer overseas uin
pincodetextNoPincode
buyer_id_schemetextNoBuyer ID type (no VAT number) — For a customer with no VAT number. The CR number above is used as the CRN when this is empty.
Allowed: TIN - tax identification number CRN - commercial registration MOM - MOMRAH license MLS - MHRSD license 700 - 700 number SAG - MISA license NAT - national ID GCC - GCC ID IQA - Iqama number PAS - passport OTH - other
buyer_id_numbertextNoBuyer ID number — Letters and digits only.

Sample body

{
  "account_no": "ACC-000001",
  "name": "Example",
  "currency": "USD",
  "account_type": "prospect",
  "parent_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "industry": "text",
  "country": "US"
}

Response 201

{
  "id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "account_no": "ACC-000001",
  "name": "Example",
  "account_type": "prospect",
  "parent_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "industry": "text",
  "country": "US",
  "currency": "USD",
  "credit_limit": "1250.00",
  "owner_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "is_active": true,
  "org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "location_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "warehouse_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73"
}

Sample request

curl -X POST "https://demo.tranxact.ai/api/crm/accounts" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"account_no":"ACC-000001","name":"Example","currency":"USD","account_type":"prospect","parent_id":"3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73","industry":"text","country":"US"}'
PUT/api/crm/accounts/{id}Change a accounts

Path parameters

NameTypeDescription
idstring (uuid)The record's id, as a list returns it.

Request body

Only the fields to change; fields left out keep their value.

FieldTypeRequiredDescription
account_notextYesAccount number — Left blank, the platform allocates the next one from the number range.
nametextYesName
account_typetextNoType
Allowed: prospect customer partner distributor
parent_iduuidNoParent id
industrytextNoIndustry
countrytextNoCountry
currencytextYesCurrency
credit_limitnumericNoCredit limit — Blank or 0: no limit. Checked when a sales order is created or confirmed, and when an opportunity closes won (AR-005); the Credit tab sets a limit per business unit and what happens when it is reached.
is_activebooleanNoIs active
websitetextNoWebsite — The company’s web address, e.g. https://example.com
phonetextNoMain telephone
emailtextNoGeneral e-mail
legal_nametextNoLegal name — A change to the name, legal name or country here takes effect today; to date it otherwise, change it on the Party tab (Name, legal name and country). The registered address and the tax ids are kept on the Party tab.
address_line1textNoAddress line1
citytextNoCity
regiontextNoRegion
postal_codetextNoPostal code
employee_countintegerNoEmployees
founded_yearintegerNoFounded (year)
descriptiontextNoAbout the company
name_artextNoName in Arabic
cr_numbertextNoCr number
building_notextNoBuilding number — Four digits, from the national address.
districttextNoDistrict
additional_notextNoAdditional number — The four-digit additional number of the national address.
gstintextNoGstin
pantextNoPAN — India: five letters, four digits, a letter.
state_codetextNoGST state (place of supply) — India: the state supplies to this customer are made to. Same state as yours is CGST + SGST; another is IGST.
Allowed: 01 Jammu and Kashmir 02 Himachal Pradesh 03 Punjab 04 Chandigarh 05 Uttarakhand 06 Haryana 07 Delhi 08 Rajasthan 09 Uttar Pradesh 10 Bihar 11 Sikkim 12 Arunachal Pradesh
gst_registration_typetextNoGST registration — India: regular for a registered customer (B2B), unregistered for a consumer (B2C).
Allowed: regular composition unregistered sez_unit sez_developer overseas uin
pincodetextNoPincode
buyer_id_schemetextNoBuyer ID type (no VAT number) — For a customer with no VAT number. The CR number above is used as the CRN when this is empty.
Allowed: TIN - tax identification number CRN - commercial registration MOM - MOMRAH license MLS - MHRSD license 700 - 700 number SAG - MISA license NAT - national ID GCC - GCC ID IQA - Iqama number PAS - passport OTH - other
buyer_id_numbertextNoBuyer ID number — Letters and digits only.

Sample body

{
  "account_no": "ACC-000001",
  "name": "Example"
}

Response 200

{
  "id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "account_no": "ACC-000001",
  "name": "Example",
  "account_type": "prospect",
  "parent_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "industry": "text",
  "country": "US",
  "currency": "USD",
  "credit_limit": "1250.00",
  "owner_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "is_active": true,
  "org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "location_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
  "warehouse_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73"
}

Sample request

curl -X PUT "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"account_no":"ACC-000001","name":"Example"}'
DELETE/api/crm/accounts/{id}Delete a accounts

Path parameters

NameTypeDescription
idstring (uuid)The record's id, as a list returns it.

Response 200

{ "deleted": true }

Many documents are cancelled or reversed instead; the API refuses a delete the screen would refuse.

Sample request

curl -X DELETE "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
  -H "Authorization: Bearer $TOKEN"
GET/api/crm/accounts/{id}/profileProfile

Path parameters

NameTypeDescription
idstring (uuid)The record's id, as a list returns it.

Response

200 with the data as JSON.

Sample request

curl "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/profile" \
  -H "Authorization: Bearer $TOKEN"
GET/api/crm/accounts/{id}/sitesSites

Path parameters

NameTypeDescription
idstring (uuid)The record's id, as a list returns it.

Response

200 with the data as JSON.

Sample request

curl "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/sites" \
  -H "Authorization: Bearer $TOKEN"
GET/api/crm/accounts/{id}/payment-methodsPayment methods

Path parameters

NameTypeDescription
idstring (uuid)The record's id, as a list returns it.

Response

200 with the data as JSON.

Sample request

curl "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/payment-methods" \
  -H "Authorization: Bearer $TOKEN"
POST/api/crm/accounts/{id}/payment-setupPayment setup

Path parameters

NameTypeDescription
idstring (uuid)The record's id, as a list returns it.

Request body

The keys this action reads (* = required; "one of" lists the only values):

email, contactName

Response

200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.

Sample request

curl -X POST "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/payment-setup" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email":"value","contactName":"value"}'
POST/api/crm/accounts/{id}/onboarding-activeOnboarding active

Path parameters

NameTypeDescription
idstring (uuid)The record's id, as a list returns it.

No body is required.

Response

200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.

Sample request

curl -X POST "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/onboarding-active" \
  -H "Authorization: Bearer $TOKEN"
PATCH/api/crm/accounts/{id}Patch accounts

Path parameters

NameTypeDescription
idstring (uuid)The record's id, as a list returns it.

No body is required.

Response

200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.

Sample request

curl -X PATCH "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
  -H "Authorization: Bearer $TOKEN"
POST/api/crm/accounts/{id}/copyCopy

Path parameters

NameTypeDescription
idstring (uuid)The record's id, as a list returns it.

Request body

The keys this action reads (* = required; "one of" lists the only values):

overrides, preview, withLines

Response

200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.

Sample request

curl -X POST "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/copy" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"overrides":"value","preview":"value","withLines":"value"}'
GET/api/crm/accounts/{parentId}/contactsContacts

Path parameters

NameTypeDescription
parentIdstring (uuid)The record's parentId, as a list returns it.

Response

200 with the data as JSON.

Sample request

curl "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/contacts" \
  -H "Authorization: Bearer $TOKEN"
POST/api/crm/accounts/{parentId}/contactsContacts

Path parameters

NameTypeDescription
parentIdstring (uuid)The record's parentId, as a list returns it.

No body is required.

Response

200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.

Sample request

curl -X POST "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/contacts" \
  -H "Authorization: Bearer $TOKEN"
PUT/api/crm/accounts/{parentId}/contacts/{lineId}Contacts

Path parameters

NameTypeDescription
parentIdstring (uuid)The record's parentId, as a list returns it.
lineIdstring (uuid)The record's lineId, as a list returns it.

No body is required.

Response

200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.

Sample request

curl -X PUT "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/contacts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
  -H "Authorization: Bearer $TOKEN"
DELETE/api/crm/accounts/{parentId}/contacts/{lineId}Contacts

Path parameters

NameTypeDescription
parentIdstring (uuid)The record's parentId, as a list returns it.
lineIdstring (uuid)The record's lineId, as a list returns it.

No body is required.

Response

200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.

Sample request

curl -X DELETE "https://demo.tranxact.ai/api/crm/accounts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/contacts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
  -H "Authorization: Bearer $TOKEN"

Data model

Every field of a accounts, as the API returns it. Field names are the JSON keys; any of them can be filtered and sorted on a list.

FieldTypeAccessDescription
iduuidread onlyId
org_iduuidread onlyOrg id
account_notextread, writeAccount number — Left blank, the platform allocates the next one from the number range.
nametextread, writeName
account_typetextread, writeType
Allowed: prospect customer partner distributor
parent_iduuidread, writeParent id
industrytextread, writeIndustry
countrytextread, writeCountry
currencytextread, writeCurrency
credit_limitnumericread, writeCredit limit — Blank or 0: no limit. Checked when a sales order is created or confirmed, and when an opportunity closes won (AR-005); the Credit tab sets a limit per business unit and what happens when it is reached.
owner_iduuidread onlyOwner id
is_activebooleanread, writeIs active
org_unit_iduuidread onlyOrg unit id
location_iduuidread onlyLocation id
warehouse_iduuidread onlyWarehouse id
xf_text_1textread onlyXf text 1
xf_text_2textread onlyXf text 2
xf_text_3textread onlyXf text 3
xf_text_4textread onlyXf text 4
xf_text_5textread onlyXf text 5
xf_num_1numericread onlyXf num 1
xf_num_2numericread onlyXf num 2
xf_num_3numericread onlyXf num 3
xf_date_1dateread onlyXf date 1
xf_date_2dateread onlyXf date 2
created_attimestamp with time zoneread onlyCreated at
created_byuuidread onlyCreated by
updated_attimestamp with time zoneread onlyUpdated at
updated_byuuidread onlyUpdated by
websitetextread, writeWebsite — The company’s web address, e.g. https://example.com
phonetextread, writeMain telephone
emailtextread, writeGeneral e-mail
legal_nametextread, writeLegal name — A change to the name, legal name or country here takes effect today; to date it otherwise, change it on the Party tab (Name, legal name and country). The registered address and the tax ids are kept on the Party tab.
address_line1textread, writeAddress line1
citytextread, writeCity
regiontextread, writeRegion
postal_codetextread, writePostal code
employee_countintegerread, writeEmployees
founded_yearintegerread, writeFounded (year)
descriptiontextread, writeAbout the company
name_artextread, writeName in Arabic
cr_numbertextread, writeCr number
building_notextread, writeBuilding number — Four digits, from the national address.
districttextread, writeDistrict
additional_notextread, writeAdditional number — The four-digit additional number of the national address.
gstintextread, writeGstin
pantextread, writePAN — India: five letters, four digits, a letter.
state_codetextread, writeGST state (place of supply) — India: the state supplies to this customer are made to. Same state as yours is CGST + SGST; another is IGST.
Allowed: 01 Jammu and Kashmir 02 Himachal Pradesh 03 Punjab 04 Chandigarh 05 Uttarakhand 06 Haryana 07 Delhi 08 Rajasthan 09 Uttar Pradesh 10 Bihar 11 Sikkim 12 Arunachal Pradesh
gst_registration_typetextread, writeGST registration — India: regular for a registered customer (B2B), unregistered for a consumer (B2C).
Allowed: regular composition unregistered sez_unit sez_developer overseas uin
pincodetextread, writePincode
buyer_id_schemetextread, writeBuyer ID type (no VAT number) — For a customer with no VAT number. The CR number above is used as the CRN when this is empty.
Allowed: TIN - tax identification number CRN - commercial registration MOM - MOMRAH license MLS - MHRSD license 700 - 700 number SAG - MISA license NAT - national ID GCC - GCC ID IQA - Iqama number PAS - passport OTH - other
buyer_id_numbertextread, writeBuyer ID number — Letters and digits only.
merged_into_iduuidread onlyMerged into id
onboarding_statustextread onlyOnboarding status
onboarding_updated_attimestamp with time zoneread onlyOnboarding updated at

Errors

StatusMeaning
400The request could not be read: a filter that is not JSON, a bad parameter
401No credential, or it is wrong, revoked or expired
403The caller's roles do not hold CRM › Accounts for this verb, or the address or origin is not allowed
404No record with that id is visible to the caller
409A conflict: a duplicate number, a document in a state that does not allow it, or a record changed or locked by someone else
422Refused by the same validation as the screen; the error names the field and why

Every error is JSON: {"error": "a sentence saying what was wrong"}, with field where it applies.