pickup_address
and pickup_place_id
(or the dropoff equivalents). You must use one or the other.pickup_address_street
) along with pickup_address
or pickup_place_id
.address
string.place_id
.address_components
(street, city, zip, etc.).pickup_store_location_id
or pickup_external_store_location_id
is provided, it attempts to find the corresponding StoreLocation
in the database.is_deleted
.external_store_location_id
is given but not found, it checks an organization preference (automatically_create_store_locations
). If enabled, it attempts to create a new StoreLocation
using the order’s pickup details. If this fails, an error is logged.pickup_store_location
is found, it automatically populates the order’s pickup fields (name, phone, email, instructions) with the data from the store, unless those fields were already provided in the request.pickup_address
or dropoff_address
string is provided, it attempts to parse it and geocode it to get coordinates (latitude/longitude). It will raise an error if parsing fails (e.g., “Address not found”).pickup_place_id
and dropoff_place_id
.pickup_place_id
and dropoff_place_id
are the same. If so, it raises an error.pickup_address_components
and dropoff_address_components
. If they are identical, it raises an error.pickup_address_country
and dropoff_address_country
are not the same.maximum_delivery_distance_miles
preference and fails if the distance exceeds it.value_cents
, pickup_phone_number
, dropoff_phone_number
, delivery_mode
.pickup_first_name
or pickup_business_name
to be present.dropoff_first_name
or dropoff_business_name
to be present.value_cents
, tip_amount_cents
, and items_count
are valid integers.weight
, height
, width
, depth
, volume
) are valid decimal numbers and are greater than 0.value_cents
is greater than 0.items_count
, if provided, is at least 1.pickup_first_name
, etc.) are strings and do not exceed a maximum length (80 characters).get_validated_phone_number
) to check if pickup_phone_number
and dropoff_phone_number
are valid phone numbers for the corresponding country.items
field is provided, it iterates through the list and tries to instantiate an Item
object from each entry to ensure the data structure is valid.delivery_mode
is one of the allowed values (now
or scheduled
).now
, it nullifies all datetime fields.scheduled
, it requires at least one of the datetime fields (pickup_start_time
, etc.) to be set.currency
is provided, it ensures it’s in the list of SUPPORTED_CURRENCIES
.pickup_address_country
.requirements
are in the list of SUPPORTED_PACKAGE_REQUIREMENTS
(unless it’s a custom:
requirement).minimum_vehicle_size
is in the list of SUPPORTED_VEHICLES
.dispatch_strategy_id
is provided, it confirms that it exists, belongs to the organization, and is not deleted.delivery_window_id
is provided, it checks if it’s a valid, active window.external_id
is given, it queries the database to ensure no other order within the same organization already uses that ID.pickup_start_time
, pickup_end_time
, dropoff_start_time
, dropoff_end_time
) into proper datetime objects. It can handle UTC or timezone-localized inputs based on an order flag. Fails if a string is not a valid date format.pickup_start_time
must be earlier than pickup_end_time
.dropoff_start_time
must be earlier than dropoff_end_time
.pickup_start_time
must be earlier than dropoff_end_time
.pickup_end_time
must be earlier than dropoff_end_time
.