Product API
Fulfillment guide
Send Order
Cancel order

Cancel order

POST api.foodin.ai/users/{ user_id }/orders/{ order_id }/cancel;

Request

Parameters

FieldTypeDescription
user_idstringThe ID of the user.
order_idstringThe ID of the order.

Request examples

const axios = require("axios");
 
const options = {
  method: "POST",
  url: "https://api.foodin.ai/users/{user_id}/orders/{order_id}/cancel",
  headers: {
    Accept: "application/json",
    Authorization: "Bearer <token>",
    "Content-Type": "application/json",
  },
};
 
axios(options)
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.error(error);
  });

Response

Example

{
  "id": "12345676789012345678780",
  "status": "canceled",
  "order_url": "https://foodin.ai/example_store//example-order",
  "created_at": "2018-02-22T00:00:00Z",
  "cancellation_reason": "delivery_driven",
  "locale": "en_US",
  "fulfillment_details": {
    "window_starts_at": "2018-02-22T00:00:00Z",
    "window_ends_at": "2018-02-22T00:30:00Z"
  },
  "items": [
    {
      "line_num": "68",
      "qty": 9,
      "qty_unit": "each",
      "replaced": false,
      "scan_code": "00070481001179",
      "replacement_policy": "shoppers_choice",
      "item": {
        "upc": "123456789077",
        "rrc": "",
        "requested_upc": "123456789077",
        "requested_rrc": "",
        "delivered_upc": "123456789077",
        "delivered_rrc": ""
      }
    }
  ]
}

4XX Errors

CodeCauseError Message
400Too late to cancel order"too_late"
400Request could not be processed at this time"The request could not be completed at this time, try again later."
400Invalid user id"User Not Found"
403Inactive user"User Not Active"
404Order not found"Resource not found"