Search…
API Reference
Resources
List all carrier accounts
How to fetch a collection of carrier accounts via API
To fetch a collection of carrier accounts, send a GET request to the /api/carrier_accounts endpoint.

Request

GET https://yourdomain.commercelayer.io/api/carrier_accounts

Example

Request
Response
The following request fetches a collection of carrier accounts:
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/carrier_accounts/' \
3
-H 'Accept: application/vnd.api+json' \
4
-H 'Authorization: Bearer your-access-token'
Copied!
On success, the API responds with a 200 OK status code, returning a paginated collection of resource objects:
1
{
2
"data": [
3
{
4
"id": "xYZkjABcde",
5
"type": "carrier_accounts",
6
"links": {
7
"self": "https://yourdomain.commercelayer.io/api/carrier_accounts/xYZkjABcde"
8
},
9
"attributes": {
10
"name": "UPS",
11
"easypost_type": "UPS",
12
"easypost_id": "xxxx-yyyy-zzzz",
13
"created_at": "2018-01-01T12:00:00.000Z",
14
"updated_at": "2018-01-01T12:00:00.000Z",
15
"reference": "ANY-EXTERNAL-REFEFERNCE",
16
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
17
"metadata": {
18
"foo": "bar"
19
}
20
},
21
"relationships": {
22
"market": {
23
"links": {
24
"self": "https://yourdomain.commercelayer.io/api/carrier_accounts/xYZkjABcde/relationships/market",
25
"related": "https://yourdomain.commercelayer.io/api/carrier_accounts/xYZkjABcde/market"
26
}
27
},
28
"attachments": {
29
"links": {
30
"self": "https://yourdomain.commercelayer.io/api/carrier_accounts/xYZkjABcde/relationships/attachments",
31
"related": "https://yourdomain.commercelayer.io/api/carrier_accounts/xYZkjABcde/attachments"
32
}
33
}
34
},
35
"meta": {
36
"mode": "test"
37
}
38
},
39
{
40
"other": "... 9 carrier_accounts (first page)"
41
}
42
],
43
"meta": {
44
"record_count": 140,
45
"page_count": 14
46
},
47
"links": {
48
"first": "https://yourdomain.commercelayer.io/api/carrier_accounts?page[number]=1&page[size]=10",
49
"next": "https://yourdomain.commercelayer.io/api/carrier_accounts?page[number]=2&page[size]=10",
50
"last": "https://yourdomain.commercelayer.io/api/carrier_accounts?page[number]=14&page[size]=10"
51
}
52
}
Copied!

Sortable attributes

The list of carrier accounts can be sorted by the following attributes:
  • id
  • created_at
  • updated_at
  • reference
  • reference_origin
Last modified 23d ago