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

Responses

Created

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!