HubRise
Créer un compteConnexion
Menu
HubRise
navigate_before
Menu
Cette documentation est disponible en anglais uniquement.

Deliveries

A delivery can optionally be attached to an order. This tracks the delivery details, including estimated pickup and drop-off times, driver information, and delivery status.

1. Create a Delivery

Attaches a delivery to an order.

Endpoint:
POST /locations/:location_id/orders/:order_id/delivery
Short endpoint:
POST /location/orders/:order_id/delivery (location only)
Access level:
location, account

This endpoint can only be called if:

  • The order has no delivery yet.
  • The order's service_type is set to delivery.
Parameters:
NameTypeDescription
carrierstringThe name of the carrier.
carrier_ref optionalstringA ref code that identifies the carrier.
ref optionalstringThe carrier's identifier of the delivery, such as a tracking number.
statusstringThe delivery status. See Delivery Statuses.
fee optionalstringThe delivery fee charged by the carrier to the business.
estimated_pickup_at optionalTimeThe pickup time, estimated by the carrier.
estimated_dropoff_at optionalTimeThe drop-off time, estimated by the carrier.
tracking_url optionalstringThe URL of a page where the customer can track the delivery.
driver_name optionalstringThe driver name.
driver_phone optionalstringThe driver phone number.
driver_phone_access_code optionalstringThe access code to provide when calling the phone number above.
driver_latitude optionaldecimalThe current latitude of the driver.
driver_longitude optionaldecimalThe current longitude of the driver.
assigned_at optionalTimeTime the status changed to pickup_enroute.
pickup_at optionalTimeTime the status changed to dropoff_enroute.
delivered_at optionalTimeTime the status changed to delivered.
cancelled_at optionalTimeTime the status changed to cancelled.
Example request

POST /location/orders/5dpm9/delivery

{ "carrier": "UPS", "carrier_ref": "ups", "ref": "1Z12345E0291980793", "status": "pending", "fee": "4.50 EUR", "estimated_pickup_at": "2023-01-01T12:00:00+01:00", "estimated_dropoff_at": "2023-01-01T12:30:00+01:00", "tracking_url": "https://www.ups.com/track?tracknum=1Z12345E0291980793", "driver_name": "John", "driver_phone": "+33612345678", "driver_phone_access_code": "1234", "driver_latitude": "48.856614", "driver_longitude": "2.3522219"}

Delivery statuses

The following statuses are available:

StatusDescription
pendingNot started
pickup_enrouteEn route to pickup
pickup_approachingNearing pickup
pickup_waitingAt pickup
dropoff_enrouteEn route to dropoff
dropoff_approachingNearing dropoff
dropoff_waitingAt dropoff
deliveredCompleted
cancelledCancelled

2. Retrieve a Delivery

Retrieves the delivery attached to an order.

Endpoint:
GET /locations/:location_id/orders/:order_id/delivery
Short endpoint:
GET /location/orders/:order_id/delivery (location only)
Access level:
location, account

If the order has no delivery, an error is returned.

Example request

GET /location/orders/5dpm9/delivery

{ "id": "ez351", "order_id": "5dpm9", "location_id": "3r4s3-1", "carrier": "UPS", "carrier_ref": "ups", "ref": "1Z12345E0291980793", "status": "pickup_waiting", "fee": "4.50 EUR", "estimated_pickup_at": "2023-01-01T12:17:00+01:00", "estimated_dropoff_at": "2023-01-01T12:29:00+01:00", "tracking_url": "https://www.ups.com/track?tracknum=1Z12345E0291980793", "driver_name": "John", "driver_phone": "+33612345678", "driver_phone_access_code": "1234", "assigned_at": "2023-01-01T12:11:03+01:00", "pickup_at": null, "delivered_at": null, "cancelled_at": null, "driver_latitude": "48.856702", "driver_longitude": "2.35222"}

3. Update a Delivery

Updates the delivery attached to an order.

Endpoint:
PATCH /locations/:location_id/orders/:order_id/delivery
Short endpoint:
PATCH /location/orders/:order_id/delivery (location only)
Access level:
location, account

All fields can be updated, except: carrier, carrier_ref, fee.

If the order has no delivery, an error is returned.

Example request

PATCH /location/orders/5dpm9/delivery

{ "driver_latitude": "48.856614", "driver_longitude": "2.3522219"}

Auto-updated fields

The following fields are updated automatically when the delivery status changes:

StatusField
pickup_enrouteassigned_at
dropoff_enroutepickup_at
delivereddelivered_at
cancelledcancelled_at

You can manually override these fields if required. This can be useful when status updates are skipped or delayed.

Commentaires sur cette page