Swyft API (2020-04)

Download OpenAPI specification:Download

Welcome to the Swyft API. You can use this API to fetch real time rates, create labels, delete labels and retrieve labels for printing.

If you need help please don't hesitate to reach out to your Swyft account manager.

Authentication

AccessToken

Security Scheme Type API Key
Header parameter name: X-Swyft-Access-Token

Rates

Fetch Rates

Fetch rates for given origin and destination.

Request Body schema: application/json
origin
required
object (Address)

Pickup address.

destination
required
object (Address)

Pickup address.

signature_required
boolean (Signature Required)
Default: false

Signature required on delivery.

package_count
number (Package Count)
Default: 1

Number of packages to be delivered to a single location.

Responses

200

OK

post/2020-04/rates.get
https://gina-staging.shipswyft.com/2020-04/rates.get

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "origin":
    {
    },
  • "destination":
    {
    },
  • "signature_required": true,
  • "package_count": 1
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Labels

Create Bulk Labels

Create a bulk number of labels with a single request. Accepts a maximum of 100 labels per request. Each label will be validated against the label schema, if any do not validate then the request will fail returning the index of the invalid label from the array. If the schema is successful, the labels will be generated and returned as an array of labels, if any of these labels failed to be created due to issues such as address validation, then that row in the returned array will be an error object instead.

Request Body schema: application/json
Array
package_type
required
string
Enum: "SMALL" "MEDIUM" "LARGE"

One of the package types returned when fetching rates.

service_type
required
string
Enum: "SAMEDAY" "NEXTDAY"

One of the service types returned when fetching rates.

business_name
string

Business name on whose behalf package is being delivered. In the case of a 3PL this would be the merchant business name. Is used in communication with client via SMS, etc.

origin
required
object (Recipient)

A individual reciving or sending a package

destination
required
object (Recipient)

A individual reciving or sending a package

signature_required
boolean

Signature required on delivery.

notes
string

Specific notes about delivery location for driver.

reference
string

Reference # or ID on the client side in case of any issues. Primarily to be used by our dispatcher to reach out to client but can also be used by client to attach specific metadata to label.

tracking_number
string

Optional unique tracking number. If provided, then the tracking number will be set to the given value. Otherwise it will be randomly generated.

Responses

200

OK

post/2020-04/labels.bulk.create
https://gina-staging.shipswyft.com/2020-04/labels.bulk.create

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Create Label

Create label with specific package and service type.

Request Body schema: application/json
package_type
required
string
Enum: "SMALL" "MEDIUM" "LARGE"

One of the package types returned when fetching rates.

service_type
required
string
Enum: "SAMEDAY" "NEXTDAY"

One of the service types returned when fetching rates.

business_name
string

Business name on whose behalf package is being delivered. In the case of a 3PL this would be the merchant business name. Is used in communication with client via SMS, etc.

origin
required
object (Recipient)

A individual reciving or sending a package

destination
required
object (Recipient)

A individual reciving or sending a package

signature_required
boolean

Signature required on delivery.

notes
string

Specific notes about delivery location for driver.

reference
string

Reference # or ID on the client side in case of any issues. Primarily to be used by our dispatcher to reach out to client but can also be used by client to attach specific metadata to label.

tracking_number
string

Optional unique tracking number. If provided, then the tracking number will be set to the given value. Otherwise it will be randomly generated.

Responses

200

OK

post/2020-04/labels.create
https://gina-staging.shipswyft.com/2020-04/labels.create

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "package_type": "SMALL",
  • "service_type": "SAMEDAY",
  • "business_name": "Acme Corporation",
  • "origin":
    {
    },
  • "destination":
    {
    },
  • "notes": "Ask concierge for elevator access",
  • "reference": "order #9000"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "bqofiflh5s5id0diioug",
  • "package_type": "SMALL",
  • "service_type": "SAMEDAY",
  • "business_name": "Acme Corporation",
  • "origin":
    {
    },
  • "destination":
    {
    },
  • "rate":
    {
    },
  • "notes": "Ask concierge for elevator access",
  • "reference": "order #9000",
  • "tracking_number": "9m4e2mr0ui3e8a215n4g",
  • "complete_after": "2020-05-06T21:00:00.000Z",
  • "complete_before": "2020-05-07T03:00:00.000Z",
  • "created_at": "2020-05-06T05:29:19.472Z",
  • "updated_at": "2020-05-06T05:29:19.472Z"
}

Delete Label

Cancel a recently created label. This will cause the label to not be scheduled for delivery but can still be fetched later for auditing.

Request Body schema: application/json
id
required
string

Label id returned on create.

Responses

200

OK

post/2020-04/labels.delete
https://gina-staging.shipswyft.com/2020-04/labels.delete

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "bqofiflh5s5id0diioug"
}

Get Label

Fetch a single label by id.

Request Body schema: application/json
id
required
string

Label id returned on create.

Responses

200

OK

post/2020-04/labels.get
https://gina-staging.shipswyft.com/2020-04/labels.get

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "bqofiflh5s5id0diioug"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "bqofiflh5s5id0diioug",
  • "package_type": "SMALL",
  • "service_type": "SAMEDAY",
  • "business_name": "Acme Corporation",
  • "origin":
    {
    },
  • "destination":
    {
    },
  • "rate":
    {
    },
  • "notes": "Ask concierge for elevator access",
  • "reference": "order #9000",
  • "tracking_number": "9m4e2mr0ui3e8a215n4g",
  • "complete_after": "2020-05-06T21:00:00.000Z",
  • "complete_before": "2020-05-07T03:00:00.000Z",
  • "created_at": "2020-05-06T05:29:19.472Z",
  • "updated_at": "2020-05-06T05:29:19.472Z"
}

Print Label

Fetch printable PDF for single label by id.

Request Body schema: application/json
id
required
string

Label id returned on create.

Responses

200

OK

post/2020-04/labels.print
https://gina-staging.shipswyft.com/2020-04/labels.print

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "bqofiflh5s5id0diioug"
}

Tracking

Get Tracking Status

Fetch the delivery status of a label by id or tracking number.

Request Body schema: application/json
One of
  • By Label ID
  • By Tracking Number
id
required
string

Label id returned on create.

Responses

200

OK

post/2020-04/tracking.get
https://gina-staging.shipswyft.com/2020-04/tracking.get

Request samples

Content type
application/json
Example