BigblueDevelopers

Update order

Change an order before the warehouse starts picking it.

POST/bigblue.storeapi.v1.PublicAPI/UpdateOrder

Updates the order with the id in the request. Send the whole order. Fields you leave out are cleared.

Fields that are updated

shipping_address, billing_address, line_items, shipping_price, shipping_tax, additional_tax, additional_discount, shipping_method, b2b, external_order_url and customer_order_id. The B2B instructions template is updated if it changed.

The auto_fulfill_* fields are ignored. To reschedule or move a fulfillment, use the Bigblue app.

You can update an order while it's PENDING or BACKORDER. Once picking starts, updates fail with failed_precondition. See Order statuses.

Request body

orderOrderFormrequired

The full order, with id set.

Responses

200The order was updated.
orderOrder

The updated order, with tracking if a parcel exists.

400A field is invalid or an amount can't be parsed.
{ "code": "invalid_argument", "msg": "error parsing unit price: un-parseable amount 'n/a'" }
404No order with this ID exists.
{ "code": "not_found", "msg": "order not found" }
412The warehouse has started picking the order.
{ "code": "failed_precondition", "msg": "order cannot be updated in status IN_PREPARATION" }
POST/bigblue.storeapi.v1.PublicAPI/UpdateOrder
Request: new address
{
  "order": {
    "id": "BGBL0K3M9XQ2",
    "external_id": "web-10231",
    "language": "fr",
    "currency": "EUR",
    "shipping_address": {
      "first_name": "Camille",
      "last_name": "Bernard",
      "email": "camille@example.com",
      "line1": "14 rue de Rivoli",
      "line2": "Building B",
      "city": "Paris",
      "postal": "75004",
      "country": "FR"
    },
    "line_items": [
      {
        "product": "BGBL-ESPSRT-SMAL",
        "quantity": 2,
        "unit_price": "24.90",
        "unit_tax": "4.15",
        "discount": "5.00"
      }
    ],
    "shipping_price": "4.90",
    "shipping_tax": "0.82"
  }
}
Get, change, update
const { order } = await call('GetOrder', { id: 'BGBL0K3M9XQ2' });

// Remove read-only fields before sending the order back.
const { status, shipped_packages, tracking_number, tracking_url,
        store, submit_time, total, ...form } = order;

await call('UpdateOrder', {
  order: { ...form, shipping_address: { ...form.shipping_address, line1: '14 rue de Rivoli' } },
});