logo

Stock | Managing reservations

Managing reservations consists of booking products in two situations:
  • the offer is sent to the customer and we want the goods to be reserved in the warehouse for the quantities and products that have been offered.
  • an order has been placed (via frontend or backoffice) and before the external system takes the order and reduces the stock levels in the warehouse, it is possible to receive information which products and in what quantities were ordered, so we can manage the stock on an ongoing basis
The booking time is determined when creating a warehouse (here is an instruction on how to create a warehouse)

Glossary

Name
Explanation
reservationIds
Reservation identifier (it is created in ONe platform)
numberOfEvents
Number of events to retrieve (max: 1000)
startId
first index of the result rows. That is, from what step (nextId) the results are to be shown

GET reservation integrations

In this endpoint it is possible to get information about all reservation. In this case use GET /api/v1/account/integrations/auth-required/reservations . The list can be restricted by using pageNumber, pageSize or reservationIds (multiple numbers of reservationIds can be used)
The diagram below shows the dependence of communicating with the API:
No parameters are required to get the reservation list. Additionally, you can give query parameters like:
  • pageNumber
  • pageSize
  • reservationIds

Example request

json
curl -X GET "https://ph-qa0.one.unity.pl/api/v1/stock/integrations/auth-required/reservations?reservationIds=" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"
In response we will get whole list of reservations with details

Example response:

json
{ "total": 2, "elements": [ { "reservationId": "7f64bc9c-f3f0-4bd5-95a9-23bfcfaee57a", "type": "SALES_ORDER", "warehouseId": "W1CEN", "productId": "SIGNY_51502000", "salesOrderNumber": "OF/6/5/2022/01", "quantity": 6 }, { "reservationId": "0b4f34bb-c1e1-4d5d-97a5-b6a2b648c844", "type": "SALES_ORDER", "warehouseId": "W1CEN", "productId": "ORNO_OR-SL-6083WLR4", "salesOrderNumber": "OF/38/12/2022/01", "quantity": 1 } ] }

GET reservation integration by id

Here it is possible to receive information about a specific reservation. Use for this GET /api/v1/account/integrations/auth-required/reservations/{reservationId} providing the reservation identifier
The diagram below shows the dependence of communicating with the API:
Use the following path parameter to find the specific reservation (only one reservationIdcan be entered):
  • reservationId

Example request:

json
curl -X GET "https://ph-qa0.one.unity.pl/api/v1/stock/integrations/auth-required/reservations/7f64bc9c-f3f0-4bd5-95a9-23bfcfaee57a" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"
In response we will get information about details of selected reservation.

Example response:

json
{ "reservationId": "7f64bc9c-f3f0-4bd5-95a9-23bfcfaee57a", "type": "SALES_ORDER", "warehouseId": "W1CEN", "productId": "SIGNY_51502000", "salesOrderNumber": "OF/6/5/2022/01", "quantity": 6 }

GET reservation for synchronization

In order to efficiently communicate between the ONe platform and an external system (eg ERP), an endpoint was created for synchronization of reservations.
The sequence diagram below shows the dependency of communicating with the API when account manager was created in ONe:
In this case, use GET /api/v1/account/integrations/auth-required/reservations/synchronization to check what happened in the next step (nextId)
Use the following query parameters to find the events of the synchronization:
  • numberOfEvents
  • startId
In the example, we used such a StartId to make it easier to visualize the operation of this endpoint

Example request

json
curl -X GET "https://ph-qa0.one.unity.pl/api/v1/stock/integrations/auth-required/reservations/synchronization?numberOfEvents=1000&startId=140" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"
In response we will get information about next step ID and information about current step

Example response

json
{ "events": [ { "reservationId": "af32b561-2a6c-4b1c-93cf-ec294c0d741d", "reservationType": "CART", "reservationEventType": "DELETE", "eventDateTime": "2022-05-25T12:46:39Z" } ], "nextId": 141 }