Three lines

Uber

Developers

Patch Cart

PATCHhttps://api.uber.com/v2/eats/orders/{order_id}/cart

Access to These APIs May Require Written Approval From Uber

Uber’s APIs are always under development and as such are subject to changes according to our Versioning & Upgrade policy. As part of Uber’s ongoing privacy improvements, we’ve updated our Developer API program with new scope access policies for third party applications. For further information, please refer to our Getting Started guides.

This Patch Cart endpoint allows a developer to update the shopping cart for an order. Currently, it’s used to indicate fulfillment issues with particular items.

This API is available only for Grocery Stores

This API is available only for stores configured internally with type Grocery Store. Attempts to use this API with stores with other types will result in failed requests with status code 400.

Authorization

OAuth 2.0 Bearer token with the eats.order scope. For more information, see Authentication.

Path Parameters
Name Type Description
order_id string Unique identifying string for an order on Uber Eats. Typically referred to as the “Order UUID”. Provide this id when inquiring about a specific order.

Request Body Parameters

All parameters are required unless stated otherwise.

Request Body Parameters - Fulfillment Issues

Root-level Array of fulfillment issues that indicate which items that could not be fulfilled and what actions were taken to address.

Name Type Description
fulfillment_issues FulfillmentIssue[] Array of fulfillment issues that indicate which items that could not be fulfilled and what actions were taken to address.
Request Body Parameters - FulfillmentIssue

Indicates an item was partially or completely out of stock and the action taken to resolve the issue.

Name Type Description
fulfillment_issue_type string(enum) Indicates the type of fulfillmentIssue.

ALLOWED VALUES:
  • OUT_OF_ITEM
  • PARTIAL_AVAILABILITY
fulfillment_action_type string(enum) Indicates the action being taken to resolve the fulfillment issue if fulfillment_issue_type is OUT_OF_ITEM. The value must match the eater preference specified on the item (however, if the eater has specified REPLACE_FOR_ME or SUBSTITUTE_ME then REMOVE_ITEM is also a valid action).

ALLOWED VALUES:
  • REMOVE_ITEM
  • Remove item if it’s unavailable.
  • REPLACE_FOR_ME
  • Choose replacement for shopper.
root_item Item The root item for which the issue exists.
item_substitute ItemSubstitute The item substitute, required in case of fulfillment_action_type: REPLACE_FOR_ME.
item_availability_info ItemAvailabilityInfo The availability of the replacement item.
Request Body Parameters - Item

References an item within an order’s shopping cart.

Name Type Description
instance_id string Unique identifying string for the shopping cart item, provided by Uber
Request Body Parameters - Item Substitute

References the item for replacement, required in case of fulfillment_action_type: REPLACE_FOR_ME.

Name Type Description
id string Unique identifying string for the item substitute, provided by the store
quantity int Quantity of the item substitute.
selected_modifier_groups ModifierGroup List of modifier groups selected for this item.
Request Body Parameters - Modifier Group

References a modifier for a replacement, required only if the replacement has mandatory modifiers

Name Type Description
id string Unique identifying string for the modifier group, provided by the store
selected_items ModifierGroupOption List of modifier groups options (child items) selected for this modifier group.
Request Body Parameters - Modifier Group Option

References a selected option for a replacement’s modifier group, required only if the replacement has mandatory modifiers

Name Type Description
id string Unique identifying string for the modifier group option, provided by the store
quantity int Quantity of the selected modifier group optiom for the item substitute.
Request Body Parameters - Item Availability Info

The availability of the replacement item.

