Book a Delivery
The Delivery
Response Object
The Delivery
type implements the ExternalIDProvider
interface and is used to represent a delivery with various information such as status, distance, events, and contacts.
Response Fields
The following fields can be requested:
Field | Type | Description |
---|---|---|
accountId | IDCustomScalar | The custom scalar ID associated with the account for the delivery. |
attachments | [DeliveryAttachment] | An array of delivery attachments. |
canceledAt | DateTimeCustomScalar | The date and time when the delivery was canceled. |
createdAt | DateTimeCustomScalar | The date and time when the delivery was created. |
declaredValue | Int | The declared value of the items in the delivery. |
deletedAt | DateTimeCustomScalar | The date and time when the delivery was deleted. |
deliveredAt | DateTimeCustomScalar | The date and time when the delivery was completed. |
deliveryImages | [DeliveryImage] | An array of delivery images. |
deliveryMeta | DeliveryMeta | The metadata associated with the delivery. |
deliveryMethod | String | The method used for the delivery. |
deliveryMethodDisplayName | String | The display name of the delivery method. |
deliveryQuoteId | IDCustomScalar | The custom scalar ID associated with the delivery quote. |
deliveryRequirements | DeliveryRequirements | The requirements for the delivery. |
deliveryStatus | DeliveryStatus | The current status of the delivery. |
destination | Address | The destination address for the delivery. |
destinationLocationPinpoint | LocationPinpoint | The destination location pinpoint |
distance | String | The total distance of the delivery. |
driver | Driver | The driver responsible for the delivery. |
dropoffContact | DeliveryContact | The contact information for the dropoff location. |
estimatedTravelTime | String | The estimated travel time for the delivery. |
id | IDCustomScalar | The custom scalar ID associated with the delivery. |
isApi | Boolean | Indicates if the delivery was created using an API. |
isSandbox | Boolean | Indicates if the delivery was created in a sandbox environment. |
manifestItems | [ManifestItem] | An array of manifest items in the delivery. |
origin | Address | The origin address for the delivery. |
originLocationPinpoint | LocationPinpoint | The origin location pinpoint. |
pickupContact | DeliveryContact | The contact information for the pickup location. |
pointOfContact | DeliveryContact | The point of contact for the delivery. |
price | String | The price of the delivery. |
priority | String | The priority level of the delivery. |
quoteId | String | The ID associated with the delivery quote. |
receivedBy | String | The name of the person who received the delivery. |
receivedBySignatureUrl | String | The URL of the signature image of the person who received the delivery. |
scheduledAt | DateTimeCustomScalar | The date and time when the delivery was scheduled. |
trackingId | String | The tracking ID associated with the delivery. |
trackingUrl | String | The URL for tracking the delivery. |
bookDelivery
Query
There are two ways to book a delivery:
- Use the
deliveryQuoteId
generated fromdeliveryQuotes
ordeliveryQuote
. - Pass the parameters you would have passed to
deliveryQuotes
along withskipQuote: true
.
Both options allow you to book a delivery. You can include as many or as few contacts as you wish, such as dropoffContact
, pickupContact
, and pointOfContact
.
It is recommended to have at least one contact for the delivery.
If you want to include additional delivery-related information, you can use the customerData
object within deliveryMeta
. This can include reference numbers, contact details, or tracking information.
Required Input Parameters
Parameter | Type | Description |
---|---|---|
deliveryMethod | String | The delivery method to be used for the booking. |
destination | AddressInput | An object containing the address information for the delivery destination. |
manifestItems | [ManifestItemInput] | An array of objects containing information about the items to be delivered. |
origin | AddressInput | An object containing the address information for the delivery origin. |
Optional Input Parameters
Parameter | Type | Description |
---|---|---|
accountId | IDCustomScalar | The ID of the Team Account associated with the delivery booking. |
attachments | [DeliveryAttachmentInput] | A list of attachments related to the delivery. |
declaredValue | Int | The declared value of the items to be delivered. |
deliveryMeta | DeliveryMetaInput | Additional metadata associated with the delivery. |
deliveryQuoteId | String | The ID of the delivery quote associated with the booking. |
destinationLocationPinpoint | LocationPinpointInput | The destination location pinpoint. |
dropoffContact | DeliveryContactInput | The contact information for the dropoff location. |
originLocationPinpoint | LocationPinpointInput | The origin location pinpoint. |
pickupContact | DeliveryContactInput | The contact information for the pickup location. |
pointOfContact | DeliveryContactInput | The point of contact for the delivery. |
preserveWalletBalance | Boolean | Indicates whether the wallet balance should be preserved during the booking process. |
priority | String | The priority level for the delivery. |
requirements | RequirementsInput | Any additional requirements for the delivery. |
scheduledAt | String | The scheduled time for the delivery. |
skipQuote | Boolean | Indicates whether the quote should be skipped during the booking process. |
Team Account ID
If your user has purview and permission over many Subteams and would like to specify which Team Account specifically to book the delivery under, you can provide an optional accountId
. If this is not provided, the delivery will be booked under the user's Default Team Account. NOTE: the provided quote needs to have been generated using the same accountId
.
Book with a DeliveryQuote
To use an existing delivery quote from our API, pass it into to your mutation in the deliveryQuoteId
field.
You may omit a deliveryQuoteId
by passing in the field skipQuote: true
Example Mutation
mutation {
bookDelivery(
data: {
deliveryQuoteId: "quote_B34GCPGNX3" # STRING (optional, if using `skipQuote: true`)
accountId: "acct_ABC123" # STRING (optional, user's Default Team Account used if not provided)
dropoffContact: {
name: "Bob Jones" # STRING (optional)
phoneNumber: "5553213265" # STRING (optional)
}
pickupContact: {
name: "Alice Khan" # STRING (optional)
phoneNumber: "5553213264" # STRING (optional)
}
pointOfContact: {
name: "Carlos Lee" # STRING (optional)
phoneNumber: "5553213263" # STRING (optional)
}
deliveryMeta: {
poNumber: "12" # STRING (optional)
orderNumber: "23" # STRING (optional)
pickupNote: "STUFF" # STRING (optional)
customerData: { trackingNumber: "ABC123", myFavoriteNumber: 7 } # JSON (optional)
}
manifestItems: [
{
height: 5 # INT (cm)
width: 5 # INT (cm)
length: 100 # INT (cm)
weight: 1 # INT (kg)
quantity: 1 # INT
description: "This is a small pipe" # STRING
}
]
}
) {
id # STRING
price # INT (cents)
deliveryMethod # STRING
trackingUrl # STRING
createdAt # STRING (timestamp with timezone)
}
}
Scheduling Pickups
You can schedule a pickup for Same Day and Scheduled deliveries by providing scheduledAt
. For Same Day service, scheduledAt
represents the earliest time when the delivery will be ready for pickup.
- For Scheduled Deliveries, Curri currently only offers a pickup time and not a guaranteed deliver by time.
- For Same Day Deliveries, pickups can only be scheduled as late as 12:00pm local time.
Example Mutation
mutation {
bookDelivery(
data: {
skipQuote: true
origin: {
name: "305 South Kalorama Street"
addressLine1: "305 S Kalorama St"
addressLine2: ""
city: "Ventura"
state: "CA"
postalCode: "93001"
}
destination: {
name: "1129 Poli Street"
addressLine1: "1129 Poli St"
addressLine2: ""
city: "Ventura"
state: "CA"
postalCode: "93001"
}
dropoffContact: { name: "Bob Jones", phoneNumber: "5553213265" }
pickupContact: { name: "Alice Khan", phoneNumber: "5553213264" }
pointOfContact: { name: "Carlos Lee", phoneNumber: "5553213263" }
priority: "scheduled"
scheduledAt: "2022-08-16T12:00:00Z"
deliveryMethod: "truck"
manifestItems: [
{
height: 5
width: 5
length: 100
weight: 1
quantity: 1
description: "This is a small pipe"
}
]
}
) {
id
price
deliveryMethod
trackingUrl
createdAt
}
}
Booking with a location pinpoint
Specific pickup (origin) or dropoff (destination) locations can be specified with latitude and longitude geocoordinates. originLocationPinpoint
and destinationLocationPinpoint
can be provided as an optional input to specify the geocoordinates. origin
and destination
addresses must still be provided as the nearest routable address.
Example Mutation
mutation {
bookDelivery(
data: {
skipQuote: true
origin: {
name: "305 South Kalorama Street"
addressLine1: "305 S Kalorama St"
addressLine2: ""
city: "Ventura"
state: "CA"
postalCode: "93001"
}
originLocationPinpoint: {
latitude: "33.81229684383007"
longitude: "-117.91896508869313"
}
destination: {
name: "1129 Poli Street"
addressLine1: "1129 Poli St"
addressLine2: ""
city: "Ventura"
state: "CA"
postalCode: "93001"
}
destinationLocationPinpoint: {
latitude: "28.377327270154133"
longitude: "-81.57055761192647"
}
dropoffContact: { name: "Bob Jones", phoneNumber: "5553213265" }
pickupContact: { name: "Alice Khan", phoneNumber: "5553213264" }
pointOfContact: { name: "Carlos Lee", phoneNumber: "5553213263" }
deliveryMethod: "truck"
manifestItems: [
{
height: 5
width: 5
length: 100
weight: 1
quantity: 1
description: "This is a small pipe"
}
]
}
) {
id
price
deliveryMethod
trackingUrl
createdAt
}
}