Packfleet logo

Packfleet API (1.0)

Download OpenAPI specification:Download

Automate your Packfleet deliveries using our public API

Collections

Create

Creates a collection

Securitybearer
Request
Request Body schema: application/json
locationId
required
string

The location where the collection should take place

date
required
string

Date of the collection

earliestTime
string <HH:MM>

Earliest time the collection should take place. If not provided, the default earliest time value from the collection location is used

latestTime
string <HH:MM>

Latest time the collection should take place. Must be at least 1 hour greater than earliestTime. If not provided, the default latest time value from the collection location is used.

Responses
201

The collection has been successfully created.

400
default
post/v1/collections
Request samples
application/json
{
  • "locationId": "string",
  • "date": "2022-05-01",
  • "earliestTime": "12:00",
  • "latestTime": "14:00"
}
Response samples
application/json
{
  • "collection": {
    }
}

List

Lists collections

Securitybearer
Request
query Parameters
startDate
required
string <date>

Local date of collection in ISO8601 date format

Responses
200
default
get/v1/collections
Response samples
application/json
{
  • "collections": [
    ]
}

Read

Reads a collection

Securitybearer
Request
path Parameters
id
required
string
Responses
200
default
get/v1/collections/{id}
Response samples
application/json
{
  • "collection": {
    }
}

Update

Updates a collection

Securitybearer
Request
path Parameters
id
required
string
Request Body schema: application/json
locationId
string

The location where the collection should take place

date
string

Date of the collection

earliestTime
string <HH:MM>

Earliest time the collection should take place. If not provided, the default earliest time value from the collection location is used

latestTime
string <HH:MM>

Latest time the collection should take place. Must be at least 1 hour greater than earliestTime. If not provided, the default latest time value from the collection location is used.

Responses
200
default
patch/v1/collections/{id}
Request samples
application/json
{
  • "locationId": "string",
  • "date": "2022-05-01",
  • "earliestTime": "12:00",
  • "latestTime": "14:00"
}
Response samples
application/json
{
  • "collection": {
    }
}

Delete

Deletes a collection

Securitybearer
Request
path Parameters
id
required
string
Responses
200

Empty response

default
delete/v1/collections/{id}
Response samples
application/json
{ }

Assign shipments

Assign multiple shipments to the collection

Securitybearer
Request
path Parameters
id
required
string
Request Body schema: application/json
shipmentIds
required
Array of strings

IDs of the shipments that should be assigned to this collection

Responses
200
default
post/v1/collections/{id}/assign-shipments
Request samples
application/json
{
  • "shipmentIds": "ship_clb19k5yl00006aul274377nx,ship_clb19k9j800006aul617id4nf"
}
Response samples
application/json
{
  • "collection": {
    }
}

Collection Locations

Create

Creates a collection location

Securitybearer
Request
Request Body schema: application/json
required
object (AddressDto)
name
required
string

Nickname of location, for your convenience

phone
required
string <E.164>

Contact number for collections at this location

defaultCollectionEarliestTime
string <HH:MM>

Default "earliest time" for a driver to collect from this location

defaultCollectionLatestTime
string <HH:MM>

Default "latest time" for a driver to collect from this location. Must be at least 1 hour greater than the earliest time

Responses
201

The location has been successfully created.

400
default
post/v1/collection-locations
Request samples
application/json
{
  • "address": {
    },
  • "name": "Warehouse",
  • "phone": "+447912345678",
  • "defaultCollectionEarliestTime": "12:00",
  • "defaultCollectionLatestTime": "15:00"
}
Response samples
application/json
{
  • "collectionLocation": {
    }
}

List

Lists all collection locations for your organisation

Securitybearer
Responses
200
default
get/v1/collection-locations
Response samples
application/json
{
  • "collectionLocations": [
    ]
}

Read

Reads a collection location

Securitybearer
Request
path Parameters
id
required
string
Responses
200
default
get/v1/collection-locations/{id}
Response samples
application/json
{
  • "collectionLocation": {
    }
}

Update

Updates a collection location

Securitybearer
Request
path Parameters
id
required
string
Request Body schema: application/json
name
string

Nickname of location, for your convenience

phone
string <E.164>

Contact number for collections at this location

defaultCollectionEarliestTime
string <HH:MM>

Default "earliest time" for a driver to collect from this location

defaultCollectionLatestTime
string <HH:MM>

Default "latest time" for a driver to collect from this location. Must be at least 1 hour greater than the earliest time

