The Delivery Trip object

Attributes

id string

Unique identifier for the object.

created_at string

ISO 8601 timestamp of when the object was created.

updated_at string

ISO 8601 timestamp of when the object was last updated.

status string

Default: draft

company string required
email_notification_sent boolean

Default: false

driver string
driver_name string
total_distance number
uom string
vehicle string required
departure_time string required
driver_address string
driver_email string
employee string
The Delivery Trip object
{
  "id": "delivery-trip_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "status": "draft",
  "company": "Example Corp",
  "email_notification_sent": false,
  "driver": "driver_example",
  "driver_name": "driver_name_example",
  "total_distance": 0,
  "uom": "uom_example",
  "vehicle": "vehicle_example",
  "departure_time": "departure_time_example",
  "driver_address": "driver_address_example",
  "driver_email": "[email protected]",
  "employee": "employee_example"
}
GET /api/stock/delivery-trip/{id}

Retrieve a delivery trip

Retrieves the details of an existing delivery trip. Supply the unique delivery trip ID that was returned from a previous request.

Path parameters

id string required

The identifier of the delivery trip to retrieve.

Returns

Returns the delivery trip object if a valid identifier was provided.

GET /api/stock/delivery-trip/{id}
curl https://api.overplane.dev/api/stock/delivery-trip/delivery-trip_abc123 \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "delivery-trip_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "status": "draft",
  "company": "Example Corp",
  "email_notification_sent": false,
  "driver": "driver_example",
  "driver_name": "driver_name_example",
  "total_distance": 0,
  "uom": "uom_example",
  "vehicle": "vehicle_example",
  "departure_time": "departure_time_example",
  "driver_address": "driver_address_example",
  "driver_email": "[email protected]",
  "employee": "employee_example"
}
GET /api/stock/delivery-trip

List all delivery trips

Returns a list of delivery trips. The results are sorted by creation date, with the most recently created appearing first.

Query parameters

limit integer

Maximum number of objects to return. Default: 20.

offset integer

Number of objects to skip for pagination. Default: 0.

Returns

A paginated list of delivery trip objects.

GET /api/stock/delivery-trip
curl https://api.overplane.dev/api/stock/delivery-trip \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "data": [
    {
      "id": "delivery-trip_abc123",
      "created_at": "2024-01-15T09: 30: 00Z",
      "updated_at": "2024-01-15T09: 30: 00Z",
      "status": "draft",
      "company": "Example Corp",
      "email_notification_sent": false,
      "driver": "driver_example",
      "driver_name": "driver_name_example",
      "total_distance": 0,
      "uom": "uom_example",
      "vehicle": "vehicle_example",
      "departure_time": "departure_time_example",
      "driver_address": "driver_address_example",
      "driver_email": "[email protected]",
      "employee": "employee_example"
    }
  ],
  "has_more": false,
  "total": 1
}
POST /api/stock/delivery-trip

Create a delivery trip

Creates a new delivery trip object.

Body parameters

status string

Default: draft

company string required
email_notification_sent boolean

Default: false

driver string
driver_name string
total_distance number
uom string
vehicle string required
departure_time string required
driver_address string
driver_email string
employee string

Returns

Returns the newly created delivery trip object if the call succeeded.

POST /api/stock/delivery-trip
curl https://api.overplane.dev/api/stock/delivery-trip \
  -H "Authorization: Bearer sk_test_..." \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"company":"Example Corp","vehicle":"vehicle_example","departure_time":"departure_time_example"}'
Response
{
  "id": "delivery-trip_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "status": "draft",
  "company": "Example Corp",
  "email_notification_sent": false,
  "driver": "driver_example",
  "driver_name": "driver_name_example",
  "total_distance": 0,
  "uom": "uom_example",
  "vehicle": "vehicle_example",
  "departure_time": "departure_time_example",
  "driver_address": "driver_address_example",
  "driver_email": "[email protected]",
  "employee": "employee_example"
}
PATCH /api/stock/delivery-trip/{id}

Update a delivery trip

Updates the specified delivery trip by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Path parameters

id string required

The identifier of the delivery trip to update.

Body parameters

status string

Default: draft

company string
email_notification_sent boolean

Default: false

driver string
driver_name string
total_distance number
uom string
vehicle string
departure_time string
driver_address string
driver_email string
employee string

Returns

Returns the updated delivery trip object.

