A delivery draft represents an incomplete delivery which has been put off for later modifications. Ultimately, a delivery draft can be completed when it has set time and price, only then, it becomes a delivery itself.
POST /deliveries/drafts
In order to create a new delivery draft, you just need to pre-complete the minimum basic information for a delivery.
curl -X POST \https://api.shippify.co/v1/deliveries/drafts \-H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXX' \-H 'content-type: application/json' \-d '{"drafts": [{"pickup": {"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"}},"sendEmail": true}]}'
var data = JSON.stringify({"drafts": [{"pickup": {"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"}},"sendEmail": true}]});​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/drafts");xhr.setRequestHeader("authorization", "Basic XXXXXXXXXXXXXXXXXXXX");xhr.setRequestHeader("content-type", "application/json");​xhr.send(data);
Type | Name | Schema |
Body | body required | ​body​ |
body
Name | Description | Schema |
deliveries optional | List of deliveries to be created | < Delivery > array |
HTTP Code | Description | Schema |
200 | Success | ​Response 200​ |
400 | Bad Request | ​Response 400​ |
500 | Internal Server error | ​Response 500​ |
Response 200
Name | Description | Schema |
payload optional | array of delivery draft ids | array |
message optional | Draft saved successfully | string |
Response 400
Name | Description | Schema |
message optional | Example : | string |
payload optional | {} | object |
Response 500
Name | Description | Schema |
message optional | Error while retrieving the quote | string |
payload optional | {} | object |