update-orders

HTTP POST

POST https://api.bootic.net/v1/shops/{id}/orders/updaters.json

This relation is used to update order attributes on many orders at once.

The oauth scope for this endpoint is admin, and the requester must own the shop.

Updater operations are not transactional. ie. the update will attempt to update orders individually. If some of them fail for whatever reason, the endpoint will return details on the orders that could not be updated.

This endpoint is in early development. It is now synchronous but in the future might change to an asynchronous, web-hook based model to enable quick updates on large numbers of orders.
$ curl -XPOST -H'Accept:application/json' -H'Content-Type:application/json' -H "Authorization: Bearer xxxx" -i https://api.bootic.net/v1/shops/:shop_id/orders/updaters.json -d[REQUEST_BODY]

Request body

{
  "ids": [
    577048,
    12001
  ],
  "additions": {
    "status": "shipped"
  }
}
ids
Array of order ids to modify.
additions
Object containing order attributes to update (status is the only one supported now)
status
New status to set to all orders in ids array. Valid attributes are “pending”, “closed”, “shipped” and “invalid”.

Response

Status: 200 OK
Content-Type: application/json; charset=utf-8
Connection: keep-alive
ETag: "0728e2965bd03e20a7f1c33add2f8775"
Last-Modified: Fri, 20 Jun 2014 22:34:14 GMT
Cache-Control: must-revalidate, private, max-age=0
Date: Wed, 31 Jul 2013 21:11:52 GMT
X-OAuth-Scopes: admin
{
  "_embedded": {
    "invalid_items": [

    ],
    "valid_items": [
      {
        "_links": {
          "self": {
            "href": "https://api.bootic.net/v1/shops/111/orders/12001"
          }
        },
        "code": "RF3A2CC",
        "id": 577048,
        "status": "shipped"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.bootic.net/v1/shops/111/orders/577048"
          }
        },
        "code": "RF3A2BB",
        "id": 12001,
        "status": "shipped"
      }
    ]
  },
  "additions": {
    "status": "shipped"
  },
  "ids": [
    577048,
    12001
  ],
  "removals": {

  }
}

valid_items and invalid_items arrays contain order entities for orders updated successfully and with validation errors, respectively.