External reservations are reservations coming from an external system (eg ERP). Reservations are used to reserve products for which we do not have an order yet, but there is a high probability that the customer will decide to order this product. Reservations is useful in a situation where we offer certain products to the client and we do not want someone to bought them from stock in the meantime.
Important! External product reservations do not reduce the stock. Stock change is possible via endpoint stock (see description of this endpoint here)
Glossary
Name | Explanation |
salesOrderNumber | Sales order number |
productId | Product identifier (SKU) |
lineNumber | Product line number in sales order |
reservedQuantity | Reserved product quantity |
GET sales order reservations view
In this endpoint it is possible to get information about a specific reservations In this case use GET
/api/v1/account/integrations/auth-required/external-reservations
by entering salesOrderNumber
The diagram below shows the dependence of communicating with the API:
Use the following query parameter to get list of a specific reservations:
salesOrderNumber
Example request
jsoncurl -X GET "https://ph-qa0.one.unity.pl/api/v1/stock/integrations/auth-required/external-reservations?salesOrderNumber=1997" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"
In response we will get specific reservations with details
Example response:
json{ "salesOrderNumber": "1997", "products": [ { "productId": "ORNO_OR-NR-6094L7", "lineNumber": "2", "reservedQuantity": 20 }, { "productId": "ORNO_OR-SL-6083BLR4", "lineNumber": "1", "reservedQuantity": 100 } ] }
PUT - partial update provided sales order reservations
Use PUT
/api/v1/account/integrations/auth-required/external-reservations
to reserve products in an external system.
The diagram below shows the dependency of communicating with the API:
In request body it is necessary to put belows parameters:
salesOrderNumber
products
:productId
lineNumber
reservedQuantity
Example request:
jsoncurl -X PUT "https://ph-qa0.one.unity.pl/api/v1/stock/integrations/auth-required/external-reservations" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}" -H "Content-Type: application/json" -d "{ "salesOrderNumber": "1997", "products": [ { "productId": "ORNO_OR-SL-6083BLR4", "lineNumber": "1", "reservedQuantity": 100 }, { "productId": "ORNO_OR-NR-6094L7", "lineNumber": "2", "reservedQuantity": 20 } ] }"