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

Request

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

Example

Request
Response
The following request fetches a collection of stock transfers:
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/stock_transfers/' \
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": "stock_transfers",
6
"links": {
7
"self": "https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde"
8
},
9
"attributes": {
10
"sku_code": "TSHIRTMM000000FFFFFFXLXX",
11
"status": "draft",
12
"quantity": 2,
13
"completed_at": "2018-01-01T12:00:00.000Z",
14
"cancelled_at": "2018-01-01T12:00:00.000Z",
15
"created_at": "2018-01-01T12:00:00.000Z",
16
"updated_at": "2018-01-01T12:00:00.000Z",
17
"reference": "ANY-EXTERNAL-REFEFERNCE",
18
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
19
"metadata": {
20
"foo": "bar"
21
}
22
},
23
"relationships": {
24
"sku": {
25
"links": {
26
"self": "https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde/relationships/sku",
27
"related": "https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde/sku"
28
}
29
},
30
"origin_stock_location": {
31
"links": {
32
"self": "https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde/relationships/origin_stock_location",
33
"related": "https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde/origin_stock_location"
34
}
35
},
36
"destination_stock_location": {
37
"links": {
38
"self": "https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde/relationships/destination_stock_location",
39
"related": "https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde/destination_stock_location"
40
}
41
},
42
"shipment": {
43
"links": {
44
"self": "https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde/relationships/shipment",
45
"related": "https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde/shipment"
46
}
47
},
48
"line_item": {
49
"links": {
50
"self": "https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde/relationships/line_item",
51
"related": "https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde/line_item"
52
}
53
}
54
},
55
"meta": {
56
"mode": "test"
57
}
58
},
59
{
60
"other": "... 9 stock_transfers (first page)"
61
}
62
],
63
"meta": {
64
"record_count": 140,
65
"page_count": 14
66
},
67
"links": {
68
"first": "https://yourdomain.commercelayer.io/api/stock_transfers?page[number]=1&page[size]=10",
69
"next": "https://yourdomain.commercelayer.io/api/stock_transfers?page[number]=2&page[size]=10",
70
"last": "https://yourdomain.commercelayer.io/api/stock_transfers?page[number]=14&page[size]=10"
71
}
72
}
Copied!

Sortable attributes

The list of stock transfers can be sorted by the following attributes:
  • status
  • completed_at
  • cancelled_at
  • id
  • created_at
  • updated_at
  • reference
  • reference_origin
Last modified 2mo ago