Document Properties
Last Modified
Added to KB
Public Access
Doc Type
  • IOM 2.0
  • IOM 2.1
  • IOM 2.2
  • IOM 2.9
  • IOM 2.16
  • IOM 2.17
  • IOM 3.0
  • IOM 3.1
  • IOM 3.2
  • IOM 3.3
  • IOM 3.4
  • IOM 3.5
  • IOM 3.6
  • IOM 3.7
  • IOM 4.0

IOM REST API - Create Stock Reservation



Http Method


Short Description

Create a stock reservation.
Example Requests URLhttp://

Example Requests

{ "lifetime": 180, "type": "COMPLETE", "items": [ { "id": "First-Test", "qty": "2" } ] }

HTTP Status Codes

  • 201 Created

  • 400 Bad Request

  • 401 Unauthorized

  • 404 Not Found

  • 500 Internal Server Error


This service creates stock reservations for a given OMS shop instance. A stock reservation is a list of reserved products with the appropriate amount. Each stock reservation has a validity which can be set by the field lifetime at the request payload.

The response provides a status code 201 on success with the reserved products, the state of the reservation and a unique reservation reference ID.

This service only supports and accepts requests with content-type application/json.

ParametersPath parameter shopId = ID of the OMS shop instance - Example = 10010

Product Version


Product To Version


New Labels


IOM supports "basic http authentication" only. Please configure your clients to use this authentication method. A very simple method to send REST requests on the command line can be realized using wget. The example also shows, how to configure this client to use "basic http authentication" (--auth-no-challenge).


wget -q -O- --auth-no-challenge  --http-user=<user> --http-password='<password>' \
--method=post --post-data='{"lifetime":180, "type":"COMPLETE", "items":[{"id":"First-Test", "qty":"2"}]}' \


It is Important that the permission REST_RESERVATION (oms.RightDefDO with ID = 124 and name "Reservation REST service") is assigned to the requesting user. The permission is a part of the class bakery.persistence.dataobject.configuration.common.RightDefDO.

The user also needs the permission for the OMS shop instance which relates to the requested stock reservation.


To avoid overbooking of products the OMS checks the current inventory of the product before storing the reservation. The inventory check itself depends on stock reservations. For this reason the OMS uses database advisory locks to serialize the requests.

If it is not possible for a request to obtain all locks for the products to reverse within five seconds, the client gets a response with HTTP status code 500 and the following payload:

  "data": null,
  "statusCode": 500,
  "errors": null,
  "exceptions": [{
      "code": "500",
      "message": "bakery.util.exception.TechnicalException: Technical error while working on object 'ReservationPersistenceBean': 
			Unable to create reservation. Cannot get the necessary database lock to perform a concurrent safe inventory check."


Request data format


Request related java object

Request Attributes

The lifetime / validity of the stock reservation in seconds.Max value is 2147483647.
Greater values creates a response with HTTP status code 400 caused by a JsonParseException,

Default is 10 minutes.


The reservation type:

  • COMPLETE = products are only reserved if all products of the request are reservable

  • PARTLY = products are reserved, even when one or more of the reserved products are not reservable

If type is missing the OMS uses COMPLETE. All values unequal COMPLETE be interpreted as PARTLY.

items1..n products to reserve. For details see table below.Arrayfalse
Item Attribute
idThe ID of the product. Via the OMS configurations it is determined if it is the shop or oms product ID.String30false
qtyQuantity to reserveInteger false

Request data example

  "lifetime": 180,
  "type": "COMPLETE",
  "items": [
      "id": "First-Test",
      "qty": "2"

Response data format


Response related java object
bakery.reservation.v2.ReservationResponse as "data" object
Response Attributes
datasee table below
statusCodeHTTP status code
errorsempty in case of successful processing. For details see Response Attribute Errors
exceptionsempty in case of successful processing. For details see Response Attribute Exceptions
Data Attributes
validUntilThe Validity of the Stock Reservation
resvIdThe id <primary key> of the Stock Reservation
items1..n items. See table below
Item Attributes
idThe ID of the product. Via the OMS configurations it is determined if it is the shop product number or the oms product ID.
qtyReserved quantity

State of the reservation.
The reservation of the product is still "revered" or "expired".

Response AttributeErrors
Source FieldMessage
items.qtyCannot construct instance of int from String value 'value from request': not a valid Integer value

HTTP status code= 400

Response AttributeExceptions
JsonParseExceptionFor each not well formed JSON request payload
CODE_21001The product to be reserved was not found
CODE_21003We don't have enough stock for requested product

HTTP status code= 400

Response data example
  "data": {
    "validUntil": "2016-01-07 15:03:36",
    "resvId": 119,
    "items": [
        "id": "First-Test",
        "qty": 2,
        "state": "reserved"
  "statusCode": 201,
  "errors": [
  "exceptions": [
Response Code201


The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources