321 Delivery API DocumentationGuideReference
1.0.0
OAS 3.0.0

321 Delivery API

API for managing deliveries

API Key (apiKeyAuth)
Client Libraries
Shell
Ruby
Node.js
PHP
Python
More

Create Delivery

Body
application/json

Create a new delivery

external_id
required
string

Unique ID generated by the caller for the delivery.

urgency_level
required
string enum

Specifies the urgency of the delivery:

  • on_demand: Immediate delivery.
  • time_window: Delivery within a specified time window, at least 2 hours from now.
  • scheduled: Delivery scheduled for a future date and time.
  • on_demand
  • time_window
  • scheduled
pickup_facility_id
string

Merchant warehouse ID for pickup. If this field is set, it will override all other pickup fields (e.g., pickup_address, pickup_latitude, pickup_longitude, pickup_name, pickup_phone_number) except for pickup_instructions.

pickup_address
string

Full address for pickup.

pickup_latitude
number float

Latitude coordinate for pickup location.

pickup_longitude
number float

Longitude coordinate for pickup location.

pickup_name
string

Optional name of the pickup location.

pickup_phone_number
string

Phone number for pickup, in E.164 format.

pickup_instructions
string

Instructions for the courier at pickup.

dropoff_address
required
string

Full address for dropoff.

dropoff_latitude
required
number float

Latitude coordinate for dropoff location.

dropoff_longitude
required
number float

Longitude coordinate for dropoff location.

dropoff_name
required
string

Optional name of the dropoff location.

dropoff_phone_number
required
string

Phone number for dropoff, in E.164 format.

dropoff_instructions
string

Instructions for the courier at dropoff.

deliverable_action
required
string enum

Specifies the delivery action:

  • meet_at_door: Meet at the door delivery.
  • leave_at_door: Contactless delivery where the courier leaves the package at the door.
  • meet_at_door
  • leave_at_door
pickup_time
string date-time

Pickup ready time in ISO-8601 format. Used primarily for precise scheduled deliveries. If this field is set, it will override pickup_window

pickup_window
object

Pickup time window with a start and end time in ISO-8601 format. Used primarily for scheduled deliveries.

dropoff_window
object

Dropoff time window with a start and end time in ISO-8601 format. Used primarily for scheduled deliveries.

metadata
object

Additional metadata related to the delivery.

Responses
  • 200Delivery successfully created
    application/json
  • 400Bad Request - Invalid input
    application/json
  • 401Unauthorized - Authentication failed
    application/json
  • 500Internal Server Error - An unexpected error occurred
    application/json
POST/v1/createDelivery
Shell cURL
curl --request POST \
  --url https://deliveryapi-i4bl6pegoq-ew.a.run.app/v1/createDelivery \
  --header 'Content-Type: application/json' \
  --data '{
  "external_id": "",
  "urgency_level": "on_demand",
  "dropoff_address": "",
  "dropoff_latitude": 1,
  "dropoff_longitude": 1,
  "dropoff_name": "",
  "dropoff_phone_number": "",
  "deliverable_action": "meet_at_door",
  "pickup_window": {},
  "dropoff_window": {},
  "metadata": {}
}'
{
  "delivery_id": "…",
  "status": "…",
  "warnings": [
    "…"
  ]
}