This method allows to book and close an order with the desired products.

It creates a new order in Booked status, acking you the numerical id of the order created. The products, if previously added to the reservation, will be automatically removed from reservation (created with Reserve) and added to this one.

Use

Method Url
POST /restful/ghost/supplierorder/acquire/

Authentication

Remember to authenticate properly, using HTTP Basic Authentication with your API-Key as username and your password.

Request Headers

This method works using JSON or XML format, set the following headers to choose the format you want to use:

Key Value
Accept text/plain
Content-type application/xml or application/json

Request Body

The request body contains a list of desired products that will join the created order. Each product has two attributes:

The quantity can be less, equal or greater than the quantities in the reservation:

The optional tag carrierId assigns the carrier of the given ID to the order. You can find all available carriers ids using Carriers API If omitted, a default carrier will be assigned.

The optional tag autoConfirm takes a boolean value and operates as follows:

If the tag is omitted, the order will behave as if autoConfirm was set to true.

Example XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<supplierorder>
    <products>
        <product stock_id="59" quantity="10"/>
        <product stock_id="10" quantity="7"/>
        <product stock_id="29" quantity="13"/>
    </products>
    <carrierId>20</carrierId>
    <autoConfirm>true</autoConfirm>
</supplierorder>

Example JSON

{
    "products": [
        {
            "stock_id": "3601",
            "quantity": "2"
        }
    ],
    "carrierId": 39,
    "autoConfirm": false
}

Response Body

The response body contains a number which represents the order_id of the created order.

Notes