POST /v1/orders

Creates a new order. If any requested item is no longer available, the entire order should fail.

The status field on the returned order can be set to any string. Partners should choose values here based on their unique fulfillment process. Please supply Merchbar a list of possible values this field can take.

Note: Merchbar offers international shipping with a number of our partners. If you do not support international shipping, let us know, but also make sure to return an error response here if a country other than "US" is specified.

Example Request Body:

{
    "address": {
        "first_name": "Loyal",
        "last_name": "Customer",
        "line1": "123 Main St.",
        "line2": null,
        "city": "San Francisco",
        "state": "CA",
        "postal_code": "94102",
        "country": "US"
    },
    "line_items": [
        {
            "id": "SKU456",
            "quantity": 2
        },
        {
            "id": "SKU123",
            "variant_id": "SKU1232X",
            "quantity": 1
        }
    ],
    "selected_shipping_option_id": "USPSFC"
}

Example Response:

{
    "data": {
        "id": "CONF128472-294",
        "created": "2016-08-01T13:12:11Z",
        "status": "RECEIVED",
        "tracking_number": null,
        "address": {
            "first_name": "Loyal",
            "last_name": "Customer",
            "line1": "123 Main St.",
            "line2": null,
            "city": "San Francisco",
            "state": "CA",
            "postal_code": "94102",
            "country": "US"
        },
        "line_items": [
            {
                "id": "SKU456",
                "quantity": 2,
                "available": true
            },
            {
                "id": "SKU123",
                "variant_id": "SKU1232X",
                "quantity": 1,
                "available": true
            }
        ],
        "shipping": {
            "id": "USPSFC",
            "title": "USPS First-Class Mail",
            "ship_date": "2016-08-01",
            "ship_time": "5-6 business days",
            "price": "6.98",
            "currency": "USD"
        }
    }
}
Was this article helpful?
0 out of 0 found this helpful