object (UpdateAddressDto)
Responses
200
default
patch/v1/collection-locations/{id}
Request samples
application/json
{
  • "name": "Warehouse",
  • "phone": "+447912345678",
  • "defaultCollectionEarliestTime": "12:00",
  • "defaultCollectionLatestTime": "15:00",
  • "address": {
    }
}
Response samples
application/json
{ }

Delete

Deletes a collection location

Securitybearer
Request
path Parameters
id
required
string
Responses
200
default
delete/v1/collection-locations/{id}
Response samples
application/json
{ }

Coverage

Supported areas

Returns all available postcode areas that Packfleet delivers to

Securitybearer
Responses
200
default
get/v1/coverage
Response samples
application/json
{
  • "postcodes": [
    ]
}

Check postcodes

Checks if Packfleet delivers to the given postcodes

Securitybearer
Request
query Parameters
postcodes
required
Array of strings

Comma-separated list of postcodes. May or may not contain a space within the postcode

Example: postcodes=AB123CD,XX123YY
Responses
200
default
get/v1/coverage/check
Response samples
application/json
{
  • "postcodes": [
    ]
}

Shipments

Bulk create

Creates multiple shipments

Securitybearer
Request
Request Body schema: application/json
collectionId
string

The collection ID when the shipment should be collected. Either the collectionId or collectionLocationId MUST be present

collectionLocationId
string

The collection location ID where the shipment should be collected from. Either the collectionId or collectionLocationId MUST be present

required
Array of objects (CreateShipmentDto)
Responses
201

The records have been successfully created.

400
default
post/v1/shipments/bulk
Request samples
application/json
{
  • "collectionId": "string",
  • "collectionLocationId": "string",
  • "shipments": [
    ]
}
Response samples
application/json
{
  • "shipments": [
    ]
}

List

Lists shipments

Securitybearer
Request
query Parameters
limit
number

Return at most limit shipments. Max limit is 200

Example: limit=50
cursor
string

Fetch the next limit shipments after provided cursor

Responses
200
default
get/v1/shipments
Response samples
application/json
{
  • "cursor": "string",
  • "shipments": [
    ]
}

Read

Reads a shipment

Securitybearer
Request
path Parameters
id
required
string
Responses
200
default
get/v1/shipments/{id}
Response samples
application/json
{
  • "shipment": {
    }
}

Update

Updates a shipment

Securitybearer
Request
path Parameters
id
required
string
Request Body schema: application/json
brandId
string

An optional ID of a brand to be used for this shipment, if present the brand details will be used in notifications and on the tracking page in place of your organizations default details. This can be useful if shipping on behalf of another merchant or if you operate multiple stores

externalReference
string

External reference, for example an order ID

numberOfPacks
number

How many individual packages does this shipment contain? Each package must have a unique label. Either packs or numberOfPacks must be present

Array of objects (PackDto)

Information about the individual packs. Either packs or numberOfPacks must be present

serviceType
string

Influences the delivery date and time of the shipment, as well as the cost.

Next day shipments are usually delivered 8am-7pm the day following the collections, except Sundays.

Same-day shipments are usually delivered 4pm-10pm on the day of collection (unavailable on weekends)

Enum: "nextDay" "sameDay"
object (UpdateDeliveryDto)
collectionId
string

The collection ID when the shipment should be collected

collectionLocationId
string

The collection location ID where the shipment should be collected from

Responses
200
default
patch/v1/shipments/{id}
Request samples
application/json
{
  • "brandId": "brand_cl9h2kivj0000c4ul15szftfx",
  • "externalReference": "ORDER123",
  • "numberOfPacks": 1,
  • "packs": [
    ],
  • "serviceType": "nextDay",
  • "delivery": {
    },
  • "collectionId": "string",
  • "collectionLocationId": "string"
}
Response samples
application/json
{
  • "shipment": {
    }
}

Delete

Deletes a shipment

Securitybearer
Request
path Parameters
id
required
string
Responses
200
default
delete/v1/shipments/{id}
Response samples
application/json
{ }

Change delivery date

Changes the delivery date of a shipment. This can be done at any point before the shipment is in a delivered state.

Securitybearer
Request
path Parameters
id
required
string
Request Body schema: application/json
deliveryDate
required
string <date>

The new delivery date. Must be in the future, and within the next 30 days

Responses
200
default
put/v1/shipments/{id}/delivery-date
Request samples
application/json
{
  • "deliveryDate": "2023-03-28"
}
Response samples
application/json
{
  • "shipment": {
    }
}

Change delivery address

Changes the delivery address of a shipment. This can be done at any point before the shipment is in a delivered state. Changing the address after weʼve collected your shipment may push the delivery date to the next available date.

