Accounts API Overview
An Account
resource represents a business account within a store.
The Account Object
Attribute | Type | Description |
---|---|---|
id | string | The unique identifier for an Account. |
type | string | The type of the object returned. |
name | string | The name of the account. |
legal_name | string | The legal name of the account. |
registration_id | string | The registration ID of the account. The maximum character limit for this field is 63. |
meta | object | Additional information for this realm. For more information, see The meta object section. |
relationships | object | A list of related resources. For more information, see The relationships object section. |
Sample response
{
"data": {
"id": "6e46b042-cb5a-45bf-a6c2-9991bcd7260e",
"type": "account",
"name": "Account Level 4",
"legal_name": "acc-legal-name",
"registration_id": "0addf4f1-0347-4336-ae41-e44a39e762e8",
"relationships": {
"parent": {
"data": {
"id": "558d7153-2d2a-48d1-bde4-f8c21649842e",
"type": "account"
}
},
"ancestors": [
{
"data": {
"id": "b511062a-0a86-4bcc-99f9-528092ac35a6",
"type": "account"
}
},
{
"data": {
"id": "c4a13b06-8083-416f-80cd-ef1281e83f5b",
"type": "account"
}
},
{
"data": {
"id": "558d7153-2d2a-48d1-bde4-f8c21649842e",
"type": "account"
}
}
]
},
"meta": {
"timestamps": {
"created_at": "2021-04-16T15:39:06.884Z",
"updated_at": "2021-04-16T15:39:06.884Z"
}
}
},
"links": {
"self": "https://api.moltin.com/v2/accounts/6e46b042-cb5a-45bf-a6c2-9991bcd7260e"
}
}
The meta
Object
Attribute | Type | Description |
---|---|---|
meta.timestamps | string | Specifies the time and date that the account is created or updated. |
meta.timestamps.created_at | string | Specifies the date the account is created. |
meta.timestamps.updated_at | string | Specifies the date the account is last updated. |
The relationships
Object
Attribute | Type | Description |
---|---|---|
relationships.parent | object | Provides details about the relationship between the account and the parent account. |
relationships.parent.data | object | Specifies the details of the parent account. |
relationships.parent.data.id | string | Specifies the ID of the parent account. |
relationships.parent.data.type | string | Specifies the type of the parent account. |
relationships.ancestors | object | Displays an array with the details about the relationship between an account and the ancestors of the account. The first index of the array is the top-level account, and the last index is the parent of this account. This field is displayed only if the account consists of ancestors. |
relationships.ancestors[x].data | object | Specifies the information regarding a specific ancestor. |
relationships.ancestors[x].data.id | string | Specifies the ID of the ancestor. |
relationships.ancestors[x].data.type | string | Specifies the type of the ancestor. |
Filtering
The following operators and attributes are available for filtering accounts:
Operator | Description |
---|---|
eq | Checks whether the values of two operands are equal. If the values are equal, the condition is true. |
like | Checks if the operand contains the specified string. You can use wildcard characters in operand. |
Attribute | Type | Operator | Example |
---|---|---|---|
name | string | eq / like | eq(name,some_name) |
legal_name | string | eq / like | like(legal_name,*legal_name) |
registration_id | string | eq / like | eq(registration_id,00000000-0000-1000-8000-0000000) |