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

Request

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

Example

Request
Response
The following request fetches the return identified by the id "xYZkjABcde":
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/returns/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": "returns",
5
"links": {
6
"self": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde"
7
},
8
"attributes": {
9
"number": "#1234/R/001",
10
"status": "draft",
11
"customer_email": "[email protected]",
12
"skus_count": 2,
13
"approved_at": "2018-01-01T12:00:00.000Z",
14
"cancelled_at": "2018-01-01T12:00:00.000Z",
15
"shipped_at": "2018-01-01T12:00:00.000Z",
16
"rejected_at": "2018-01-01T12:00:00.000Z",
17
"received_at": "2018-01-01T12:00:00.000Z",
18
"archived_at": "2018-01-01T12:00:00.000Z",
19
"created_at": "2018-01-01T12:00:00.000Z",
20
"updated_at": "2018-01-01T12:00:00.000Z",
21
"reference": "ANY-EXTERNAL-REFEFERNCE",
22
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
23
"metadata": {
24
"foo": "bar"
25
}
26
},
27
"relationships": {
28
"order": {
29
"links": {
30
"self": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/relationships/order",
31
"related": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/order"
32
}
33
},
34
"customer": {
35
"links": {
36
"self": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/relationships/customer",
37
"related": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/customer"
38
}
39
},
40
"stock_location": {
41
"links": {
42
"self": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/relationships/stock_location",
43
"related": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/stock_location"
44
}
45
},
46
"origin_address": {
47
"links": {
48
"self": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/relationships/origin_address",
49
"related": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/origin_address"
50
}
51
},
52
"destination_address": {
53
"links": {
54
"self": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/relationships/destination_address",
55
"related": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/destination_address"
56
}
57
},
58
"return_line_items": {
59
"links": {
60
"self": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/relationships/return_line_items",
61
"related": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/return_line_items"
62
}
63
},
64
"attachments": {
65
"links": {
66
"self": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/relationships/attachments",
67
"related": "https://yourdomain.commercelayer.io/api/returns/xYZkjABcde/attachments"
68
}
69
}
70
},
71
"meta": {
72
"mode": "test"
73
}
74
}
75
}
Copied!
Last modified 20d ago
Copy link