Securitybearer
Request
path Parameters
id
required
string
Request Body schema: application/json
required
object

The new delivery address. Must be a valid address within Packfleet’s coverage area

Responses
200
default
put/v1/shipments/{id}/delivery-address
Request samples
application/json
{
  • "address": {
    }
}
Response samples
application/json
{
  • "shipment": {
    }
}

Shipping Labels

Generate labels

Generates a PDF of shipping labels for provided shipments

Securitybearer
Request
header Parameters
Accept
string

Specify the format that the labels should be generated in. Defaults to 'application/pdf'

Enum: "application/pdf" "text/html" "image/png"
Request Body schema: application/json
shipmentIds
required
Array of strings

The shipments that you wish the labels to be generated for. If the label format is image/png then exactly one ID must be specified

packIds
Array of strings

The packs that you wish the labels to be generated for. If empty then the all labels will be generated for the requested shipments. If the label format is image/png then exactly one ID must be specified

labelSize
required
string
Enum: "rect" "square"
Responses
200
default
post/v1/shipping-labels/generate
Request samples
application/json
{
  • "shipmentIds": [
    ],
  • "packIds": [
    ],
  • "labelSize": "rect"
}
Response samples
application/json
{
  • "error": {
    }
}

Tracking

Tracking

Gets tracking information about a shipment

Securitybearer
Request
path Parameters
trackingNumber
required
string
Responses
200
default
get/v1/tracking/{trackingNumber}
Response samples
application/json
{
  • "shipmentId": "string",
  • "trackingNumber": "beautiful-ship",
  • "status": "SCHEDULED",
  • "deliveryDate": "2022-05-05",
  • "sender": {
    },
  • "recipient": {
    },
  • "delivery": {
    },
  • "proofOfDelivery": {
    },
  • "packs": [
    ]
}

Bulk Tracking

Gets tracking information about up to 50 shipments

Securitybearer
Request
query Parameters
trackingNumbers
required
Array of strings

Comma-separated list of tracking numbers

Example: trackingNumbers=first-phrase,second-phrase
Responses
200
default
get/v1/tracking
Response samples
application/json
{
  • "shipments": [
    ]
}

Collection Tracking

Gets tracking information about a collection

Securitybearer
Request
path Parameters
collectionId
required
string
Responses
200
default
get/v1/tracking/collections/{collectionId}
Response samples
application/json
{
  • "collectionId": "string",
  • "status": "SCHEDULED",
  • "date": "2022-01-02",
  • "location": {
    },
  • "collection": {
    },
  • "proofOfCollection": {
    }
}

Webhooks

Webhooks can be used to receive notifications to objects such as Shipments and Collections whenever they change. Once you have registered a webhook you will start receiving POST requests to the configured endpoint which can be used to trigger business logic instead of relying on polling the API periodically.

  • You can create up to 10 webhooks at a time
  • The webhook URL must be an absolute URL that is accessible over the internet
  • The webhook must use HTTPS
  • Webhook events are not ordered and you may receive duplicate events
  • If your webhook endpoint is unavailable we will periodically attempt to deliver any failed messages for up to 24 hours
  • If your webhook endpoint is unable to receive any events for 7 days then your webhook will be disabled. Re-create the webhook to re-enable it
  • Each webhook request will contain a signature that can be used to verify that Packfleet sent the request, see the Callbacks section for more info

Create

Securitybearer
Request
Request Body schema: application/json
topic
required
string

Name of the topic the webhook is subscribed to

Enum: "shipment.created" "shipment.updated" "shipment.deleted" "collection.created" "collection.updated" "collection.deleted"
url
required
string

Endpoint that the webhook is configured to send data to

version
required
string

The version of the API that should be used to construct webhook requests

Value: "V1"
Responses
201

The webhook has been successfully created.

400
default
Callbacks
postshipment.created
postshipment.updated
postshipment.deleted
postcollection.created
postcollection.updated
postcollection.deleted
post/v1/webhooks
Request samples
application/json
{}
Response samples
application/json
{
  • "webhook": {
    },
  • "secret": "18A1E3894B3B9549EF5B18A4764ED7B888B15474411855BE424518C68FB4EC87"
}
Callback payload samples
application/json
{
  • "id": "string",
  • "organizationId": "string",
  • "brandId": "string",
  • "trackingNumber": "beautiful-ship",
  • "externalReference": "string",
  • "createdAt": "2022-01-02T12:34:56.123Z",
  • "updatedAt": "2022-01-02T12:34:56.123Z",
  • "status": "SCHEDULED",
  • "serviceType": "nextDay",
  • "brand": {
    },
  • "collection": {
    },
  • "collectionLocation": {
    },
  • "delivery": {
    },
  • "packs": [
    ],
  • "proofsOfDelivery": [
    ]
}

