Sway API (fka Swyft API) (1.0.5)

Download OpenAPI specification:Download

Latest changes

1.0.1 : changed error response format on every v5 endpoint

1.0.1 : added optional render_zpl field in body request for [v5] Create Label and removed the accept:application/zpl header option that was used in previous create label endpoints

1.0.2 : changed [v5] Delete label 200 response format from text/html to application/json

1.0.2 : added optional render_zpl field in body request for [v5] GET label request

1.0.3: simplified [v5] Tracking status 200 response body

1.0.3: added format field in [v5] Print Label request body

1.0.3: added ability to [v5] Print Label return zpl and pdf format. Response header content-type will be application/zpl or application/pdf

1.0.4: added rate_card_type in RateV5 object

1.0.5: added optional service_add_ons field in request and response body [v5] Create Label and response in [v5] Get Label

Introduction

Sway is a middle/last-mile delivery service that offers same and next-day shipping to customers at affordable rates. The Sway technology platform with its network of warehouses and delivery companies provides merchants and their customers the best delivery experience possible.

API Overview

Welcome to the API documentation!

To use our API, make sure to set up your Swyft account by contacting your Merchant Success Manager or by contacting Swyft Support. Most user actions that can be done in our Merchant Dashboard can be done though our REST API.

Common Use Cases:

  • Creating a label
  • Deleting a label
  • Tracking a label
  • Printing a label
  • Getting package delivery rates

Authentication

AccessToken

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

Rates

[v5] Fetch Rates

Fetch rates for given destination, dimensions and pickup location (required only if merchant has more than one pickup location).

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

Address of the package's destination

required
object

Package dimensions.

pickup_location_slug
string

Identifier for the pickup location of the packages. Required if merchant contains more than one pickup location.

Responses

Request samples

Content type
application/json
{
  • "destination": {
    },
  • "dimensions": {
    },
  • "pickup_location_slug": "string"
}

Response samples

Content type
application/json
{
  • "rates": [
    ],
  • "errors": [
    ]
}

Labels

[v5] Get Label

Fetch a single label by id.

Authorizations:
Request Body schema: application/json
One of
id
required
string

Label id.

render_zpl
boolean
Default: false

flag to indicate if zpl should be rendered and returned on response payload.

Responses

Request samples

Content type
application/json
{
  • "id": "bqofiflh5s5id0diioug"
}

Response samples

Content type
application/json
{
  • "id": "bqofiflh5s5id0diioug",
  • "client_id": "acme_corp",
  • "business_name": "Acme Corporation",
  • "origin": {
    },
  • "destination": {
    },
  • "rate": {
    },
  • "notes": "Ask concierge for elevator access",
  • "reference": "order #9000",
  • "reference2": "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",
  • "service_add_ons": [
    ]
}

[v5] Create Label

Create label for specific service type.

Authorizations:
Request Body schema: application/json
service_type
required
string
Enum: "SAMEDAY" "EXPEDITED"

One of the service types returned when fetching rates.

required
object (Dimensions)

Package dimensions

required
object (Recipient with Phone)

An individual receiving or sending a package.

required
Recipient with Phone (object) or Recipient with Email (object) (Recipient)

An individual receiving or sending a package.

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.

notes
string

Specific notes about delivery location for driver.

order_number
string

Order number from client's system.

shipment_id
string

Shipment id for a group of orders from client's system.

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.

reference2
string

Secondary reference # or ID on the client side in case of any issues. Can 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.

pickup_location_slug
string

Identifier for the pickup location of this package. Required if merchant has multiple pickup locations

render_zpl
boolean
Default: false

flag to indicate if zpl should be rendered and returned on response payload.

service_add_ons
Array of strings (ServiceAddOns)
Items Enum: "SIGNATURE" "CHECK_ID"

A string representing extra service requirements of the label.

  • SIGNATURE - the label will display a SIGNATURE requirement.
  • CHECK_ID - the label will display a CHECK ID requirement.

Responses

Request samples

Content type
application/json
{
  • "service_type": "SAMEDAY",
  • "dimensions": {
    },
  • "origin": {