stock.reserve.renew

This method is used to renew a reserve.

Arguments

This method has the path /catalog/<version>/stock.reserve.renew and follows the MicroBase API calling conventions.

Argument Required Type Example Description
id yes String SkbUot80x7 The Reserve id to renew.
reserveStockForMinutes no Number 1440 The time until the Reserve expires.

The service allows to send a timeout (reserveStockForMinutes) for the reserve. If you don't send it, or the service doesn't allow an overwrite of the default one (allowReserveTimeOverwrite config), the minutesToReserve config is used.

Response

Returns a Reserve object:

{
    "ok": true,
    "reserve": {
        "id": "H1ugxlYO",
        "productId": "SkbUot80x7",
        "warehouseId": "001",
        "quantity": 1,
        "expirationTime": "2016-07-29T15:22:08.285Z"
    }
}

Returns a warning if the reserve can't be renewed.

{
    "ok": true,
    "warning": "reserve_not_renewed"
}

Errors

Expected errors that this method could return. Some errors return additional data.

Error Data Description
reserve_not_found - The reserve was not found

Example

curl --request GET \
  --url http://localhost:3000/services/catalog/v1/stock.reserve.renew?id=HJ4g4fACrH \
  --header 'authorization: Bearer xxxxx...' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"reserveStockForMinutes": 1440}'