Get All Accounts
GEThttps://useast.api.elasticpath.com/v2/accounts
Use this endpoint to Get all accounts.
You can use pagination with this resource. For more information, see pagination.
Filtering
The following operators and attributes are available for filtering accounts:
Attribute | Type | Operators | Example |
---|---|---|---|
name | string |
| like(name,*swan*) |
legal_name | string |
| like(legal_name,*swan*) |
registration_id | string |
| like(registration_id,00000000-0000-1000-8000-*) |
external_ref | string |
| like(external_ref,16be*) |
id | string |
| in(id,"99248259-feea-40c6-b855-f719ee87a539", "363e4505-a2bb-4bc1-b667-2cc9a4de8668") |
created_at | string |
| gt(created_at,"2021-06-02T18:44:07.617Z") |
updated_at | string |
| ge(updated_at,"2021-06-07T18:24:48.149Z") |
Request
Query Parameters
Specifies the filter attributes.
The number of records per page.
Possible values: <= 10000
The number of records to offset the results by.
Supported attributes are created_at
, email
, id
, name
, or updated_at
. When specified, the results are sorted in ascending order based on the value of the field. To sort in descending order, prefix the attribute with -
, for example, -updated_at
. The default sort order is created_at
in descending order. For more information, see Sorting.
Responses
- 200
- 401
- default
OK
- application/json
- Schema
- Example (auto)
Schema
meta object
links object
{
"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",
"id": "deb6b25f-8451-4211-9a22-95610333df23",
"meta": {
"timestamps": {
"created_at": "2021-02-23T09:40:33.882Z",
"updated_at": "2021-02-23T09:40:33.882Z"
}
},
"links": {
"self": "https://useast.api.elasticpath.com/v2/accounts/deb6b25f-8451-4211-9a22-95610333df23"
}
}
],
"meta": {
"page": {
"limit": 25,
"current": 0,
"offset": 0,
"total": 1
},
"results": {
"total": 1
}
},
"links": {
"current": "https://useast.api.elasticpath.com/v2/accounts?page[offset]=0&page[limit]=25",
"first": "https://useast.api.elasticpath.com/v2/accounts?page[offset]=0&page[limit]=25",
"last": "https://useast.api.elasticpath.com/v2/accounts?page[offset]=0&page[limit]=25",
"next": null,
"prev": null
}
}
Unauthorized
- application/json
- Schema
- Example (auto)
- unauthorized-error
Schema
errors object[]required
{
"errors": [
{
"title": "string",
"status": "string",
"detail": "string"
}
]
}
{
"errors": [
{
"title": "Unauthorized",
"status": "401"
}
]
}
Internal server error.
- application/json
- Schema
- Example (auto)
- internal-server-error
Schema
errors object[]required
{
"errors": [
{
"title": "string",
"status": "string",
"detail": "string"
}
]
}
Internal server error
{
"errors": [
{
"title": "Internal Server Error",
"status": "500",
"detail": "there was a problem processing your request"
}
]
}
Authorization: http
name: BearerTokentype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://useast.api.elasticpath.com/v2/accounts");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());