List

Lists all webhooks for your organisation

Securitybearer
Responses
200
default
get/v1/webhooks
Response samples
application/json
{
  • "webhooks": [
    ]
}

Read

Reads a webhook

Securitybearer
Request
path Parameters
id
required
string
Responses
200
default
get/v1/webhooks/{id}
Response samples
application/json
{
  • "webhook": {
    }
}

Delete

Deletes a webhook

Securitybearer
Request
path Parameters
id
required
string
Responses
200
default
delete/v1/webhooks/{id}
Response samples
application/json
{ }

Brands

Create

Create a new brand which can be used to override the details of a shipments sender. This can be used to ship packages on behalf of another merchant

Securitybearer
Request
Request Body schema: application/json
name
required
string

Name of the brand that is displayed in notifications and on the tracking page

emoji
string

Emoji that is used on the tracking page, if not set then 📦 is used instead

Responses
201

The brand has been successfully created.

default
post/v1/brands
Request samples
application/json
{
  • "name": "string",
  • "emoji": "string"
}
Response samples
application/json
{
  • "brand": {
    }
}

List

Lists all brands for your organisation

Securitybearer
Responses
200
default
get/v1/brands
Response samples
application/json
{
  • "brands": [
    ]
}

Read

Reads a brand

Securitybearer
Request
path Parameters
id
required
string
Responses
200
default
get/v1/brands/{id}
Response samples
application/json
{
  • "brand": {
    }
}

Update

Updates the details of an already created brand

Securitybearer
Request
path Parameters
id
required
string
Request Body schema: application/json
name
string

Name of the brand that is displayed in notifications and on the tracking page

emoji
string

Emoji that is used on the tracking page, if not set then 📦 is used instead

Responses
201

The brand has been successfully updated.

default
patch/v1/brands/{id}
Request samples
application/json
{
  • "name": "string",
  • "emoji": "string"
}
Response samples
application/json
{
  • "brand": {
    }
}

Delete

Deletes a brand

Securitybearer
Request
path Parameters
id
required
string
Responses
200
default
delete/v1/brands/{id}
Response samples
application/json
{ }

Rates

Check available rates

Fetch the available rates to deliver the requested packs

Securitybearer
Request
Request Body schema: application/json
numberOfPacks
integer

How many individual packages does this shipment contain? Each package must have a unique label. Either packs or numberOfPacks must be present

Array of objects (PackDto)

Information about the individual packs. Either packs or numberOfPacks must be present

collectionDate
string <date>

Date that the shipment will be collected on

earliestTime
string <HH:MM>

Earliest time the delivery should take place. May incur an additional charge

latestTime
string <HH:MM>

Latest time the delivery should take place. Must be at least 3 hours after earliestDeliveryTime, if set. May incur an additional charge

required
object

Destination that the shipment is being collected from

required
object

Destination that the shipment is being delivered to

Responses
200
default
post/v1/rates
Request samples
application/json
{
  • "numberOfPacks": 1,
  • "packs": [
    ],
  • "collectionDate": "2022-05-01",
  • "earliestTime": "12:00",
  • "latestTime": "15:00",
  • "originAddress": {
    },
  • "destinationAddress": {
    }
}
Response samples
application/json
{
  • "rates": [
    ]
}

Sandbox

Change shipment status (Sandbox only)

Changes the status of a shipment to help with testing.

When using this API and setting the shipment status to "OUT_FOR_DELIVERY", the tracking API returns "simulated" live tracking information for the shipment. If the status is set to "DELIVERED", a simulated proof of delivery is also available.

Securitybearer
Request
path Parameters
id
required
string
Request Body schema: application/json
status
required
string

Changes the status this shipment to this value. This will also change the status of all packs within the shipment to this value. Only available in the sandbox environment!

Enum: "SCHEDULED" "OUT_FOR_COLLECTION" "COLLECTED" "IN_DEPOT" "OUT_FOR_DELIVERY" "DELIVERED" "FAILED_DELIVERY" "ON_HOLD" "TO_RETURN_TO_SENDER" "RETURNED_TO_SENDER"
Responses
200

Status changed successfully

default
put/v1/sandbox/shipments/{id}/status
Request samples
application/json
{
  • "status": "SCHEDULED"
}
Response samples
application/json
{ }