• Account Management/
    Using Account Management API/
    Accounts API Overview

    Accounts API Overview

    An Account resource represents a business account within a store.

    The Account Object

    AttributeTypeDescription
    idstringThe unique identifier for an Account.
    typestringThe type of the object returned.
    namestringThe name of the account.
    legal_namestringThe legal name of the account.
    registration_idstringThe registration ID of the account. The maximum character limit for this field is 63.
    metaobjectAdditional information for this realm. For more information, see The meta object section.
    relationshipsobjectA 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

    AttributeTypeDescription
    meta.timestampsstringSpecifies the time and date that the account is created or updated.
    meta.timestamps.created_atstringSpecifies the date the account is created.
    meta.timestamps.updated_atstringSpecifies the date the account is last updated.

    The relationships Object

    AttributeTypeDescription
    relationships.parentobjectProvides details about the relationship between the account and the parent account.
    relationships.parent.dataobjectSpecifies the details of the parent account.
    relationships.parent.data.idstringSpecifies the ID of the parent account.
    relationships.parent.data.typestringSpecifies the type of the parent account.
    relationships.ancestorsobjectDisplays 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].dataobjectSpecifies the information regarding a specific ancestor.
    relationships.ancestors[x].data.idstringSpecifies the ID of the ancestor.
    relationships.ancestors[x].data.typestringSpecifies the type of the ancestor.

    Filtering

    The following operators and attributes are available for filtering accounts:

    OperatorDescription
    eqChecks whether the values of two operands are equal. If the values are equal, the condition is true.
    likeChecks if the operand contains the specified string. You can use wildcard characters in operand.
    AttributeTypeOperatorExample
    namestringeq / likeeq(name,some_name)
    legal_namestringeq / likelike(legal_name,*legal_name)
    registration_idstringeq / likeeq(registration_id,00000000-0000-1000-8000-0000000)

    Was this helpful?

    Previous
    Account Member Authentication