Retrieve a stock reservation
How to fetch a specific stock reservation via API
To fetch a single stock reservation, send a GET
request to the /api/stock_reservations/:id
endpoint, where id
is the ID of the resource that you want to retrieve.
Request
GET https://yourdomain.commercelayer.io/api/stock_reservations/:id
Example
The following request fetches the stock reservation identified by the id "xYZkjABcde":
curl -g -X GET \
'https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token'
On success, the API responds with a 200 OK
status code, returning a single resource object:
{
"data": {
"id": "xYZkjABcde",
"type": "stock_reservations",
"links": {
"self": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde"
},
"attributes": {
"status": "draft",
"quantity": 4,
"expires_at": "2018-01-02T12:00:00.000Z",
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANY-EXTERNAL-REFEFERNCE",
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
"metadata": {
"foo": "bar"
}
},
"relationships": {
"line_item": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/relationships/line_item",
"related": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/line_item"
}
},
"order": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/relationships/order",
"related": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/order"
}
},
"stock_line_item": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/relationships/stock_line_item",
"related": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/stock_line_item"
}
},
"stock_transfer": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/relationships/stock_transfer",
"related": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/stock_transfer"
}
},
"stock_item": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/relationships/stock_item",
"related": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/stock_item"
}
},
"reserved_stock": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/relationships/reserved_stock",
"related": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/reserved_stock"
}
},
"sku": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/relationships/sku",
"related": "https://yourdomain.commercelayer.io/api/stock_reservations/xYZkjABcde/sku"
}
}
},
"meta": {
"mode": "test",
"organization_id": "xRRkjDFafe",
"trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74"
}
}
}
Last updated