POST api/public/v2/deliveries/cancel

Request Information

URI Parameters

None.

Body Parameters

CancelDeliveryBookingModel
NameDescriptionTypeAdditional information
ApiKey

Your merchant API key

globally unique identifier

Required

MerchantApiKey

globally unique identifier

None.

JobId

Identifier of the booking to be cancelled.

globally unique identifier

Required

CancellationNotes

Optional cancellation notes

string

Max length: 2000

Request Formats

application/json, text/json

Sample:
{
  "apiKey": "c7f25857-9b55-4f93-b487-331aeb46ed70",
  "merchantApiKey": "ab555b72-5f62-42f5-9b96-a945e1a607b2",
  "jobId": "7a365205-5ef7-445f-b977-285aca027866",
  "cancellationNotes": "sample string 4"
}

text/xml

Sample:
<CancelDeliveryBookingModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Swift.DeliveryAPI2">
  <ApiKey>c7f25857-9b55-4f93-b487-331aeb46ed70</ApiKey>
  <CancellationNotes>sample string 4</CancellationNotes>
  <JobId>7a365205-5ef7-445f-b977-285aca027866</JobId>
  <MerchantApiKey>ab555b72-5f62-42f5-9b96-a945e1a607b2</MerchantApiKey>
</CancelDeliveryBookingModel>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

DeliveryDetailsModel
NameDescriptionTypeAdditional information
Created

The date the booking was created

date

None.

Id

A unique identifier for this delivery

globally unique identifier

None.

Reference

The internal reference id for this delivery. If your internal reference was not provided, this will contain a reference number provided by Swift.

string

None.

PickupLocation

Details of the delivery origin

LocationAPIModel

None.

DropoffLocation

Details of the delivery destination

LocationAPIModel

None.

LastUpdated

The time (in UTC) of the last status update

date

None.

CurrentStatus

The most recent delivery status

string

None.

Driver

Details of the driver assigned to your delivery

DriverModel

None.

DriverLocation

The last known driver location by latitude and longitude

DriverLocationModel

None.

ModeOfTransport

string

None.

JobNotes

Transport Job Notes for this particular job

Collection of string

None.

Items

One or more packages to be delivered

Collection of string

None.

Constraints

Job requirement constraints so only particular drivers matching the required constraints will be notified.

Collection of CustomPodFieldModel

None.

Capacities

The capacities for this particular job

Collection of CustomPodFieldModel

None.

PickupTime

The time (if any) that the delivery is scheduled to be pickup up. Time is in UTC

date

None.

DropoffTime

The time (if any) that the delivery is scheduled to be dropped off. Time is in UTC

TimeFrameModel

None.

DeliveryInstructions

string

None.

CustomerReference

Used to identify the customer who placed this order. For example, this will contain the customer's unique business name for deliveries placed via the the public booking form

string

None.

TrackingUrls

Tracking Urls

TrackingUrlsModel

None.

ProofOfDelivery

Proof of delivery information

PodModel

None.

DriverTip

decimal number

None.

DeliveryFee

decimal number

None.

EstimatedDistance

Distance

None.

StageHistory

Stages the job progressed through in ascending order

Collection of StageEntryModel

None.

Payments

If provided, will update the payment methods of the order.

Dictionary of string [key] and Object [value]

None.

Response Formats

application/json, text/json

Sample:
{
  "created": "2023-09-25T03:54:59.7684815+00:00",
  "id": "50e6ea25-6797-4ea9-9503-849cb3077d5d",
  "reference": "sample string 3",
  "pickupLocation": {
    "name": "sample string 1",
    "address": "sample string 2",
    "phone": "sample string 3",
    "postcode": "sample string 4",
    "suburb": "sample string 5"
  },
  "dropoffLocation": {
    "name": "sample string 1",
    "address": "sample string 2",
    "phone": "sample string 3",
    "postcode": "sample string 4",
    "suburb": "sample string 5"
  },
  "lastUpdated": "2023-09-25T03:54:59.7684815+00:00",
  "currentStatus": "sample string 5",
  "driver": {
    "identifier": "a50d0238-d8ab-4c6f-af08-d9edebe2df25",
    "name": "sample string 2",
    "phone": "sample string 3",
    "photoUrl": "sample string 4",
    "email": "sample string 5"
  },
  "driverLocation": {
    "latitude": 1.1,
    "longitude": 2.1
  },
  "modeOfTransport": "sample string 6",
  "jobNotes": [
    "sample string 1",
    "sample string 2"
  ],
  "items": [
    "sample string 1",
    "sample string 2"
  ],
  "constraints": [
    {
      "name": "sample string 1",
      "value": "sample string 2"
    },
    {
      "name": "sample string 1",
      "value": "sample string 2"
    }
  ],
  "capacities": [
    {
      "name": "sample string 1",
      "value": "sample string 2"
    },
    {
      "name": "sample string 1",
      "value": "sample string 2"
    }
  ],
  "pickupTime": "2023-09-25T03:54:59.7684815+00:00",
  "dropoffTime": {
    "earliestTime": "2023-09-25T03:54:59.7684815+00:00",
    "latestTime": "2023-09-25T03:54:59.7684815+00:00"
  },
  "deliveryInstructions": "sample string 7",
  "customerReference": "sample string 8",
  "trackingUrls": {
    "www": "sample string 1",
    "api": "sample string 2"
  },
  "proofOfDelivery": {
    "signatureUrl": "sample string 1",
    "attachments": [
      "sample string 1",
      "sample string 2"
    ],
    "jobTags": [
      {
        "name": "sample string 1",
        "value": "sample string 2"
      },
      {
        "name": "sample string 1",
        "value": "sample string 2"
      }
    ]
  },
  "driverTip": 9.0,
  "deliveryFee": 1.0,
  "estimatedDistance": {
    "kilometres": 1.1,
    "miles": 2.1
  },
  "stageHistory": [
    {
      "created": "2023-09-25T03:54:59.7684815+00:00",
      "stage": "sample string 2",
      "notes": "sample string 3"
    },
    {
      "created": "2023-09-25T03:54:59.7684815+00:00",
      "stage": "sample string 2",
      "notes": "sample string 3"
    }
  ],
  "payments": {
    "sample string 1": {},
    "sample string 3": {}
  }
}

