---
# System prepended metadata

title: Endpoint Specs
tags: [order-options]

---

# Endpoint Specs
We're adding the property below to the request and response models. Passing in an array of objects will allow us to pass in more information ie. `send-sms` where you would need a phone number.
```Javascript
"order_options": [
    { "type" : "contact-free-delivery" },
    { "type" : "include-plastic-cutlery" },
    { "type" : "send-sms", "phone": 1231231234 }
]
```

### Create Order
**POST** `/api/v1/orders`

**REQUEST BODY**
```Javascript=
{
   "order":{
      "placed_via":"web",
      "anonymous_id":"82d30cbc-2901-45e2-9159-2ca82753d4df",
      "customer_origin":"marketplace",
      "payment_method":"credit",
      "payment_method_id":14408042,
      "shop_id":8075,
      "order_items_attributes":[
         {
            "products_quantity":1,
            "products_type_id":"4602203",
            "selection_ids":[
               "45312387"
            ]
         }
      ],
      "order_options": [
        { "type" : "contact-free-delivery" },
        { "type" : "include-plastic-cutlery" },
        { "type" : "send-sms", "phone": 1231231234 }
      ],
      "customers_id":"6197741",
      "email":"eubert@slicelife.com",
      "delivery_first_name":"Eubert",
      "delivery_last_name":"Go",
      "delivery_name":"Eubert Go",
      "delivery_address":"36 Avenue Of The Americas",
      "delivery_city":" New York",
      "delivery_postcode":"10013",
      "delivery_state":"NY",
      "delivery_telephone":"2222223333",
      "delivery_instruction":"Extra sauce please",
      "shipping_type":"delivery"
   },
   "include_order_fees":true
}
```

### Get Order
**GET** `/api/v1/orders`

**REQUEST RESPONSE**
```Javascript=
{
  "orders": [
    {
      "id": 26376666,
      "uuid": "13e5269a-823e-477f-8798-124dcb5d9bc3",
      "shipping_type": "Delivery",
      "date_purchased": "2020-03-19T16:53:19.000Z",
      "delivery_address": "36 Avenue Of The Americas",
      "delivery_city": "New York",
      "delivery_postcode": "10013",
      "delivery_state": "NY",
      "delivery_instruction": "Extra sauce please",
      "delivery_telephone": "2222223333",
      "delivery_first_name": "Eubert",
      "delivery_last_name": "Go",
      "delivery_name": "Eubert Go",
      "payment_method": "credit",
      "email": "eubert@slicelife.com",
      "confirmed_at": null,
      "voided_at": null,
      "payment_status": "paid",
      "progress_step": null,
      "total": "20.55",
      "subtotal": "18.0",
      "tax": "1.6",
      "tip": "0.0",
      "shop_id": 8075,
      "shop_name": "AOA Bar \u0026 Grill",
      "invalid_selections": false,
      "min_eta_timestamp": "2020-03-19T17:23:19.000Z",
      "max_eta_timestamp": "2020-03-19T17:38:19.000Z",
      "coupons": [],
      "order_items": [
        {
          "products_final_price": "18.0",
          "products_quantity": 1,
          "products_id": 2487598,
          "product_name": "Grandma's Pizza",
          "product_type_name": "Pizza",
          "product_type_price": "18.0",
          "products_type_id": 4602203,
          "order_item_selections": [
            {
              "name": "Regular Crust",
              "price": "0.0",
              "selection_id": 45312387,
              "addon_id": 4444753,
              "addon_name": "Choose Crust"
            }
          ]
        }
      ],
      "order_options": [
        { "type" : "contact-free-delivery" },
        { "type" : "include-plastic-cutlery" },
        { "type" : "send-sms", "phone": 1231231234 }
      ],
      "user_facing_line_items": [
        {
          "name": "Tax",
          "value": "$1.60"
        },
        {
          "name": "Fee",
          "value": "$0.95"
        },
        {
          "name": "Delivery Fee",
          "value": "Free"
        }
      ],
      "adjustments": [
        {
          "order_id": 26376666,
          "amount": "0.0",
          "category": "delivery_fee",
          "tag": "delivery_fee",
          "description": "Delivery Fee"
        },
        {
          "order_id": 26376666,
          "amount": "1.6",
          "category": "tax",
          "tag": "tax",
          "description": "Tax"
        },
        {
          "order_id": 26376666,
          "amount": "0.0",
          "category": "discount_percent",
          "tag": "discount_percent",
          "description": "% discount"
        }
      ],
      "transactions": [
        {
          "payment_type": "Visa",
          "last_four": "1111"
        },
        {
          "payment_type": "Visa",
          "last_four": "1111"
        },
        {},
        {},
        {}
      ]
    }
  ]
}
```


## Future Considerations
### List order options
**GET** `/api/v1/orders/options`

**QUERY PARAMETERS**
| Name | Description | 
| -------- | -------- |
| shop_id     | The shop identifier. If not specified, returns a default all the order options *(optional)*     | 

**RESPONSE**
```Javascript=
[
    {
     id: 1,
     display: "Contact free delivery",
     request: "contact-free-delivery"
    },
    {
     id: 2,
     display: "Include plastic cutlery",
     request: "include-plastic-cutlery"
    }
]
```
| Name | Description | 
| -------- | -------- |
| id      | The order option identifier  |
| display | The value rendered client-side |
| request | The value passed to the create order request body under `order_options`|

###### tags: `order-options`
