GET /v1/orders
Get list of orders

Params

Param name Description
customer_id
required

Customer ID. Selects orders for that customer.

Validations:

  • Must be String


GET /v1/orders/:id
Get single order

Params

Param name Description
id
optional

Order ID

Validations:

  • Must be Integer


POST /v1/orders
Create a new order

Currently all orders are quantity of 1 for only 1 box. For now, post a new order for every box and every quantity.

Examples

{
      "box_id": 12,
      "customer_id": 123,
      "frequency": "weekly",
      "substitutions": [
        23,
        54,
        3
      ],
      "exclusions": [
        17,
        98,
        345,
        7
      ],
      "extras_one_off": false,
      "extras": [
        {
          "id": 11,
          "quantity": 1
        },
        {
          "id": 14,
          "quantity": 2
        }
      ]
}

Params

Param name Description
order
required

JSON object representing the new order

Validations:

  • Must be a Hash

order[customer_id]
optional

The customer ID. If you don't have this refer to customer API.

Validations:

  • Must be String

order[box_id]
required

ID of the box

Validations:

  • Must be Integer

order[extras_one_off]
optional

True or false determining whether the extras should match the frequency of the box (false), or be a one off (true)

Validations:

  • Must be one of: boolean.

order[extras]
optional

Array of extras, refer to above example

Validations:

  • Must be one of: extra.

order[substitutions]
optional

Array of integers representing box_item IDs that can be substituted for exclusions

Validations:

  • Must be one of: id.

order[exclusions]
optional

Array of integers representing box_item IDs that should be excluded

Validations:

  • Must be one of: id.

order[frequency]
optional

Indicates how often the order should be delivered. Acceptable values are 'single', 'weekly', or 'fortnightly'

Validations:

  • Must be String