Name Type Description
items_available int The number of items available. This should be either:
  • the item_substitute availability in case of fulfillment_action_type: REPLACE_FOR_ME or SUBTITUTE_ME
  • the root_item availability in case of fulfillment_issue_type: PARTIAL_AVAILABILITY.
  • Request Body Example

    • Remove an item
    {
       "fulfillment_issues":[
          {
             "fulfillment_issue_type":"OUT_OF_ITEM",
             "fulfillment_action_type":"REMOVE_ITEM",
             "root_item":{
                "instance_id":"DC8C6CFC-1712-4547-A632-7EAB71A98B76",
             },
          }
       ]
    }
    
    • Replace an item, with a substitute without modifier groups
    {
    	"fulfillment_issues": [{
    		"fulfillment_issue_type": "OUT_OF_ITEM",
            "fulfillment_action_type": "REPLACE_FOR_ME",
    		"root_item": {
              "instance_id": "3668730c-ee60-4ec7-aca9-8bdbbc6c616e"
            },
            "item_substitute": {
              "id": "d50b0687-3502-4991-aaf9-ec022f8ef55b",
              "quantity": 1
            }
    	}]
    }
    
    • Replace an item, with a substitute with modifier groups (this feature is not widely available, so it has to be requested).
    {
    	"fulfillment_issues": [{
    		"fulfillment_issue_type": "OUT_OF_ITEM",
            "fulfillment_action_type": "REPLACE_FOR_ME",
    		"root_item": {
              "instance_id": "3668730c-ee60-4ec7-aca9-8bdbbc6c616e"
            },
            "item_substitute": {
              "id": "d50b0687-3502-4991-aaf9-ec022f8ef55b",
              "quantity": 1,
              "selected_modifier_groups": [
                {
                  "id": "0e1fcaeb-0588-45f0-948d-f11746e83c8f",
                  "selected_items": [
                    {
                      "id": "41be8b20-fec0-4780-840f-713901475f32",
                      "quantity": 1,
                    },
                    {
                      "id": "2bb5d0ae-6a4e-461e-b74b-455e59420778",
                      "quantity": 1,
                    },
                  ]
                },
                {
                  "id": "a97dfc2b-8d91-4fb0-929c-8f48be0e4208",
                  "selected_items": [
                    {
                      "id": "64b6cc0c-64a1-480f-bd6c-13ce12bcaad3",
                      "quantity": 2,
                    }
                  ]
                },
              ]
            }
    	}]
    }
    
    • Reduce the quantity of an item
    {
       "fulfillment_issues":[
          {
             "fulfillment_issue_type":"PARTIAL_AVAILABILITY",
             "root_item":{
                "instance_id":"DC8C6CFC-1712-4547-A632-7EAB71A98B76",
             },
             "item_availability_info":{
                "items_available":1
             }
          }
       ]
    }
    

    Response

    Status-Code: 204 No Content

    This endpoint returns an empty response body.

    FAQ

    • If you substitute an item with an item marked as out of stock in the current menu, would the patch/cart call fail? Any validation rules on the item availability?

      • Yes, there will be validation on the item availability
    • In which cases would the Patch/cart request be rejected?

      • Invalid or missing root_item instance_id
      • Invalid or missing item_substitute id, in case of fulfillment_action_type: REPLACE_FOR_ME
      • Missing or non-positive item substitute quantity, in case of fulfillment_action_type: REPLACE_FOR_ME
      • The total price of item substitute is higher than total price of root item, including the price of any selected modifier group option of both.
      • The fulfillment_action_type does not match the eater preference specified on the item (however, if the eater has specified REPLACE_FOR_ME or SUBSTITUTE_ME then REMOVE_ITEM is also a valid action).
      • The selected modifiers groups and/or modifier group options do not match the requirements of the item substitute for minimum/maximum quantity.
      • The selected modifiers groups and/or modifier group options do not belong to the requested item substitute.
    • Could the item substitute quantity larger than root item quantity?

      • Yes, as long as the total price is less or equal than original price
    • Could merchants call the Patch/cart endpoint several times, up until the order has been picked up by the courier?

      • Yes
    • Would the “PATCH CART API” also work on the child item level, in the cart(Items inside a modifier group)

      • Only the specification of modifier groups for replacement is supported. If you need to change only one modifier option for one item, you have to send the whole item with the updated selection of modifier groups and options.

    Uber

    Developers
    © 2023 Uber Technologies Inc.