PATCH /api/stock/delivery-trip/{id}
curl https://api.overplane.dev/api/stock/delivery-trip/delivery-trip_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X PATCH \
  -H "Content-Type: application/json" \
  -d '{"status":"draft","company":"Example Corp"}'
Response
{
  "id": "delivery-trip_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "status": "draft",
  "company": "Example Corp",
  "email_notification_sent": false,
  "driver": "driver_example",
  "driver_name": "driver_name_example",
  "total_distance": 0,
  "uom": "uom_example",
  "vehicle": "vehicle_example",
  "departure_time": "departure_time_example",
  "driver_address": "driver_address_example",
  "driver_email": "[email protected]",
  "employee": "employee_example"
}
DELETE /api/stock/delivery-trip/{id}

Delete a delivery trip

Permanently deletes a delivery trip. This cannot be undone.

Path parameters

id string required

The identifier of the delivery trip to delete.

Returns

Returns a confirmation that the delivery trip has been deleted.

DELETE /api/stock/delivery-trip/{id}
curl https://api.overplane.dev/api/stock/delivery-trip/delivery-trip_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X DELETE
Response
{
  "id": "delivery-trip_abc123",
  "deleted": true
}
POST /api/stock/delivery-trip/{id}/submit

Submit a delivery trip

Submits a draft delivery trip, transitioning its status from draft to submitted.

Path parameters

id string required

The identifier of the delivery trip to act on.

Returns

Returns the delivery trip object with updated status.

POST /api/stock/delivery-trip/{id}/submit
curl https://api.overplane.dev/api/stock/delivery-trip/delivery-trip_abc123/submit \
  -H "Authorization: Bearer sk_test_..." \
  -X POST
Response
{
  "id": "delivery-trip_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "status": "draft",
  "company": "Example Corp",
  "email_notification_sent": false,
  "driver": "driver_example",
  "driver_name": "driver_name_example",
  "total_distance": 0,
  "uom": "uom_example",
  "vehicle": "vehicle_example",
  "departure_time": "departure_time_example",
  "driver_address": "driver_address_example",
  "driver_email": "[email protected]",
  "employee": "employee_example"
}
POST /api/stock/delivery-trip/{id}/cancel

Cancel a delivery trip

Cancels a submitted delivery trip, transitioning its status to cancelled.

Path parameters

id string required

The identifier of the delivery trip to act on.

Returns

Returns the delivery trip object with updated status.

POST /api/stock/delivery-trip/{id}/cancel
curl https://api.overplane.dev/api/stock/delivery-trip/delivery-trip_abc123/cancel \
  -H "Authorization: Bearer sk_test_..." \
  -X POST
Response
{
  "id": "delivery-trip_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "status": "draft",
  "company": "Example Corp",
  "email_notification_sent": false,
  "driver": "driver_example",
  "driver_name": "driver_name_example",
  "total_distance": 0,
  "uom": "uom_example",
  "vehicle": "vehicle_example",
  "departure_time": "departure_time_example",
  "driver_address": "driver_address_example",
  "driver_email": "[email protected]",
  "employee": "employee_example"
}

Line items

Child objects that belong to this delivery trip. These are accessed via the parent's ID.

Delivery Stop

Attributes

idx integer
delivery_trip_id string required
customer string
address string required
locked boolean
customer_address string
visited boolean
delivery_note string
grand_total number
contact string
email_sent_to string
customer_contact string
distance number
estimated_arrival string
lat number
uom string
lng number
details string

Endpoints

GET /api/stock/delivery-stop?parent_id={id}
POST /api/stock/delivery-stop
PATCH /api/stock/delivery-stop/{id}
DELETE /api/stock/delivery-stop/{id}
POST /api/stock/delivery-stop/reorder
Delivery Stop object
{
  "id": "delivery-stop_abc123",
  "idx": 1,
  "delivery_trip_id": "delivery_trip_id_example",
  "customer": "customer_example",
  "address": "address_example",
  "locked": false,
  "customer_address": "customer_address_example",
  "visited": false,
  "delivery_note": "delivery_note_example",
  "grand_total": 0,
  "contact": "contact_example",
  "email_sent_to": "[email protected]",
  "customer_contact": "customer_contact_example",
  "distance": 0,
  "estimated_arrival": "estimated_arrival_example",
  "lat": 0,
  "uom": "uom_example",
  "lng": 0,
  "details": "details_example"
}