Download OpenAPI specification:Download
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
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.
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.
Fetch rates for given destination, dimensions and pickup location (required only if merchant has more than one pickup location).
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. |
{- "destination": {
- "line1": "188 University Ave",
- "line2": "Unit 4303",
- "city": "Los Angeles",
- "postal_code": "90210",
- "province": "CA",
- "country": "US"
}, - "dimensions": {
- "length": 10,
- "width": 8,
- "height": 12,
- "weight": 0.5
}, - "pickup_location_slug": "string"
}
{- "rates": [
- {
- "service_type": "EXPEDITED",
- "currency": "USD",
- "tnt": 1,
- "options": [
- {
- "name": "SIGNATURE_REQUIRED",
- "price": 2
}, - {
- "name": "ADDITIONAL_PACKAGE",
- "price": 8
}, - {
- "name": "ADDITIONAL_PACKAGE",
- "price": 8
}
], - "options_total_price": 18,
- "delivery_price": 10,
- "total_price": 28,
- "rate_card_type": "rateCardV3"
}
], - "errors": [
- {
- "code": "InvalidValue",
- "msg": "dimensions"
}
]
}
Fetch a single label by id.
id required | string Label id. |
render_zpl | boolean Default: false flag to indicate if zpl should be rendered and returned on response payload. |
{- "id": "bqofiflh5s5id0diioug"
}
{- "id": "bqofiflh5s5id0diioug",
- "client_id": "acme_corp",
- "business_name": "Acme Corporation",
- "origin": {
- "first_name": "Bob",
- "last_name": "Dylan",
- "phone": "416 647 8888",
- "address": {
- "line1": "222 Bay St",
- "city": "Los Angeles",
- "postal_code": "90211",
- "province": "CA",
- "country": "US"
}
}, - "destination": {
- "first_name": "Elton",
- "last_name": "John",
- "phone": "647 416 8888",
- "address": {
- "line1": "188 University Ave",
- "line2": "Unit 4303",
- "city": "Los Angeles",
- "postal_code": "90210",
- "province": "CA",
- "country": "US"
}
}, - "rate": {
- "service_type": "SAMEDAY",
- "currency": "USD",
- "tnt": 1,
- "options": [ ],
- "options_total_price": 0,
- "delivery_price": 10,
- "total_price": 10
}, - "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": [
- "CHECK_ID"
]
}
Create label for specific service type.
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.
|
{- "service_type": "SAMEDAY",
- "dimensions": {
- "length": 1,
- "height": 2,
- "width": 3,
- "weight": 0.5
}, - "origin": {
- "first_name": "Bob",
- "last_name": "Dylan",
- "phone": "416 647 8888",
- "address": {
- "line1": "1313 Disneyland Dr",
- "city": "Anaheim",