This method allows to reserve a given quantity of model. Especially you can increment, decrement a quantity of a reserved model, or add a new one. If a model is not in the reservation, the method will automatically add it.

Use

Method Url
POST /restful/ghost/orders/sold/

Request Body

The request body contains a list of the operations necessary to update the quantity of some products in the reservation. There are three kind of operation:

Lock and unlock change quantities relatively, set change quantities absolutely.

These three kinds of operations can be combined in any way: you can use just one of these or all of them.

Each operation contains a list of model affected by it. Each model has two attributes:

Example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
    <operation type="lock">
        <model stock_id="3" quantity="3"/>
        <model stock_id="5" quantity="10"/>
    </operation>
    <operation type="unlock">
        <model stock_id="69" quantity="5"/>
        <model stock_id="79" quantity="8"/>
    </operation>
    <operation type="set">
        <model stock_id="55" quantity="10"/>
        <model stock_id="29" quantity="15"/>
    </operation>
</root>

Response Body

The response body contains a list of the model in the reservation. Each model has three attributes:

Example

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root order_id="1000">
    <model stock_id="3" locked="11" available="5" />
    <model stock_id="5" locked="33" available="2" />
    <model stock_id="29" locked="5" available="1" />
    <model stock_id="55" locked="2" available="11" />
    <model stock_id="120" locked="1" available="120" />
    <model stock_id="133" locked="9" available="0" />
</root>

Notes