# Order selection API

> Get the delivery method, date, time slot and pickup location the customer chose for a Shopify order.

Source: https://www.buunto.com/docs/developers/order-selection-api

This endpoint returns what the customer chose with Buunto for an order: the delivery method, the date, the time slot and the pickup location. Use it from an app or a backend that needs the date of an order, for example right after the order is created.

```
GET https://datepicker.buunto.com/orders/{orderId}/selection?shop={shopDomain}
```

- `orderId`: the order's ID in Shopify, the long number, for example `5547995693254`. Not the order name such as `#1001`.
- `shopDomain`: the store's myshopify domain, for example `shopname.myshopify.com`. The store's own domain isn't accepted here.

It needs no authentication. Example response:

```json
{
  "status": "SELECTION_FOUND",
  "selection": {
    "method": "SHIPPING",
    "date": "2024-03-28",
    "timeSlot": {
      "from": "10:00",
      "to": "11:00"
    }
  }
}
```

`status` has three possible values:

- `ORDER_NOT_PROCESSED`: Buunto hasn't recorded the order: not yet, or it isn't one of this store's orders. Buunto waits up to about 25 seconds for it before answering, which is enough in most cases, so this status comes after that wait.
- `NO_SELECTION`: Buunto has the order, and no date or time slot was chosen for it.
- `SELECTION_FOUND`: Buunto has the order and its selection, in `selection`.

`selection` holds:

- `method`: `LOCAL_DELIVERY`, `STORE_PICKUP` or `SHIPPING`. Left out when the store offers a single delivery method.
- `date`: the date, in `YYYY-MM-DD` format.
- `timeSlot`: the time slot's start and end, as `HH:MM`. Left out when the order has no time slot.
- `pickupLocation`: the pickup location's name. Left out when the order has no location.

The endpoint is also described as OpenAPI 3.1 at [`https://datepicker.buunto.com/api/v1/openapi.json`](https://datepicker.buunto.com/api/v1/openapi.json), with its errors and rate limit.
