Create Account Group

Creates a new group (sub-organization) within your organization. Account groups can be used to organize different merchants or business units under a single parent entity.

Pass account_codes to attach existing accounts to the group in the same request. A new group is always created as a root; to nest it under another group, set parent_code with Update Account Group.

POST/organizations/account-groups

Creates a new group (sub-organization).

Body application/json

namestringrequired

Account group name (min=1, max=255).

merchant_idstringrequired

Unique identifier used by the merchant in their systems (min=1, max=255).

account_codesstring<uuid>[]

Optional. ids of existing accounts to attach to the new group in the same transaction. An account belongs to one group at a time, so an account that is already in another group is moved to the new one. If any code does not match an active account of the organization the whole request fails and no group is created. Defaults to an empty list.

Response

Created

idstring<uuid>

The unique identifier of the account group.

namestring
merchant_idstring
parent_codestring,null<uuid>

The id of the group this group is nested under. Always null on creation: a new group is created as a root and nested afterwards with Update Account Group.

created_atstring<date-time>
updated_atstring<date-time>
Request
curl -X POST "https://api-sandbox.whitelabel.com/v1/organizations/account-groups" \
  -H "Content-Type: application/json" \
  -H "PUBLIC-API-KEY: <PUBLIC-API-KEY>" \
  -H "PRIVATE-SECRET-KEY: <PRIVATE-SECRET-KEY>" \
  -d '{
  "name": "string",
  "merchant_id": "string",
  "account_codes": [
    "00000000-0000-0000-0000-000000000000"
  ]
}'
Response
{
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "merchant_id": "string",
  "parent_code": null,
  "created_at": "1970-01-01T00:00:00.000Z",
  "updated_at": "1970-01-01T00:00:00.000Z"
}