Introduction

Speedworks is a delivery company providing hassle-free delivery services for businesses of all sizes. This documentation is to provide shippers get up-and-running with Speedworks services to provide details on how to work with our APIs

The portal provides documentation for the following APIs and services:

  • Delivery API. Create delivery orders.
  • Tracking API. Retrieve parcel status and delivery history.

All Speedworks APIs are RESTful APIs.

API_URL: (production) https://api.speedworkscourier.com/

API_URL: (staging) https://api-staging.speedworkscourier.com/

Authentication

Get JWT token : POST API_URL/v2/auth/login

Request body
                        {
                            "username": "username-here",
                            "password": "password-here"
                        }
                    
Success response
                        {
                            "token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjFlOTczZWUwZTE2ZjdlZWY0ZjkyMWQ1MGRjNjFkNzBiMmVmZWZjMTkiLCJ0eXAiOiJKV1QifQxxx"
                        }
                    

Tracking API

Track parcels : GET API_URL/v2/parcels/tracking?search=awb/order-number

Single Delivery Order API

Create delivery order : https://api.speedworkscourier.com/v2/deliveries/

Postman Configuration

To use this API in Postman, follow these steps:

  1. Open Postman and create a new POST request.
  2. Set the request URL to https://api.speedworkscourier.com/v2/deliveries/.
  3. In the Headers tab, add the following headers:
    • Content-Type: application/json
    • Authorization: Bearer YOUR_ACCESS_TOKEN
  4. In the Body tab, select the raw format and choose JSON. Use the following JSON structure:
                    {
                        "delivery": {
                            "internal_awb_number": "your_internal_awb_number",
                            "awb_number": "your_awb_number",
                            "order_number": "your_order_number",
                            "pick_up_name": "your_pick_up_name",
                            "pick_up_address": "your_pick_up_address",
                            "consignee_contact_number": "your_consignee_contact_number",
                            "consignee_name": "your_consignee_name",
                            "consignee_address": "your_consignee_address",
                            "is_cash_on_delivery": true,
                            "total_amount": 100.00,
                            "partner_name": "your_partner_name",
                            "notes": "your_notes",
                            "delivery_status_id": 1,
                            "item_name": "your_item_name",
                            "item_width": 10,
                            "item_length": 10,
                            "item_height": 10,
                            "total_weight": 1.5
                        }
                    }
                    

Example code snippets:

Axios (Javascript)
                        var axios = require('axios');
                        var data = JSON.stringify({
                            "delivery": {
                                "internal_awb_number": "your_internal_awb_number",
                                "awb_number": "your_awb_number",
                                "order_number": "your_order_number",
                                "pick_up_name": "your_pick_up_name",
                                "pick_up_address": "your_pick_up_address",
                                "consignee_contact_number": "your_consignee_contact_number",
                                "consignee_name": "your_consignee_name",
                                "consignee_address": "your_consignee_address",
                                "is_cash_on_delivery": true,
                                "total_amount": 100.00,
                                "partner_name": "your_partner_name",
                                "notes": "your_notes",
                                "delivery_status_id": 1,
                                "item_name": "your_item_name",
                                "item_width": 10,
                                "item_length": 10,
                                "item_height": 10,
                                "total_weight": 1.5
                            }
                        });
                
                        var config = {
                            method: 'post',
                            url: 'https://api.speedworkscourier.com/v2/deliveries/',
                            headers: { 
                                'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 
                                'Content-Type': 'application/json'
                            },
                            data : data
                        };
                
                        axios(config)
                        .then(function (response) {
                            console.log(JSON.stringify(response.data));
                        })
                        .catch(function (error) {
                            console.log(error);
                        });
                    

Bulk Delivery Order API

Upload delivery orders via excel : API_URL/v2/deliveries/bulk

Example code snippets:

Axios (Javascript)
                        var axios = require('axios');
                        var FormData = require('form-data');
                        var fs = require('fs');
                        var data = new FormData();
                        data.append('file', fs.createReadStream('/SPEEDWORKS-DISPATCH-MANIFEST-12APR23.xlsx'));

                        var config = {
                        method: 'post',
                        url: '/v2/deliveries/bulk',
                        headers: { 
                            'Authorization': 'Bearer token-here'
                            ...data.getHeaders()
                        },
                        data : data
                        };
                        axios(config)
                        .then(function (response) {
                        console.log(JSON.stringify(response.data));
                        })
                        .catch(function (error) {
                        console.log(error);
                        });
                   
cURL
                        curl --location --request POST '/v2/deliveries/bulk' \
                        --header 'Authorization: Bearer token-here' \
                        --form 'file=@"/SPEEDWORKS-DISPATCH-MANIFEST-12APR23.xlsx"'
                    
Python
                        import requests
                        url = "/v2/deliveries/bulk"
                        payload={}
                        files=[
                        ('file',('SPEEDWORKS-DISPATCH-MANIFEST-12APR23.xlsx',open('/SPEEDWORKS-DISPATCH-MANIFEST-12APR23.xlsx','rb'),'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'))
                        ]
                        headers = {
                        'Authorization': 'Bearer token-here'
                        }
                        response = requests.request("POST", url, headers=headers, data=payload, files=files)
                        print(response.text)
                    
Java (OkHttp)
                        OkHttpClient client = new OkHttpClient().newBuilder()
                        .build();
                        MediaType mediaType = MediaType.parse("text/plain");
                        RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
                        .addFormDataPart("file","SPEEDWORKS-DISPATCH-MANIFEST-12APR23.xlsx",
                            RequestBody.create(MediaType.parse("application/octet-stream"),
                            new File("/SPEEDWORKS-DISPATCH-MANIFEST-12APR23.xlsx")))
                        .build();
                        Request request = new Request.Builder()
                        .url("localhost:3003/v2/deliveries/bulk")
                        .method("POST", body)
                        .addHeader("Authorization", "Bearer token-here")
                        .build();
                        Response response = client.newCall(request).execute();