Delivery

Inside the new API v1.0 we are redefining the entity TASK to Delivery, with that we also redefine payloads, responses and endpoints. We will introduce new helpers and functions that will enhance the control and monitoring of a delivery as well as creating different types of deliveries.

Endpoints

POST /deliveries

Create a new delivery

Description

In order to create a new delivery, you can either pre-select a quote with the time window that better fits your needs, or we'll create the new delivery for the next hour available.

curl -X POST \
  https://api.shippify.co/v1/deliveries/ \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'content-type: application/json' \
  -d '{
    "deliveries": [
        {
            "pickup": {
                "contact": {
                    "name": "John Doe", 
                    "email": "john@doe.com",
                    "phonenumber": "+19209489292"
                },
                "location": {
                    "address": "Central Park, New York, NY, United States",
                    "instructions": "Central Park West, APT 10920 "
                }
            },
            "dropoff":{
                "contact": {
                    "name": "Mary Doe", 
                    "email": "mary@doe.co",
                    "phonenumber": "+19209085222"
                },
                "location": {
                    "address": "200 Eastern Pkwy, Brooklyn, NY 11238, USA",
                    "instructions": "APT 2094",
                    "lat": 40.6720036,
                    "lng": -73.9593279
                }
            },
            "packages": [
                {
                    "name": "paperwork1",
                    "size": "xs",
                    "qty": 1
                }
                ]
        }
        ],
    "quoteId": 142323
}'
var data = JSON.stringify({
  "deliveries": [
    {
      "pickup": {
        "contact": {
          "name": "John Doe",
          "email": "john@doe.com",
          "phonenumber": "+19209489292"
        },
        "location": {
          "address": "Central Park, New York, NY, United States",
          "instructions": "Central Park West, APT 10920 "
        }
      },
      "dropoff": {
        "contact": {
          "name": "Mary Doe",
          "email": "mary@doe.co",
          "phonenumber": "+19209085222"
        },
        "location": {
          "address": "200 Eastern Pkwy, Brooklyn, NY 11238, USA",
          "instructions": "APT 2094",
          "lat": 40.6720036,
          "lng": -73.9593279
        }
      },
      "packages": [
        {
          "name": "paperwork1",
          "size": "xs",
          "qty": 1
        }
      ]
    }
  ],
  "quoteId": 142323
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.shippify.co/v1/deliveries/");
xhr.setRequestHeader("authorization", "Basic XXXXXXXXXXXXXXXXXXXX");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

Parameters

Type Name Schema
Body body
required
body

body

Name Description Schema
deliveries
optional
List of deliveries to be created < Delivery > array
quoteId
optional
Quote Id for pricing and time windows integer

Responses

HTTP Code Description Schema
200 Success Response 200
400 Bad Request Response 400
500 Internal Server error Response 500

Response 200

Name Description Schema
message
optional
Delivery created successfully string
payload
optional
< payload > array

payload

Name Description Schema
currencyCode
optional
Currency code
Example : "USD"
string
distance
optional
Distance of the delivery number
id
optional
Delivery unique identifier string
price
optional
Cost of the delivery number

Response 400

Name Description Schema
message
optional
Example : "Invalid Request" string
payload
optional
{} object

Response 500

Name Description Schema
message
optional
Error while retrieving the quote string
payload
optional
{} object

Get a delivery by ID

GET /deliveries/{:id}
  curl -X POST \
  https://api.shippify.co/v1/deliveries/t-shieam-15853 \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXX' \
  -H 'content-type: application/json' \
  var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.shippify.co/v1/deliveries/t-shieam-15853");
xhr.setRequestHeader("authorization", "Basic XXXXXXXXXXXXXXXXXXXXXXX");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

Parameters

Type Name Description Schema
Query {:id}
optional
Delivery ID string

Responses

HTTP Code Description Schema
200 OK Delivery
400 Bad Request Response 400
500 Internal Server Error Response 500

Response 400

Name Description Schema
message
optional
Invalid request string
payload
optional
{} object

Response 500

Name Description Schema
message
optional
Error while retrieving the delivery string
payload
optional
{} object

Get Delivery completed info

GET /deliveries/{:id}/complete
  curl -X POST \
  https://api.shippify.co/v1/deliveries/t-shieam-15853/complete \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXX' \
  -H 'content-type: application/json' \
  var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.shippify.co/v1/deliveries/t-shieam-15853/complete");
xhr.setRequestHeader("authorization", "Basic XXXXXXXXXXXXXXXXXXXXXXX");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);

Description

This endpoint provides you a ser of completed information about the delivery and its tracking information

Parameters

Type Name Schema
Path :id
Here id can be the task id, or the reference ID indexed with the ID from your system, or the ID from your package. Used for integrations with other platforms.
required
string

Responses

HTTP Code Description Schema
200 Status OK Response 200
400 Bad request Response 400
500 Internal Server Error Response 500

Response 200

Name Description Schema
_status
optional
Descriptive delivery status
Example : "at_pickup"
string
company
optional
Company the delivery belongs to
Example : "Awesome Magazine ltda"
string
courier
optional
courier
delivery_feedback
optional
Feedback when delivery < string > array
distance
optional
Total delivery distance in kilometers
Example : 20.3
number
dropoff
optional
dropoff
id
optional
Delivery identifier
Example : "t-shiinc-1029"
string
routeId
optional
Route identifier
Example : "r-shiinc-1029"
string
items
optional
List of items the shipper is deliverying < Package > array
pickup
optional
pickup
rating
optional
Out of 5 stars rating
Example : "5"
string
recipient
optional
recipient
status
optional
Delivery status
Example : 5
integer

courier

Name Description Schema
info
optional
info
location
optional
Shipper's current location location

info

Name Description Schema
shipperCapacity
optional
Total capacity for shipper's vehicle
Example : "medium"
string
shipperId
optional
Shipper unique identifier
Example : "14232"
string
shipperName
optional
Shipper's name
Example : "John Perez"
string
vehicleLicensePlate
optional
Shipper's vehicle license plate
Example : "GBL-0289"
string
vehicleModel
optional
Shipper's vehicle model
Example : "Kia cerato"
string
vehicleType
optional
Shipper's vehicle car type
Example : "Sedan"
string

location

Name Description Schema
lat
optional
Shipper's current location latitude
Example : -23.6028998
number
lng
optional
Shipper's current location longitude
Example : -46.6762638
number

dropoff

Name Description Schema
date
optional
Delivery date time
Example : "2017-07-31T18:00:00.000Z"
string (date-time)
location
optional
location

location

Name Description Schema
address
optional
Delivery address location
Example : "625 8th Ave, New York, NY 10018, USA"
string
lat
optional
Delivery address latitude
Example : -23.6028998
number
lng
optional
Delivery address longitude
Example : -46.6762638
number

pickup

Name Description Schema
date
optional
Pickup date time
Example : "2017-07-31T16:00:00.000Z"
string (date-time)

recipient

Name Description Schema
email
optional
Recipient's email
Example : "john.doe@me.com"
string
name
optional
Recipient's name
Example : "John Doe"
string
phonenumber
optional
Recipient's phone or mobile number
Example : "+15902824949"
string

Response 400

Name Description Schema
message
optional
Example : "No task was found with that id" string

Response 500

Name Description Schema
message
optional
Example : "Internal Server Error" string

results matching ""

    No results matching ""