text/xml

Sample:
<DeliveryDetailsModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Swift.DeliveryAPI2">
  <Capacities>
    <CustomPodFieldModel>
      <Name>sample string 1</Name>
      <Value>sample string 2</Value>
    </CustomPodFieldModel>
    <CustomPodFieldModel>
      <Name>sample string 1</Name>
      <Value>sample string 2</Value>
    </CustomPodFieldModel>
  </Capacities>
  <Constraints>
    <CustomPodFieldModel>
      <Name>sample string 1</Name>
      <Value>sample string 2</Value>
    </CustomPodFieldModel>
    <CustomPodFieldModel>
      <Name>sample string 1</Name>
      <Value>sample string 2</Value>
    </CustomPodFieldModel>
  </Constraints>
  <Created>2023-09-25T03:54:59.7684815+00:00</Created>
  <CurrentStatus>sample string 5</CurrentStatus>
  <CustomerReference>sample string 8</CustomerReference>
  <DeliveryFee>1</DeliveryFee>
  <DeliveryInstructions>sample string 7</DeliveryInstructions>
  <Driver>
    <Email>sample string 5</Email>
    <Identifier>a50d0238-d8ab-4c6f-af08-d9edebe2df25</Identifier>
    <Name>sample string 2</Name>
    <Phone>sample string 3</Phone>
    <PhotoUrl>sample string 4</PhotoUrl>
  </Driver>
  <DriverLocation>
    <Latitude>1.1</Latitude>
    <Longitude>2.1</Longitude>
  </DriverLocation>
  <DriverTip>9</DriverTip>
  <DropoffLocation>
    <Address>sample string 2</Address>
    <Name>sample string 1</Name>
    <Phone>sample string 3</Phone>
    <Postcode>sample string 4</Postcode>
    <Suburb>sample string 5</Suburb>
  </DropoffLocation>
  <DropoffTime>
    <EarliestTime>2023-09-25T03:54:59.7684815+00:00</EarliestTime>
    <LatestTime>2023-09-25T03:54:59.7684815+00:00</LatestTime>
  </DropoffTime>
  <EstimatedDistance>
    <Kilometres>1.1</Kilometres>
    <Miles>2.1</Miles>
  </EstimatedDistance>
  <Id>50e6ea25-6797-4ea9-9503-849cb3077d5d</Id>
  <Items xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </Items>
  <JobNotes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </JobNotes>
  <LastUpdated>2023-09-25T03:54:59.7684815+00:00</LastUpdated>
  <ModeOfTransport>sample string 6</ModeOfTransport>
  <Payments xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringanyType>
      <d2p1:Key>sample string 1</d2p1:Key>
      <d2p1:Value />
    </d2p1:KeyValueOfstringanyType>
    <d2p1:KeyValueOfstringanyType>
      <d2p1:Key>sample string 3</d2p1:Key>
      <d2p1:Value />
    </d2p1:KeyValueOfstringanyType>
  </Payments>
  <PickupLocation>
    <Address>sample string 2</Address>
    <Name>sample string 1</Name>
    <Phone>sample string 3</Phone>
    <Postcode>sample string 4</Postcode>
    <Suburb>sample string 5</Suburb>
  </PickupLocation>
  <PickupTime>2023-09-25T03:54:59.7684815+00:00</PickupTime>
  <ProofOfDelivery>
    <Attachments xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>sample string 1</d3p1:string>
      <d3p1:string>sample string 2</d3p1:string>
    </Attachments>
    <JobTags>
      <CustomPodFieldModel>
        <Name>sample string 1</Name>
        <Value>sample string 2</Value>
      </CustomPodFieldModel>
      <CustomPodFieldModel>
        <Name>sample string 1</Name>
        <Value>sample string 2</Value>
      </CustomPodFieldModel>
    </JobTags>
    <SignatureUrl>sample string 1</SignatureUrl>
  </ProofOfDelivery>
  <Reference>sample string 3</Reference>
  <StageHistory>
    <StageEntryModel>
      <Created>2023-09-25T03:54:59.7684815+00:00</Created>
      <Notes>sample string 3</Notes>
      <Stage>sample string 2</Stage>
    </StageEntryModel>
    <StageEntryModel>
      <Created>2023-09-25T03:54:59.7684815+00:00</Created>
      <Notes>sample string 3</Notes>
      <Stage>sample string 2</Stage>
    </StageEntryModel>
  </StageHistory>
  <TrackingUrls>
    <Api>sample string 2</Api>
    <Www>sample string 1</Www>
  </TrackingUrls>
</DeliveryDetailsModel>