Search…
API Reference
Resources
Retrieve a carrier account
How to fetch a specific carrier account via API
To fetch a single carrier account, send a GET request to the /api/carrier_accounts/:id endpoint, where id is the ID of the resource that you want to retrieve.

Request

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

Example

Request
Response
The following request fetches the carrier account identified by the id "xYZkjABcde":
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/carrier_accounts/xYZkjABcde' \
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 single resource object:
1
{
2
"data": {
3
"id": "xYZkjABcde",
4
"type": "carrier_accounts",
5
"links": {
6
"self": "https://yourdomain.commercelayer.io/api/carrier_accounts/xYZkjABcde"
7
},
8
"attributes": {
9
"name": "UPS",
10
"easypost_type": "UPS",
11
"easypost_id": "xxxx-yyyy-zzzz",
12
"created_at": "2018-01-01T12:00:00.000Z",
13
"updated_at": "2018-01-01T12:00:00.000Z",
14
"reference": "ANY-EXTERNAL-REFEFERNCE",
15
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
16
"metadata": {
17
"foo": "bar"
18
}
19
},
20
"relationships": {
21
"market": {
22
"links": {
23
"self": "https://yourdomain.commercelayer.io/api/carrier_accounts/xYZkjABcde/relationships/market",
24
"related": "https://yourdomain.commercelayer.io/api/carrier_accounts/xYZkjABcde/market"
25
}
26
},
27
"attachments": {
28
"links": {
29
"self": "https://yourdomain.commercelayer.io/api/carrier_accounts/xYZkjABcde/relationships/attachments",
30
"related": "https://yourdomain.commercelayer.io/api/carrier_accounts/xYZkjABcde/attachments"
31
}
32
}
33
},
34
"meta": {
35
"mode": "test"
36
}
37
}
38
}
Copied!
Last modified 23d ago
Copy link