Grubhub MCP server for AI agents

Let Claude, ChatGPT or your own agent read and act on Grubhub: 19 typed functions through one MCP server. No Grubhub API key needed.

Functions
19
Sign-in
For account actions
Works with
MCP, HTTP, Node, Python

Connect

Just Grubhub

An MCP server for Grubhub alone, with one tool per function. Paste it into Claude, ChatGPT, Cursor or any MCP client as a remote server.

https://api.bowmark.ai/mcp/site/grubhub
Every site

One MCP server for Grubhub and every other site Bowmark covers. Your agent looks up what it needs and calls it.

https://api.bowmark.ai/mcp
Set it up in your client

Both need a Bowmark API key. The quickstart gets you one and a first result in a few minutes. Functions that need a login use the person's own account: how sign-in works.

Functions

Open a function to see its arguments, what it returns and how to call it.

Read 14
  • getCartReads what is in the Grubhub cart.

    Arguments

    NameTypeRequired
    cartKeystringNo

    Returns GrubhubCart

    interface GrubhubCartLine {
      /** The id removeFromCart/updateCartItem take. */
      lineId: string;
      itemId: string;
      restaurantId: string;
      name: string;
      quantity: number;
      /** One unit, in cents, before options. */
      unitPriceCents: number;
      /** This line's total in cents, options and quantity included. */
      totalCents: number;
      specialInstructions: string;
      /** Chosen option ids, as getMenuItem().choices[].options[].id. */
      optionIds: string[];
    }
    
    interface GrubhubCart {
      /** Pass to the cart functions in a LATER run to reach this same cart; within one run they find it on their own. null while no cart exists. */
      cartKey: string | null;
      cartId: string | null;
      items: GrubhubCartLine[];
      itemCount: number;
      subtotalCents: number;
      currency: string;
      restaurantIds: string[];
      // Where the PERSON finishes: the restaurant page, with these items to add again (the cart is an anonymous Grubhub session no link can open). A refusal when the cart is empty or spans no single restaurant. Bowmark never orders.
      checkout: GrubhubCheckoutHandoff;
    }
    
    // The checkout handoff: where the PERSON finishes. Bowmark never pays, books or orders.
    // Switch on `status`; a status you do not recognise means "show the person `url` and stop".
    interface GrubhubCheckoutHandoff {
      status: "ready_to_checkout" | "needs_login" | "unavailable";
      url: string;                       // the https page to open on the site
      urlKind?: "carries_items" | "signed_in_cart" | "product_page"; // ready_to_checkout only: does the link carry the items, or only open the item's page
      reason?: string;                   // unavailable only: out_of_stock | not_available_for_dates | not_sold_online | region_not_served | quantity_unavailable | empty_cart
      detail?: string;                   // unavailable only: one sentence saying why
      account: { site: string; hint: string; signedInAs?: string };
      summary: { items: { title: string; variant: string | null; quantity: number; unitPrice: string | null; lineTotal: string | null; url?: string; id?: string }[]; total: string | null; currency: string } | null;
      warnings: string[];
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getCart

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getCart();
  • getDeliveryEstimateWhether a Grubhub restaurant delivers to a place and at what fee, order minimum, ETA, distance and next arrival time.

    Arguments

    NameTypeRequired
    idstring
    The restaurant id search() returns.
    Yes
    placestring
    Where to deliver: a US place, or lat+lng.
    No
    latnumberNo
    lngnumberNo

    Returns GrubhubDeliveryEstimate

    interface GrubhubMoney {
      /** Cents, as Grubhub reports it. */
      cents: number;
      currency: string;
    }
    
    interface GrubhubDeliveryEstimate {
      restaurantId: string;
      name: string | null;
      /** false when this point is outside the restaurant's delivery area. */
      deliversHere: boolean;
      open: boolean;
      openForDelivery: boolean;
      openForPickup: boolean;
      distanceMiles: number | null;
      deliveryFee: GrubhubMoney | null;
      deliveryFeeBeforeDiscounts: GrubhubMoney | null;
      orderMinimum: GrubhubMoney | null;
      deliveryMinutes: number | null;
      pickupMinutes: number | null;
      /** ISO instant the next delivery placed now would arrive. */
      nextDeliveryTime: string | null;
      point: { lat: number; lng: number };
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getDeliveryEstimate

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getDeliveryEstimate({ id: "469121", lat: 40.7484, lng: -73.9857 });
  • getFavoriteRestaurantsThe signed-in diner's favourite Grubhub restaurants, with ids getRestaurant() and getMenu() take.

    Arguments

    None.

    Returns GrubhubFavorite[]

    interface GrubhubFavorite {
      /** What getRestaurant()/getMenu() take. */
      id: string | null;
      name: string | null;
      url: string | null;
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getFavoriteRestaurants

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getFavoriteRestaurants();
  • getMenuThe menu of one Grubhub restaurant by search()'s id: categories → items with price, description, availability and image.

    Arguments

    NameTypeRequired
    idstringYes

    Returns GrubhubMenuCategory[]

    interface GrubhubMoney {
      /** Cents, as Grubhub reports it. */
      cents: number;
      currency: string;
    }
    
    interface GrubhubMenuItem {
      id: string;
      name: string;
      description: string | null;
      price: GrubhubMoney | null;
      available: boolean;
      popular: boolean;
      image: string | null;
    }
    
    interface GrubhubMenuCategory {
      id: string;
      name: string;
      items: GrubhubMenuItem[];
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getMenu

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getMenu("469121");
  • getMenuItemOne Grubhub menu item (ids from getMenu()) with every customization group and option, surcharges in cents, nested choices, price range and dish tags.

    Arguments

    NameTypeRequired
    args{ restaurantId: string; itemId: string }Yes

    Returns GrubhubMenuItemDetail

    interface GrubhubMoney {
      /** Cents, as Grubhub reports it. */
      cents: number;
      currency: string;
    }
    
    interface GrubhubMenuItem {
      id: string;
      name: string;
      description: string | null;
      price: GrubhubMoney | null;
      available: boolean;
      popular: boolean;
      image: string | null;
    }
    
    interface GrubhubChoiceOption {
      id: string;
      name: string;
      /** Surcharge on top of the item price. */
      price: GrubhubMoney | null;
      available: boolean;
      /** Nested choices this option opens (e.g. a size that has its own toppings). */
      choices: GrubhubChoiceGroup[];
    }
    
    interface GrubhubChoiceGroup {
      id: string;
      name: string;
      minChoices: number;
      /** null when Grubhub sets no cap. */
      maxChoices: number | null;
      options: GrubhubChoiceOption[];
    }
    
    interface GrubhubMenuItemDetail extends GrubhubMenuItem {
      restaurantId: string;
      category: string | null;
      /** Cheapest and dearest the item can come to with its choices. */
      priceRange: { min: GrubhubMoney | null; max: GrubhubMoney | null };
      tags: string[];
      choices: GrubhubChoiceGroup[];
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getMenuItem

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getMenuItem({ restaurantId: "469121", itemId: "24017014" });
  • getOrderHistoryThe signed-in diner's past Grubhub orders.

    Arguments

    None.

    Returns GrubhubOrderSummary[]

    interface GrubhubOrderSummary {
      /** What getOrderStatus() takes. */
      id: string | null;
      restaurantId: string | null;
      restaurantName: string | null;
      /** Grubhub's own status word, UNMEASURED signed in. */
      status: string | null;
      placedAt: string | null;
      totalCents: number | null;
      currency: string | null;
      itemCount: number | null;
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getOrderHistory

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getOrderHistory();
  • getOrderStatusOne Grubhub order's status, ETA and line items, by the id getOrderHistory() returns.

    Arguments

    NameTypeRequired
    orderIdstringYes

    Returns GrubhubOrderStatus

    interface GrubhubOrderSummary {
      /** What getOrderStatus() takes. */
      id: string | null;
      restaurantId: string | null;
      restaurantName: string | null;
      /** Grubhub's own status word, UNMEASURED signed in. */
      status: string | null;
      placedAt: string | null;
      totalCents: number | null;
      currency: string | null;
      itemCount: number | null;
    }
    
    interface GrubhubOrderItem {
      name: string | null;
      quantity: number | null;
    }
    
    interface GrubhubOrderStatus extends GrubhubOrderSummary {
      /** Minutes until arrival; null when the order has no live ETA (delivered, cancelled). */
      etaMinutes: number | null;
      items: GrubhubOrderItem[];
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getOrderStatus

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getOrderStatus("0");
  • getPaymentMethodsThe signed-in diner's saved Grubhub payment methods.

    Arguments

    None.

    Returns GrubhubPaymentMethod[]

    interface GrubhubPaymentMethod {
      id: string | null;
      type: "credit_card" | "paypal" | "venmo" | "amazon_pay" | "cash_app";
      /** Card brand (Visa, Amex …); null for a wallet. */
      brand: string | null;
      /** Last four digits of a card, Grubhub never sends more. */
      last4: string | null;
      /** Card expiry as Grubhub returns it, when it does. */
      expires: string | null;
      /** A wallet's handle: PayPal/Amazon email, Venmo or Cash App username. */
      account: string | null;
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getPaymentMethods

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getPaymentMethods();
  • getPromoOffersActive promo codes, spend-based thresholds and the delivery-fee badge Grubhub shows for one restaurant, priced for a delivery point.

    Arguments

    NameTypeRequired
    idstring
    The restaurant id search() returns.
    Yes
    placestringNo
    latnumberNo
    lngnumberNo

    Returns GrubhubPromoOffers

    interface GrubhubMoney {
      /** Cents, as Grubhub reports it. */
      cents: number;
      currency: string;
    }
    
    interface GrubhubPromoCode {
      code: string | null;
      title: string | null;
      description: string | null;
      amount: GrubhubMoney | null;
      orderMinimum: GrubhubMoney | null;
      firstTimeOnly: boolean;
      /** ISO instant, or null when Grubhub set none. */
      expiresAt: string | null;
    }
    
    interface GrubhubPromoOffers {
      restaurantId: string;
      name: string | null;
      /** false when this restaurant did not turn up in the sampled search results at this point. */
      found: boolean;
      promoCodes: GrubhubPromoCode[];
      /** Spend thresholds that unlock a site-wide perk (e.g. free delivery over $X). */
      spendBasedThresholds: GrubhubMoney[];
      /** The promo badge Grubhub shows next to the delivery fee in search, e.g. "$0 delivery". */
      deliveryFeeBadge: string | null;
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getPromoOffers

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getPromoOffers({ id: "2803486", lat: 34.0522, lng: -118.2437 });
  • getRestaurantReads one Grubhub restaurant by search()'s id: address, cuisines, rating, price level, pickup and its full menu.

    Arguments

    NameTypeRequired
    idstringYes

    Returns GrubhubRestaurant

    interface GrubhubMoney {
      /** Cents, as Grubhub reports it. */
      cents: number;
      currency: string;
    }
    
    interface GrubhubAddress {
      street: string | null;
      city: string | null;
      state: string | null;
      zip: string | null;
    }
    
    interface GrubhubMenuItem {
      id: string;
      name: string;
      description: string | null;
      price: GrubhubMoney | null;
      available: boolean;
      popular: boolean;
      image: string | null;
    }
    
    interface GrubhubMenuCategory {
      id: string;
      name: string;
      items: GrubhubMenuItem[];
    }
    
    interface GrubhubRestaurant {
      id: string;
      name: string;
      url: string;
      address: GrubhubAddress;
      cuisines: string[];
      rating: number | null;
      ratingCount: number | null;
      priceRating: number | null;
      pickup: boolean;
      menu: GrubhubMenuCategory[];
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getRestaurant

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getRestaurant("469121");
  • getRestaurantReviewsA page of diner reviews for one Grubhub restaurant: stars, text, date, sentiment and items ordered, with the total count.

    Arguments

    NameTypeRequired
    idstringYes
    limitnumber
    1-50, default 10.
    No
    pagenumber
    1-based, default 1.
    No

    Returns GrubhubReviews

    interface GrubhubReview {
      id: string;
      /** The diner's first name, as Grubhub shows it. */
      reviewer: string | null;
      stars: number | null;
      text: string | null;
      /** ISO date the review was written. */
      date: string | null;
      sentiment: string | null;
      items: { id: string; name: string }[];
    }
    
    interface GrubhubReviews {
      restaurantId: string;
      totalCount: number;
      page: number;
      totalPages: number;
      reviews: GrubhubReview[];
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getRestaurantReviews

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getRestaurantReviews({ id: "469121", limit: 5 });
  • getSavedAddressesThe signed-in diner's saved Grubhub delivery addresses: label, street, unit, city, state, ZIP, coordinates and delivery instructions.

    Arguments

    None.

    Returns GrubhubSavedAddress[]

    interface GrubhubSavedAddress {
      id: string | null;
      label: string | null;
      street: string | null;
      unit: string | null;
      city: string | null;
      state: string | null;
      zip: string | null;
      lat: number | null;
      lng: number | null;
      instructions: string | null;
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/getSavedAddresses

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.getSavedAddresses();
  • listCuisinesCuisine tags carried by restaurants delivering near a place, most common first with a count of how many of the sampled restaurants carry each.

    Arguments

    NameTypeRequired
    placestring
    A US place to sample, geocoded via OpenStreetMap.
    No
    latnumberNo
    lngnumberNo
    sampleSizenumber
    How many nearby restaurants to sample cuisines from, 1-50, default 50.
    No

    Returns GrubhubCuisines

    interface GrubhubCuisine {
      name: string;
      /** How many of the sampled restaurants carry this cuisine tag. */
      restaurantCount: number;
    }
    
    interface GrubhubCuisines {
      point: { lat: number; lng: number };
      /** How many restaurants were actually sampled (≤ sampleSize). */
      sampledRestaurants: number;
      /** Grubhub's own count of restaurants delivering to this point. */
      totalResults: number;
      /** Cuisine tags carried by the sampled restaurants, most common first. */
      cuisines: GrubhubCuisine[];
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/listCuisines

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.listCuisines({ lat: 40.7484, lng: -73.9857, sampleSize: 20 });
Act 5
  • addToCartAdds a menu item with options, quantity and instructions to an anonymous Grubhub cart and returns the cart with a cartKey for later runs.

    Arguments

    NameTypeRequired
    restaurantIdstringYes
    itemIdstringYes
    quantitynumber
    1-50, default 1.
    No
    optionIdsstring[]
    Option ids from getMenuItem().choices[].options[].id.
    No
    instructionsstringNo
    cartKeystring
    A cart from an earlier run; omit to use (or start) this run's cart.
    No

    Returns GrubhubCart

    interface GrubhubCartLine {
      /** The id removeFromCart/updateCartItem take. */
      lineId: string;
      itemId: string;
      restaurantId: string;
      name: string;
      quantity: number;
      /** One unit, in cents, before options. */
      unitPriceCents: number;
      /** This line's total in cents, options and quantity included. */
      totalCents: number;
      specialInstructions: string;
      /** Chosen option ids, as getMenuItem().choices[].options[].id. */
      optionIds: string[];
    }
    
    interface GrubhubCart {
      /** Pass to the cart functions in a LATER run to reach this same cart; within one run they find it on their own. null while no cart exists. */
      cartKey: string | null;
      cartId: string | null;
      items: GrubhubCartLine[];
      itemCount: number;
      subtotalCents: number;
      currency: string;
      restaurantIds: string[];
      // Where the PERSON finishes: the restaurant page, with these items to add again (the cart is an anonymous Grubhub session no link can open). A refusal when the cart is empty or spans no single restaurant. Bowmark never orders.
      checkout: GrubhubCheckoutHandoff;
    }
    
    // The checkout handoff: where the PERSON finishes. Bowmark never pays, books or orders.
    // Switch on `status`; a status you do not recognise means "show the person `url` and stop".
    interface GrubhubCheckoutHandoff {
      status: "ready_to_checkout" | "needs_login" | "unavailable";
      url: string;                       // the https page to open on the site
      urlKind?: "carries_items" | "signed_in_cart" | "product_page"; // ready_to_checkout only: does the link carry the items, or only open the item's page
      reason?: string;                   // unavailable only: out_of_stock | not_available_for_dates | not_sold_online | region_not_served | quantity_unavailable | empty_cart
      detail?: string;                   // unavailable only: one sentence saying why
      account: { site: string; hint: string; signedInAs?: string };
      summary: { items: { title: string; variant: string | null; quantity: number; unitPrice: string | null; lineTotal: string | null; url?: string; id?: string }[]; total: string | null; currency: string } | null;
      warnings: string[];
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/addToCart

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.addToCart({ restaurantId: "<restaurantId>", itemId: "<itemId>" });
  • applyPromoCodeApplies a promo code to the anonymous Grubhub cart and says whether it applied, and why not when it did not.

    Arguments

    NameTypeRequired
    args{ code: string; cartKey?: string }Yes

    Returns GrubhubPromoResult

    interface GrubhubCartLine {
      /** The id removeFromCart/updateCartItem take. */
      lineId: string;
      itemId: string;
      restaurantId: string;
      name: string;
      quantity: number;
      /** One unit, in cents, before options. */
      unitPriceCents: number;
      /** This line's total in cents, options and quantity included. */
      totalCents: number;
      specialInstructions: string;
      /** Chosen option ids, as getMenuItem().choices[].options[].id. */
      optionIds: string[];
    }
    
    interface GrubhubCart {
      /** Pass to the cart functions in a LATER run to reach this same cart; within one run they find it on their own. null while no cart exists. */
      cartKey: string | null;
      cartId: string | null;
      items: GrubhubCartLine[];
      itemCount: number;
      subtotalCents: number;
      currency: string;
      restaurantIds: string[];
      // Where the PERSON finishes: the restaurant page, with these items to add again (the cart is an anonymous Grubhub session no link can open). A refusal when the cart is empty or spans no single restaurant. Bowmark never orders.
      checkout: GrubhubCheckoutHandoff;
    }
    
    // The checkout handoff: where the PERSON finishes. Bowmark never pays, books or orders.
    // Switch on `status`; a status you do not recognise means "show the person `url` and stop".
    interface GrubhubCheckoutHandoff {
      status: "ready_to_checkout" | "needs_login" | "unavailable";
      url: string;                       // the https page to open on the site
      urlKind?: "carries_items" | "signed_in_cart" | "product_page"; // ready_to_checkout only: does the link carry the items, or only open the item's page
      reason?: string;                   // unavailable only: out_of_stock | not_available_for_dates | not_sold_online | region_not_served | quantity_unavailable | empty_cart
      detail?: string;                   // unavailable only: one sentence saying why
      account: { site: string; hint: string; signedInAs?: string };
      summary: { items: { title: string; variant: string | null; quantity: number; unitPrice: string | null; lineTotal: string | null; url?: string; id?: string }[]; total: string | null; currency: string } | null;
      warnings: string[];
    }
    
    interface GrubhubPromoResult {
      /** The code as Grubhub knows it (its own casing). */
      code: string;
      /** true only when Grubhub attached it to the cart. */
      applied: boolean;
      /** What the code is for, e.g. "Get $2 off your first order"; null when Grubhub has no such code. */
      description: string | null;
      /** Why it was not applied, Grubhub's own reason ("This promo code has expired", "CODE_NOT_AVAILABLE_TO_ORDER_TYPE"); null when applied. */
      reason: string | null;
      cart: GrubhubCart;
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/applyPromoCode

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.applyPromoCode({});
  • removeFromCartRemoves one line from the Grubhub cart and returns what is left.

    Arguments

    NameTypeRequired
    args{ lineId: string; cartKey?: string }Yes

    Returns GrubhubCart

    interface GrubhubCartLine {
      /** The id removeFromCart/updateCartItem take. */
      lineId: string;
      itemId: string;
      restaurantId: string;
      name: string;
      quantity: number;
      /** One unit, in cents, before options. */
      unitPriceCents: number;
      /** This line's total in cents, options and quantity included. */
      totalCents: number;
      specialInstructions: string;
      /** Chosen option ids, as getMenuItem().choices[].options[].id. */
      optionIds: string[];
    }
    
    interface GrubhubCart {
      /** Pass to the cart functions in a LATER run to reach this same cart; within one run they find it on their own. null while no cart exists. */
      cartKey: string | null;
      cartId: string | null;
      items: GrubhubCartLine[];
      itemCount: number;
      subtotalCents: number;
      currency: string;
      restaurantIds: string[];
      // Where the PERSON finishes: the restaurant page, with these items to add again (the cart is an anonymous Grubhub session no link can open). A refusal when the cart is empty or spans no single restaurant. Bowmark never orders.
      checkout: GrubhubCheckoutHandoff;
    }
    
    // The checkout handoff: where the PERSON finishes. Bowmark never pays, books or orders.
    // Switch on `status`; a status you do not recognise means "show the person `url` and stop".
    interface GrubhubCheckoutHandoff {
      status: "ready_to_checkout" | "needs_login" | "unavailable";
      url: string;                       // the https page to open on the site
      urlKind?: "carries_items" | "signed_in_cart" | "product_page"; // ready_to_checkout only: does the link carry the items, or only open the item's page
      reason?: string;                   // unavailable only: out_of_stock | not_available_for_dates | not_sold_online | region_not_served | quantity_unavailable | empty_cart
      detail?: string;                   // unavailable only: one sentence saying why
      account: { site: string; hint: string; signedInAs?: string };
      summary: { items: { title: string; variant: string | null; quantity: number; unitPrice: string | null; lineTotal: string | null; url?: string; id?: string }[]; total: string | null; currency: string } | null;
      warnings: string[];
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/removeFromCart

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.removeFromCart({});
  • saveRestaurantAdds a restaurant (search()'s id) to the signed-in diner's Grubhub favourites and returns the updated list.

    Arguments

    NameTypeRequired
    idstringYes

    Returns GrubhubFavorite[]

    interface GrubhubFavorite {
      /** What getRestaurant()/getMenu() take. */
      id: string | null;
      name: string | null;
      url: string | null;
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/saveRestaurant

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.saveRestaurant("<id>");
  • updateCartItemSets the quantity of one Grubhub cart line, keeping its options, and returns the cart.

    Arguments

    NameTypeRequired
    args{ lineId: string; quantity: number; cartKey?: string }Yes

    Returns GrubhubCart

    interface GrubhubCartLine {
      /** The id removeFromCart/updateCartItem take. */
      lineId: string;
      itemId: string;
      restaurantId: string;
      name: string;
      quantity: number;
      /** One unit, in cents, before options. */
      unitPriceCents: number;
      /** This line's total in cents, options and quantity included. */
      totalCents: number;
      specialInstructions: string;
      /** Chosen option ids, as getMenuItem().choices[].options[].id. */
      optionIds: string[];
    }
    
    interface GrubhubCart {
      /** Pass to the cart functions in a LATER run to reach this same cart; within one run they find it on their own. null while no cart exists. */
      cartKey: string | null;
      cartId: string | null;
      items: GrubhubCartLine[];
      itemCount: number;
      subtotalCents: number;
      currency: string;
      restaurantIds: string[];
      // Where the PERSON finishes: the restaurant page, with these items to add again (the cart is an anonymous Grubhub session no link can open). A refusal when the cart is empty or spans no single restaurant. Bowmark never orders.
      checkout: GrubhubCheckoutHandoff;
    }
    
    // The checkout handoff: where the PERSON finishes. Bowmark never pays, books or orders.
    // Switch on `status`; a status you do not recognise means "show the person `url` and stop".
    interface GrubhubCheckoutHandoff {
      status: "ready_to_checkout" | "needs_login" | "unavailable";
      url: string;                       // the https page to open on the site
      urlKind?: "carries_items" | "signed_in_cart" | "product_page"; // ready_to_checkout only: does the link carry the items, or only open the item's page
      reason?: string;                   // unavailable only: out_of_stock | not_available_for_dates | not_sold_online | region_not_served | quantity_unavailable | empty_cart
      detail?: string;                   // unavailable only: one sentence saying why
      account: { site: string; hint: string; signedInAs?: string };
      summary: { items: { title: string; variant: string | null; quantity: number; unitPrice: string | null; lineTotal: string | null; url?: string; id?: string }[]; total: string | null; currency: string } | null;
      warnings: string[];
    }

    HTTP endpoint

    POST https://api.bowmark.ai/v1/sites/grubhub/updateCartItem

    Call it

    import { bowmark } from "@bowmark/web";
    
    const result = await bowmark.providers.grubhub.updateCartItem({});

Use it from code