API reference
Retrieve a merchant
How to fetch a specific merchant via API
To fetch a single merchant, send a GET request to the /api/merchants/:id endpoint, where id is the ID of the resource that you want to retrieve.

Request

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

Example

Request
Response
The following request fetches the merchant identified by the id "xYZkjABcde":
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/merchants/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": "merchants",
5
"links": {
6
"self": "https://yourdomain.commercelayer.io/api/merchants/xYZkjABcde"
7
},
8
"attributes": {
9
"name": "The Brand Inc.",
10
"created_at": "2018-01-01T12:00:00.000Z",
11
"updated_at": "2018-01-01T12:00:00.000Z",
12
"reference": "ANY-EXTERNAL-REFEFERNCE",
13
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
14
"metadata": {
15
"foo": "bar"
16
}
17
},
18
"relationships": {
19
"address": {
20
"links": {
21
"self": "https://yourdomain.commercelayer.io/api/merchants/xYZkjABcde/relationships/address",
22
"related": "https://yourdomain.commercelayer.io/api/merchants/xYZkjABcde/address"
23
}
24
},
25
"attachments": {
26
"links": {
27
"self": "https://yourdomain.commercelayer.io/api/merchants/xYZkjABcde/relationships/attachments",
28
"related": "https://yourdomain.commercelayer.io/api/merchants/xYZkjABcde/attachments"
29
}
30
}
31
},
32
"meta": {
33
"mode": "test"
34
}
35
}
36
}
Copied!
Copy link