vDrive
vDrive API Docs
vgrubs.com

Create delivery

POST/deliveries

Creates a delivery and dispatches it right away. Your own id of the order goes in externalId: sending the same externalId again returns the delivery already created, so retrying after a timeout or a 5xx is safe.

Leave provider out and we pick the fleet for you. To dispatch a fleet you chose from Get quotes, pass it as provider, and add maxPrice to refuse the delivery if that fleet costs more now.

The restaurant in pickup is created on its first delivery and updated when its details change. See Restaurants.

Keep the id of the answer: the other calls take it. Then follow the delivery through webhooks.

Request body

externalIdstring, up to 100required

Your delivery id. Sending the same id again returns the delivery already created (safe to retry), also while your account is blocked.

pickupPickuprequired

The restaurant, by your own id. Created on its first use, see Restaurants.

dropoffAddressrequired

Where the food goes.

customerCustomerrequired

Who gets the food.

notesstring, up to 1000

Dropoff instructions for the driver.

pickupAtstring (ISO 8601)

When the food is ready. Missing, or within 5 minutes from now, means as soon as possible.

tipinteger, 0 or more

Customer tip, cents.

subTotalinteger, 0 or more

Order subtotal, cents. Some fleets need the order value.

totalinteger, 0 or more

Order total, cents.

providerstring

Dispatch this fleet: a provider from Get quotes. Left out, we pick the fleet.

maxPriceinteger, 0 or more

Only with provider: refuse the delivery if that fleet's price (as in Get quotes, tip not included) is now higher. Cents.

Response

200OK

The delivery, dispatched. The same object every call and webhook returns.

idinteger

Our delivery id. The other calls take it.

externalIdstring

Your delivery id, as sent.

statusstring

Where the delivery is. See Delivery statuses.

providerstring | null

The fleet the delivery went to, e.g. grubhub. Can change when the delivery moves to another fleet.

pickupLocationobject

The restaurant.

driverobject | null

Null until a driver takes the delivery.

trackingUrlstring | null

Our tracking page, the same link the customer gets by SMS. Null until it is created.

pickupEtastring | null

When the driver is expected at the restaurant (ISO 8601).

dropoffEtastring | null

When the driver is expected at the customer (ISO 8601).

tipinteger

Customer tip, cents.

vDriveFeeinteger

Our fee, cents.

vGrubsFeeinteger

Cents, 0 by default.

deliveryFeeinteger

Fleet price, cents. While the delivery runs, the price at dispatch; once settled, the final price (or the cancellation fee).

amountinteger

What you owe for this delivery, cents. An estimate while it runs, final once settled. See Pricing.

settledboolean

true once the delivery is finished and its amount is final.

cancellationReasonstring | null

Why it was cancelled.

createdAtstring

ISO 8601.

updatedAtstring

ISO 8601. The latest update wins: see Webhooks.

Errors

400
A field is missing or invalid. message is an array, one entry per problem.
400
There are currently no available drivers, please try again later.No fleet can take the delivery right now.
400
Provider <x> is not enabled for your account.provider is a fleet your account does not use.
400
No <x> offer is available for this delivery right now.The fleet in provider has no offer for this delivery.
400
The vDrive price went up since it was confirmed.The fleet's price is above maxPrice.
400
Pickup location <id> is disabled.The restaurant is turned off. Contact us.
400
The pickup address could not be found. Send its latitude and longitude.An address came without coordinates and could not be geocoded. The same text says dropoff for the dropoff address.
401
Invalid API key.The key is missing, wrong or turned off.
403
Access denied: an invoice is past due. Pay it to resume deliveries.An invoice is past due. See Billing.
403
Access denied: the credit limit is reached. Pay the open invoices to continue.What you owe reached your credit limit, if your account has one.
409
Delivery <id> is already being created.Another request is creating the same externalId. Retry in a few seconds.
5xx
An error on our side or at the fleet. Retry with the same externalId.