Function uber_api::create_quote

source ·
pub async fn create_quote(
    access_token: &str,
    customer_id: &str,
    create_quote_request: CreateQuoteRequest
) -> Result<(CreateQuoteResponse, String, StatusCode), UberError>
Expand description

Create a quote to check deliverability, validity and cost for delivery between two addresses.

Request Path Parameters

NameTypeDescription
customer_idstringUnique identifier for the organization. Either UUID or starts with cus_.

Request Body Parameters

NameTypeDescription
dropoff_addressstring(required) Dropoff address in Street Address, City, State, Zip format
pickup_addressstring(required) Pickup address in Street Address, City, State, Zip format
dropoff_latitudedoubleDropoff latitude coordinate
dropoff_longitudedoubleDropoff longitude coordinate
dropoff_phone_numberstringPhone number of recipient
pickup_latitudedoublePickup latitude coordinate
pickup_longitudedoublePickup longitude coordinate
pickup_phone_numberstringPhone number of sender/store
pickup_ready_dttimestamp (RFC 3339)Beginning of the window when an order must be picked up. Must be less than 30 days in the future.
pickup_deadline_dttimestamp (RFC 3339)End of the window when an order may be picked up. Must be at least 10 mins later than pickup_ready_dt and at least 20 minutes in the future from now.
dropoff_ready_dttimestamp (RFC 3339)Beginning of the window when an order must be dropped off. Must be less than or equal to pickup_deadline_dt
dropoff_deadline_dttimestamp (RFC 3339)End of the window when an order must be dropped off. Must be at least 20 mins later than dropoff_ready_dt and must be greater than or equal to pickup_deadline_dt.
manifest_total_valueintegerValue (in US cents) of the items in the delivery. i.e.: $10.99 => 1099.
external_store_idstring(Optional) Unique identifier used by our Partners to reference a Store or Location

Response Body Parameters

NameTypeDescription
createdtimestamp (RFC 3339)Date/Time at which the quote was created.
currencystring[DEPRECATED] Three-letter ISO currency code, in lowercase.
currency_typestringThree-letter ISO currency code, in uppercase.
dropoff_deadlinetimestamp (RFC 3339)When a delivery must be dropped off. This is the end of the dropoff window.
dropoff_etatimestamp (RFC 3339)Estimated drop-off time.
durationintegerEstimated minutes for this delivery to reach dropoff
expirestimestamp (RFC 3339)Date/Time after which the quote will no longer be accepted.
feeintegerAmount in cents that will be charged if this delivery is created.
idstringUnique identifier for the quote (always starts with dqt_)
kindstringThe type of object being described. Always “delivery_quote”
pickup_durationintegerEstimated minutes until a courier will arrive at the pickup.
external_store_idstringUnique identifier used by our Partners to reference a Store or Location

Endpoint Specific Errors

Http StatusCodeCode Message
400invalid_paramsThe parameters of your request were invalid.
400unknown_locationThe specified location was not understood.
400address_undeliverableThe specified location is not in a deliverable area.
400pickup_window_too_smallThe pickup window needs to be at least 10 minutes long.
400dropoff_deadline_too_earlyThe dropoff deadline needs to be at least 20 minutes after the dropoff ready time.
400dropoff_deadline_before_pickup_deadlineThe dropoff deadline needs to be after the pickup deadline.
400dropoff_ready_after_pickup_deadlineThe dropoff ready time needs to be at or before the pickup deadline.
400pickup_ready_too_earlyThe pickup ready time cannot be in the past.
400pickup_deadline_too_earlyThe pickup deadline time needs to be at least 20 minutes from now.
400pickup_ready_too_lateThe pickup ready time needs to be within the next 30 days.
404customer_not_foundCustomer does not exist.
408request_timeoutThe request timed out…
402customer_suspendedYour account is passed due. Payment is required.
422address_undeliverable_limited_couriersThe specified location is not in a deliverable area at this time because all couriers are currently busy.
403customer_blockedYour account is not allowed to create deliveries.
429customer_limitedYour account’s limits have been exceeded.
500unknown_errorAn unknown error happened.