POST api/v2/deliveries/cancel

Request Information

URI Parameters

None.

Body Parameters

CancelDeliveryBookingModel
NameDescriptionTypeAdditional information
ApiKey

Your merchant API key

globally unique identifier

Required

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": "83299996-687d-4f6b-974b-9b8e7746a633",
  "jobId": "77dd511d-778b-45fe-96a7-7681b2d42eac",
  "cancellationNotes": "sample string 3"
}

text/xml

Sample:
<CancelDeliveryBookingModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Swift.DeliveryAPI2">
  <ApiKey>83299996-687d-4f6b-974b-9b8e7746a633</ApiKey>
  <CancellationNotes>sample string 3</CancellationNotes>
  <JobId>77dd511d-778b-45fe-96a7-7681b2d42eac</JobId>
</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.

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": "2019-10-15T11:11:12.6034215+00:00",
  "id": "2e8367aa-5664-4c47-a126-fddfa5b37135",
  "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": "2019-10-15T11:11:12.6034215+00:00",
  "currentStatus": "sample string 5",
  "driver": {
    "identifier": "f3749a5b-9578-421a-82d6-262288dd9016",
    "name": "sample string 2",
    "phone": "sample string 3",
    "photoUrl": "sample string 4",
    "email": "sample string 5"
  },
  "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": "2019-10-15T11:11:12.6034215+00:00",
  "dropoffTime": {
    "earliestTime": "2019-10-15T11:11:12.6034215+00:00",
    "latestTime": "2019-10-15T11:11:12.6034215+00:00"
  },
  "deliveryInstructions": "sample string 6",
  "customerReference": "sample string 7",
  "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": 8.0,
  "deliveryFee": 1.0,
  "estimatedDistance": {
    "kilometres": 1.1,
    "miles": 2.1
  },
  "stageHistory": [
    {
      "created": "2019-10-15T11:11:12.6034215+00:00",
      "stage": "sample string 2",
      "notes": "sample string 3"
    },
    {
      "created": "2019-10-15T11:11:12.6034215+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>2019-10-15T11:11:12.6034215+00:00</Created>
  <CurrentStatus>sample string 5</CurrentStatus>
  <CustomerReference>sample string 7</CustomerReference>
  <DeliveryFee>1</DeliveryFee>
  <DeliveryInstructions>sample string 6</DeliveryInstructions>
  <Driver>
    <Email>sample string 5</Email>
    <Identifier>f3749a5b-9578-421a-82d6-262288dd9016</Identifier>
    <Name>sample string 2</Name>
    <Phone>sample string 3</Phone>
    <PhotoUrl>sample string 4</PhotoUrl>
  </Driver>
  <DriverTip>8</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>2019-10-15T11:11:12.6034215+00:00</EarliestTime>
    <LatestTime>2019-10-15T11:11:12.6034215+00:00</LatestTime>
  </DropoffTime>
  <EstimatedDistance>
    <Kilometres>1.1</Kilometres>
    <Miles>2.1</Miles>
  </EstimatedDistance>
  <Id>2e8367aa-5664-4c47-a126-fddfa5b37135</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>2019-10-15T11:11:12.6034215+00:00</LastUpdated>
  <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>2019-10-15T11:11:12.6034215+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>2019-10-15T11:11:12.6034215+00:00</Created>
      <Notes>sample string 3</Notes>
      <Stage>sample string 2</Stage>
    </StageEntryModel>
    <StageEntryModel>
      <Created>2019-10-15T11:11:12.6034215+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>