openapi: 3.2.0 info: title: Endpoints Delivery Quotes API servers: - url: https://api-third-party-gtm-pp.grubhub.com description: preprod - url: https://api-third-party-gtm.grubhub.com description: prod tags: - name: Delivery Quotes paths: /delivery/daas/v1/quote/{quoteId}/accept: post: tags: - Delivery Quotes summary: Accept delivery quote description: Accepts the delivery quote for the given quote id. operationId: acceptDeliveryQuote parameters: - name: quoteId in: path description: The UUID of the quote being accepted. required: true style: simple explode: false schema: type: string format: uuid example: 8d6a50e5-d8bf-4149-8f30-6c8481270e02 - name: X-GH-PARTNER-KEY in: header description: The Grubhub-provided partner key. required: true style: simple explode: false schema: type: string format: uuid example: 123e4567-e89b-12d3-a456-426614174000 responses: '200': description: Delivery quote accepted content: application/json: schema: $ref: '#/components/schemas/ResponseWrapperAcceptQuoteResponse' example: response: delivery: delivery_id: 00000000-0000-0000-0000-000000000000 events: - event_type: CREATED event_time: '1970-01-01T00:00:00.000Z' estimated_event_times: picked_up: '1970-01-01T00:00:00.000Z' dropped_off: '1970-01-01T00:00:00.000Z' '500': description: Unexpected internal error content: application/json: schema: type: array items: $ref: '#/components/schemas/PublicApiError' example: errors: - code: REQUEST_FAILED message: Internal Server Error '403': description: Request Forbidden content: application/json: schema: type: array items: $ref: '#/components/schemas/PublicApiError' example: errors: - code: REQUEST_FORBIDDEN message: Request forbidden '400': description: Delivery quote expired content: application/json: schema: type: array items: $ref: '#/components/schemas/PublicApiError' example: errors: - code: DELIVERY_QUOTE_EXPIRED message: Delivery quote with id=00000000-0000-0000-0000-000000000000 is expired '404': description: Delivery quote not found content: application/json: schema: type: array items: $ref: '#/components/schemas/PublicApiError' example: errors: - code: DELIVERY_NOT_FOUND message: Delivery not found with id=00000000-0000-0000-0000-000000000000 /delivery/daas/v1/quote: post: tags: - Delivery Quotes summary: Request delivery quotes description: Returns one or more delivery quotes for the given request. operationId: requestDeliveryQuote parameters: - name: X-GH-PARTNER-KEY in: header description: The Grubhub-provided partner key. required: true style: simple explode: false schema: type: string format: uuid example: 123e4567-e89b-12d3-a456-426614174000 - name: x-gh-daas-test in: header description: Denotes if you're placing a request for a test, ensuring that the resulting delivery will only be progressed by test endpoint requests. This can be used either in testing environments or in production. The resulting delivery cannot be progressed in production. required: false style: simple explode: false schema: type: boolean default: false example: true requestBody: content: application/json: schema: $ref: '#/components/schemas/QuoteRequest' required: true responses: '200': description: Delivery quotes generated content: application/json: schema: $ref: '#/components/schemas/ResponseWrapperQuoteResponse' example: response: quotes: - quote_id: 00000000-0000-0000-0000-000000000000 cost_amount: 500 return_fee: 100 expiration: '1970-01-01T00:00:00.000Z' estimated_pickup_time: '1970-01-01T00:00:00.000Z' estimated_dropoff_time: '1970-01-01T00:00:00.000Z' '400': description: Error generating delivery quotes content: application/json: schema: type: array items: $ref: '#/components/schemas/PublicApiError' example: errors: - code: preferred_pickup_time_invalid message: Preferred pickup time cannot be in the past. '500': description: Unexpected internal error content: application/json: schema: type: array items: $ref: '#/components/schemas/PublicApiError' example: errors: - code: REQUEST_FAILED message: Internal Server Error '403': description: Request Forbidden content: application/json: schema: type: array items: $ref: '#/components/schemas/PublicApiError' example: errors: - code: REQUEST_FORBIDDEN message: Request forbidden components: schemas: NotificationPreferences: type: object properties: send_dropoff_contact_notifications: type: boolean description: Whether to send notifications to the dropoff contact for this delivery - defaults to sending notifications. default: true description: Notification-related preferences for the delivery request Assigned: required: - timestamp - type type: object description: An event indicating the delivery has been assigned. allOf: - $ref: '#/components/schemas/DeliveryEvent' ReturnInitiated: required: - timestamp - type type: object description: An event indicating the delivery is in-transit back to the pickup location in order to return some portion of the delivery's contents. allOf: - $ref: '#/components/schemas/DeliveryEvent' - type: object properties: return_reason: type: string description: The reason the delivery's contents are being returned. example: DINER_MISSING_ID ProofOfDelivery: required: - timestamp - type type: object description: An event containing proof of delivery information. allOf: - $ref: '#/components/schemas/DeliveryEvent' - type: object properties: dropoff_image_details: $ref: '#/components/schemas/DropoffImageDetails' DropoffPreferences: type: object properties: handoff_options: maxItems: 1 uniqueItems: true type: array description: Options indicating how dropoff should be performed. items: type: string enum: - CONTACTLESS description: Preferences for how the delivery dropoff should be handled. PickupVerificationDetails: type: object properties: result: type: string description: The result of pickup verification process. enum: - SUCCESS - FAILURE - UNKNOWN capture_method: type: string description: The method used to capture the pickup verification code. enum: - QR_SCAN - PHOTO failure_reason: type: string description: The reason for the verification failure, if applicable. attempts_count: type: integer description: The number of verification attempts made. format: int32 photo_url: type: string description: A URL to the pickup verification photo, if applicable. Quote: required: - cost_amount - estimated_dropoff_time - estimated_pickup_time - expiration - quote_id - return_fee type: object properties: quote_id: type: string description: The unique identifier for this quote. This must be referenced when accepting the quote. format: uuid example: 0ec346bd-635a-4a07-8f35-44962a8bcc5b cost_amount: minimum: 0 type: integer description: The cost of the delivery, formatted in cents. format: int32 estimated_pickup_time: type: string description: The courier's estimated pickup time of the delivery. Formatted as an ISO-8601 timestamp. format: date-time estimated_dropoff_time: type: string description: The courier's estimated dropoff time of the delivery. Formatted as an ISO-8601 timestamp. format: date-time return_fee: minimum: 0 type: integer description: The return fee of the delivery, formatted in cents. format: int32 expiration: type: string description: When the quote expires and new quote must be requested. Formatted as an ISO-8601 timestamp. format: date-time description: The information associated with a delivery fulfillment quote. PickupLocation: required: - address - brand_name - name - phone type: object properties: name: maxLength: 128 minLength: 0 type: string description: The name of the merchant or individual at the location. example: Bob's Burgers address: $ref: '#/components/schemas/DeliveryAddress' phone: pattern: ^\+\d{11}$ type: string description: A E.164 formatted phone number. Only 11-digits are supported. example: '+16145552332' instructions: maxLength: 500 minLength: 0 type: string description: Instructions for the courier while at the location. example: Leave at front door. geo_location: $ref: '#/components/schemas/GeoLocation' brand_name: maxLength: 128 minLength: 0 type: string description: The name of the requesting brand. This must be consistent across all deliveries for the same brand. example: Inspire sub_brand_name: maxLength: 128 minLength: 0 type: string description: The name of the requesting individual brand, NOT the aggregator. This must be consistent across all deliveries for the same brand. example: Dunkin Donuts location_grouping_id: maxLength: 128 minLength: 0 type: string description: A reference identifier for grouping locations. example: loc-group-123 location_grouping_name: maxLength: 128 minLength: 0 type: string description: A reference name for grouping locations. example: All NY Stores description: The information associated with a pickup location. Item: required: - name type: object properties: name: maxLength: 256 minLength: 0 type: string description: The name of the item being delivered. example: Cheeseburger description: maxLength: 256 minLength: 0 type: string description: The description of the item. example: Burger patty topped with cheese. quantity: minimum: 1 type: integer description: The quantity of the item. format: int32 sub_items: type: array description: Subitems included with the item. items: $ref: '#/components/schemas/SubItem' item_sizing: $ref: '#/components/schemas/ItemSizing' description: The information associated with a delivery item. DropoffImageDetails: required: - photo_capture_location - photo_capture_time - photo_expiration_time - photo_url type: object properties: photo_url: type: string description: A URL to the dropoff photo taken by the driver upon completing the delivery. example: http://www.grubhub.com/example.png photo_capture_time: type: string description: The timestamp at which the dropoff photo was captured. Formatted as an ISO-8601 timestamp. format: date-time example: '2024-05-28T00:00:00Z' photo_capture_location: $ref: '#/components/schemas/GeoLocation' photo_expiration_time: type: string description: The timestamp when the dropoff photo will expire. Formatted as an ISO-8601 timestamp. format: date-time example: '2024-05-28T00:00:00Z' ResponseWrapperQuoteResponse: type: object properties: response: $ref: '#/components/schemas/QuoteResponse' errors: type: array description: A list of errors returned. items: $ref: '#/components/schemas/PublicApiError' DeliverySizing: type: object properties: weight: type: string description: 'The weight category of a delivery. **STANDARD** <= 15 lbs **HEAVY** > 15 lbs' example: STANDARD enum: - STANDARD - HEAVY dimensions: type: string description: 'The size category of a delivery based on its dimensions. **SMALL** - single item, may be carried in one hand **MEDIUM** - requires a bag, may be carried in one hand **LARGE** - may require two hands **EXTRA_LARGE** - may require multiple trips or equipment' example: MEDIUM enum: - SMALL - MEDIUM - LARGE - EXTRA_LARGE description: Information about delivery-level sizing. Created: required: - timestamp - type type: object description: An event representing the creation of a delivery. allOf: - $ref: '#/components/schemas/DeliveryEvent' ItemSizing: type: object properties: weight: $ref: '#/components/schemas/ItemWeight' dimensions: $ref: '#/components/schemas/ItemDimensions' description: Information about item-level sizing PublicApiError: required: - code - message type: object properties: code: type: string description: A code representing the type of error that occurred. message: type: string description: A detailed description of the error that occurred. description: An error returned by the delivery API. ReturnArrived: required: - timestamp - type type: object description: An event indicating the courier has arrived back at the pickup location with the portion of the delivery's contents being returned. allOf: - $ref: '#/components/schemas/DeliveryEvent' ClientData: type: object properties: external_id: maxLength: 128 minLength: 0 type: string description: A stored correlation id that isn't used by Grubhub's platform. example: ABC123 external_merchant_id: maxLength: 128 minLength: 0 type: string description: A client-provided merchant identifier. example: MERCHANT_123 external_source: maxLength: 128 minLength: 0 type: string description: The external source API from which the delivery came from. example: RELAY_123 reference_number: type: string description: An external delivery identifier that is used by Grubhub's platform for display purposes. example: 123XYZ4567ABC890 description: Client metadata associated with a delivery. DropoffLocation: required: - address - name - phone type: object properties: name: maxLength: 128 minLength: 0 type: string description: The name of the merchant or individual at the location. example: Bob's Burgers address: $ref: '#/components/schemas/DeliveryAddress' phone: pattern: ^\+\d{11}$ type: string description: A E.164 formatted phone number. Only 11-digits are supported. example: '+16145552332' instructions: maxLength: 500 minLength: 0 type: string description: Instructions for the courier while at the location. example: Leave at front door. geo_location: $ref: '#/components/schemas/GeoLocation' description: The information associated with a dropoff location. SubItem: required: - name type: object properties: name: maxLength: 64 minLength: 0 type: string description: The name of the subitem. example: Add cheese description: maxLength: 128 minLength: 0 type: string description: The description of the subitem. example: Single slice of American cheese. quantity: minimum: 0 type: integer description: The quantity of this subitem, if applicable. format: int32 default: 0 description: The information associated with a delivery subitem. EstimatedEventTimes: required: - dropped_off - picked_up type: object properties: picked_up: type: string description: The estimated pickup time, or the actual pickup time if the pickup has already occurred. Formatted as an ISO-8601 timestamp. format: date-time example: '2024-05-28T00:00:00Z' dropped_off: type: string description: The estimated drop-off time, or the actual drop-off time if the pickup has already occurred. Formatted as an ISO-8601 timestamp. format: date-time example: '2024-05-28T00:00:00Z' description: The latest known estimates for the delivery pickup and dropoff times. Will be the actual times if the event has already occurred. Charges: required: - contents_value - tip type: object properties: tip: minimum: 0 type: integer description: The tip amount the courier receives, formatted as cents. format: int32 example: 200 contents_value: minimum: 0 type: integer description: The amount the items being delivered are worth minus taxes, formatted as cents. format: int32 example: 200 description: The charges associated with a delivery. Unassigned: required: - timestamp - type type: object description: An event indicating the delivery has been unassigned. An unassigned delivery may still be reassigned to another driver later. allOf: - $ref: '#/components/schemas/DeliveryEvent' Delivery: required: - delivery_id - estimated_event_times - events type: object properties: delivery_id: type: string description: A unique identifier of this delivery. format: uuid example: 0ec346bd-635a-4a07-8f35-44962a8bcc5b events: type: array description: A history of notable events that have occurred for this delivery. items: $ref: '#/components/schemas/DeliveryEvent' estimated_event_times: $ref: '#/components/schemas/EstimatedEventTimes' client_data: $ref: '#/components/schemas/ClientData' description: The information and historical events associated with a delivery. CourierAtDropoff: required: - timestamp - type type: object description: An event indicating the assigned courier has arrived at the delivery's dropoff location. allOf: - $ref: '#/components/schemas/DeliveryEvent' InTransit: required: - timestamp - type type: object description: An event indicating the assigned courier has departed the restaurant with the delivery. allOf: - $ref: '#/components/schemas/DeliveryEvent' PickupVerification: required: - timestamp - type type: object description: An event containing pickup verification information. allOf: - $ref: '#/components/schemas/DeliveryEvent' - type: object properties: pickup_verification_details: $ref: '#/components/schemas/PickupVerificationDetails' PickedUp: required: - timestamp - type type: object description: An event indicating the delivery has been picked up by the assigned courier. allOf: - $ref: '#/components/schemas/DeliveryEvent' QuoteResponse: type: object properties: quotes: type: array description: A list of delivery options to select from. items: $ref: '#/components/schemas/Quote' description: The response information of a delivery fulfillment quote request. DeliveryAddress: required: - city - country_area - country_code - postal_code - street_address type: object properties: country_code: maxLength: 8 minLength: 0 type: string description: The ISO-3166 country code of the address. example: US country_area: maxLength: 64 minLength: 0 type: string description: The country area or state of the address. example: IL city: maxLength: 64 minLength: 0 type: string description: The city of the address. example: Chicago street_address: maxItems: 5 minItems: 1 type: array description: The street address details of the address. example: - 123 Washington Lane items: maxLength: 128 minLength: 0 type: string postal_code: maxLength: 16 minLength: 0 type: string description: The postal code of the address. example: '60642' company_name: maxLength: 128 minLength: 0 type: string description: The company name of the address. example: Fake Savings and Loans Co. description: The information associated with an address. ReturnCompleted: required: - timestamp - type type: object description: An event indicating that the necessary portion of the delivery's contents have been successfully returned to the pickup location. allOf: - $ref: '#/components/schemas/DeliveryEvent' Canceled: required: - timestamp - type type: object description: An event indicating that the delivery was canceled. allOf: - $ref: '#/components/schemas/DeliveryEvent' - type: object properties: source: type: string description: Types of actors who may update a delivery. example: CLIENT enum: - CLIENT - GRUBHUB reason_code: type: string description: Codes for reasons why a delivery was canceled. example: CUSTOMER_OTHER_REASON enum: - MERCHANT_NOT_READY_FOR_PICKUP - MERCHANT_UNABLE_TO_FULFILL_ORDER - MERCHANT_CLOSED - MERCHANT_PICKUP_DELAYED - MERCHANT_ITEM_MISSING - MERCHANT_OTHER_REASON - EXTERNAL_SYSTEM_FAILURE - CUSTOMER_CONTENTS_ISSUE - CUSTOMER_ORDER_CHANGED - CUSTOMER_REFUSED_DELIVERY - CUSTOMER_DELIVERY_DELAYED - CUSTOMER_OTHER_REASON - ORDER_PICKED_UP_BY_ANOTHER_DRIVER - DRIVER_UNABLE_TO_FINISH_DELIVERY - UNABLE_TO_ASSIGN_DRIVER - EXTERNAL_PARTNER_OTHER_REASON - DELIVERY_CANCELLATION_OTHER_REASON - UNKNOWN reason_comment: type: string description: Additional detail about the cancellation. example: Customer no longer wants delivery. QuoteRequest: required: - charges - dropoff - pickup - time_preferences type: object properties: pickup: $ref: '#/components/schemas/PickupLocation' dropoff: $ref: '#/components/schemas/DropoffLocation' items: type: array description: A collection of items describing what is included in the delivery. items: $ref: '#/components/schemas/Item' charges: $ref: '#/components/schemas/Charges' time_preferences: $ref: '#/components/schemas/TimePreferences' dropoff_preferences: $ref: '#/components/schemas/DropoffPreferences' client_data: $ref: '#/components/schemas/ClientData' notification_preferences: $ref: '#/components/schemas/NotificationPreferences' pickup_verification: $ref: '#/components/schemas/com.grubhub.pos.generic.delivery.fulfillment.common.model.PickupVerification' delivery_sizing: $ref: '#/components/schemas/DeliverySizing' tags: uniqueItems: true type: array description: Tags that can be applied to a delivery to assist with categorization, pricing and filtering. items: type: string description: Tags that can be applied to a delivery to assist with categorization, pricing and filtering. example: FOOD enum: - FOOD - FLORAL - GROCERY description: A request for delivery fulfillment quotes. ItemDimensions: required: - depth - height - unit - width type: object properties: unit: type: string description: Unit of measurement example: INCHES enum: - INCHES - FEET width: type: number description: Width of the item format: double example: 10.0 height: type: number description: Height of the item format: double example: 5.0 depth: type: number description: Depth of the item format: double example: 3.0 description: Dimensions of the item Delivered: required: - timestamp - type type: object description: An event indicating the delivery has been successfully delivered. allOf: - $ref: '#/components/schemas/DeliveryEvent' - type: object properties: dropoff_image_details: description: Use `dropoff_image_details` in the `ProofOfDelivery` event instead. deprecated: true allOf: - $ref: '#/components/schemas/DropoffImageDetails' TimePreferences: type: object properties: pickup_time: type: string description: The preferred pickup time for the courier. Formatted as an ISO-8601 timestamp. format: date-time example: '2024-03-14T19:22:51.999Z' dropoff_time: type: string description: The preferred dropoff time for the courier. Formatted as an ISO-8601 timestamp. format: date-time example: '2024-03-14T19:22:51.999Z' description: The preferred pickup or dropoff time for the courier. Only use one of them. AcceptQuoteResponse: type: object properties: delivery: $ref: '#/components/schemas/Delivery' description: The response information for a quote acceptance request. ItemWeight: required: - unit - weight type: object properties: unit: type: string description: Unit of measurement example: POUNDS enum: - POUNDS weight: type: number description: Weight of the item format: double example: 5.0 description: Weight of the item ResponseWrapperAcceptQuoteResponse: type: object properties: response: $ref: '#/components/schemas/AcceptQuoteResponse' errors: type: array description: A list of errors returned. items: $ref: '#/components/schemas/PublicApiError' DeliveryEvent: required: - timestamp - type type: object properties: type: type: string description: The type of this event. example: PICKED_UP enum: - CREATED - ASSIGNED - UNASSIGNED - COURIER_AT_PICKUP - PICKED_UP - IN_TRANSIT - COURIER_AT_DROPOFF - DELIVERED - PROOF_OF_DELIVERY - RETURN_INITIATED - RETURN_ARRIVED - RETURN_COMPLETED - PICKUP_VERIFICATION - CANCELED timestamp: type: string description: The time at which this event occurred. Formatted as an ISO-8601 timestamp. format: date-time example: '2024-05-28T00:00:00Z' description: An event during the course of a single delivery's lifecycle. discriminator: propertyName: type oneOf: - $ref: '#/components/schemas/Created' - $ref: '#/components/schemas/Assigned' - $ref: '#/components/schemas/Unassigned' - $ref: '#/components/schemas/CourierAtPickup' - $ref: '#/components/schemas/PickedUp' - $ref: '#/components/schemas/InTransit' - $ref: '#/components/schemas/CourierAtDropoff' - $ref: '#/components/schemas/Delivered' - $ref: '#/components/schemas/ProofOfDelivery' - $ref: '#/components/schemas/PickupVerification' - $ref: '#/components/schemas/ReturnInitiated' - $ref: '#/components/schemas/ReturnArrived' - $ref: '#/components/schemas/ReturnCompleted' - $ref: '#/components/schemas/Canceled' GeoLocation: required: - lat - lng type: object properties: lat: type: number description: The latitude of the location. format: double example: 41.88320791307697 lng: type: number description: The longitude of the location. format: double example: -87.63142796027925 description: The last known location of the courier. CourierAtPickup: required: - timestamp - type type: object description: An event indicating the assigned courier has arrived at the delivery's pickup location. allOf: - $ref: '#/components/schemas/DeliveryEvent' com.grubhub.pos.generic.delivery.fulfillment.common.model.PickupVerification: required: - capture_method - verification_code type: object properties: capture_method: type: string description: The method used to capture the pickup verification code. enum: - QR_SCAN verification_code: type: string description: The verification code provided by the partner. description: Pickup verification provided by the partner.