Skip to main content

Create an Account

POST 

https://useast.api.elasticpath.com/v2/accounts

With the account creation endpoint, you have the ability to create accounts which can optionally have another account as a parent.

Request

Body

    data object
    typestringrequired

    Specifies the type of object. Set this value to account.

    Default value: account
    namestringrequired

    Specifies the name of the account.

    Example: acc-name
    legal_namestring | nullnullable

    Specifies the legal name of the account.

    Example: acc-legal-name
    registration_idstring | nullnullable

    Specifies the registration ID. If specified, this field is checked for uniqueness.

    Example: reg-id
    external_refstring | nullnullable

    The unique attribute associated with the account. For example, this could be an external reference from a separate company system. The maximum length is 2048 characters. Default is null.

    Example: ext-ref
    parent_idstring,null<uuid>nullable

    Specifies the ID of the parent account, this field cannot be changed after creation.

    Example: 96b1f750-55d3-4768-a3f8-adffba694a2c

Responses

Created

Schema
    data object
    typestringrequired

    Specifies the type of object. Set this value to account.

    Default value: account
    namestringrequired

    Specifies the name of the account.

    Example: acc-name
    legal_namestring | nullnullable

    Specifies the legal name of the account.

    Example: acc-legal-name
    registration_idstring | nullnullable

    Specifies the registration ID. If specified, this field is checked for uniqueness.

    Example: reg-id
    external_refstring | nullnullable

    The unique attribute associated with the account. For example, this could be an external reference from a separate company system. The maximum length is 2048 characters. Default is null.

    Example: ext-ref
    parent_idstring,null<uuid>nullable

    Specifies the ID of the parent account.

    Example: 96b1f750-55d3-4768-a3f8-adffba694a2c
    idstring<uuid>

    The unique identifier for an Account.

    Example: deb6b25f-8451-4211-9a22-95610333df23
    meta object

    Additional information for this realm. For more information, see The meta object section.

    timestamps object
    created_atstring

    The date the resource is created.

    Example: 2021-02-23T09:40:33.882Z
    updated_atstring

    The date the resource is updated.

    Example: 2021-02-23T09:40:33.882Z
    links object
    selfstring

    A URL to the specific resource.

    Example: https://useast.api.elasticpath.com/v2/accounts/deb6b25f-8451-4211-9a22-95610333df23

Authorization: http

name: BearerTokentype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://useast.api.elasticpath.com/v2/accounts");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"account\",\n \"name\": \"acc-name\",\n \"legal_name\": \"acc-legal-name\",\n \"registration_id\": \"reg-id\",\n \"external_ref\": \"ext-ref\",\n \"parent_id\": \"96b1f750-55d3-4768-a3f8-adffba694a2c\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://useast.api.elasticpath.com
Auth
Body
{
  "data": {
    "type": "account",
    "name": "acc-name",
    "legal_name": "acc-legal-name",
    "registration_id": "reg-id",
    "external_ref": "ext-ref",
    "parent_id": "96b1f750-55d3-4768-a3f8-adffba694a2c"
  }
}
ResponseClear

Click the Send API Request button above and see the response here!