NAV
php javascript bash

Info

Welcome to the V3 Collivery.net API reference.

Please refer to the documentation of our older api Learn more

Headers

{
  "X-App-Name": "My Custom App", // Application Name
  "X-App-Version": "0.2.1", // Application Version
  "X-App-Host": ".NET Framework 4.8", // Framework/CMS name and version
  "X-App-Lang": "C#", // Language your implementation is written in
  "X-App-Url": "https://example.com", // URL your site is hosted on. *Optional
}

The following headers are required with each request, they help us to track the requests from each app in order to offer you help when you get stuck.

As a reminder you will see this tag with each example to indicate that you must include these in production. Requires headers

Please make these values your own, they will be rejected if they are all the default values suggested here. You can, however, use the default headers if you are logging in as api@collivery.co.za or demo@collivery.co.za.


Customise this page's example headers


We offer a json collection for you to import into PostMan while testing.
Get Postman Collection

1. Authentication

Please note:

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.collivery.co.za/v3/login',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'email' => 'demo@collivery.co.za',
            'password' => 'demo',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/login"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "email": "demo@collivery.co.za",
    "password": "demo"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.collivery.co.za/v3/login" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"email":"demo@collivery.co.za","password":"demo"}'

Example response (200):

{
    "data": {
        "id": 87,
        "full_name": "Collivery Demo",
        "email_address": "demo@collivery.co.za",
        "landline_number": "011 241 4911",
        "mobile_number": "",
        "api_token": "OpSjx5TlXGCGkzGAvUOm",
        "client": {
            "id": 116,
            "name": "Test Collivery (Pty) Ltd",
            "landline_number": "011 241 4911",
            "mobile_number": null,
            "account_code": "HPNTESTCOLLI",
            "account_type": "pre-paid",
            "primary_address": {
                "id": 952,
                "custom_id": null,
                "town_id": 147,
                "suburb_id": 1936,
                "text": "MDS JHB, 58C Webber St, Selby, Johannesburg",
                "short_text": "MDS JHB, Selby, Johannesburg",
                "location_type": {
                    "id": 1,
                    "name": "Business Premises",
                    "surcharge": false,
                    "surcharge_amount": 0
                },
                "geocode_data": {
                    "accuracy": 8,
                    "accuracy_type": "Address",
                    "last_geocoded_at": "2010-06-09",
                    "latitude": -26.214703,
                    "longitude": 28.040485
                }
            }
        }
    }
}

HTTP Request

POST v3/login

Body Parameters

Parameter Type Status Description
email string required Your email address.
password string required Your login password.

Register

Create a new client account

Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.collivery.co.za/v3/register',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'name' => 'John Doe',
            'terms' => true,
            'email_address' => 'foobar@example.com',
            'cellphone' => 123456789,
            'town_id' => 147,
            'suburb_id' => 1936,
            'street_name' => 'Webber Street',
            'street_number' => '58c',
            'building' => 'MDS House',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/register"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "name": "John Doe",
    "terms": true,
    "email_address": "foobar@example.com",
    "cellphone": 123456789,
    "town_id": 147,
    "suburb_id": 1936,
    "street_name": "Webber Street",
    "street_number": "58c",
    "building": "MDS House"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.collivery.co.za/v3/register" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"name":"John Doe","terms":true,"email_address":"foobar@example.com","cellphone":123456789,"town_id":147,"suburb_id":1936,"street_name":"Webber Street","street_number":"58c","building":"MDS House"}'

Example response (200):

{
    "data": {
        "id": 54596,
        "full_name": "John Doe",
        "email_address": "foobar@example.com",
        "landline_number": "123456789",
        "mobile_number": "123456789",
        "api_token": "q4HuuQP67J6NabYoqov4",
        "client": {
            "id": 40203,
            "name": "John Doe",
            "landline_number": "123456789",
            "mobile_number": "123456789",
            "account_code": null,
            "account_type": "pre-paid",
            "primary_address": {
                "id": 2433244,
                "custom_id": null,
                "town": "Johannesburg",
                "town_id": 147,
                "suburb": "Selby",
                "suburb_id": 1936,
                "text": "John Doe, MDS House, 58c Webber Street, Selby, Johannesburg",
                "short_text": "John Doe, Selby, Johannesburg"
            }
        }
    }
}

Example response (412):

{
    "error": [
        [
            "That email address is already registered. Please rather login through http:\/\/api.collivery.local\/v3\/login"
        ]
    ]
}

HTTP Request

POST v3/register

Body Parameters

Parameter Type Status Description
name string required Your full name. Minimum 5 characters. Maximum 50 characters.
terms boolean required Whether you accept all terms an conditions. Should be fetched from our /terms endpoint.
email_address string required A valid email address that is not yet registered.
telephone integer optional Your personal or business land-line number. One of telephone or cellphone must be provided.
cellphone integer optional Your personal or business mobile number. One of telephone or cellphone must be provided.
town_id integer required A valid town id, can be fetched from out /towns endpoint.
suburb_id integer required A valid id of a suburb in the town provided, can be fetched from out /suburbs endpoint.
street_name string required The name of the street your primary address is on. Minimum 5 characters, maximum 50 characters.
street_number string optional The street number of your primary address. Maximum 5 characters.
building string optional The building name of your primary address. Maximum 50 characters.
company_name string optional The name of your business. Indicates that this is a business registration. Minimum 5 characters. Maximum 70 characters.
id_number integer optional ID number of the person responsible for the payment of the account. Required if company_name is filled. Maximum 20 characters. If you are registering as a business and this is an invalid RSA id number your account will automatically be placed on hold, and we will contact you to get the correct details.
vat_number string optional Your company VAT number. Required if company_name is filled. Maximum 20 characters.
registration string optional Your company registration number. Required if company_name is filled. Maximum 20 characters.

2. Addresses

Manage Addresses

Index

List your addresses

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/address',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'query' => [
            'per_page'=> '3',
            'search'=> 'Johannes',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/address"
);

let params = {
    "per_page": "3",
    "search": "Johannes",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/address?per_page=3&search=Johannes" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "id": 952,
            "custom_id": null,
            "town_id": 147,
            "suburb_id": 1936,
            "text": "MDS JHB, 58C Webber St, Selby, Johannesburg",
            "short_text": "MDS JHB, Selby, Johannesburg",
            "location_type": {
                "id": 1,
                "name": "Business Premises",
                "surcharge": false,
                "surcharge_amount": 0
            },
            "geocode_data": {
                "accuracy": 8,
                "accuracy_type": "Address",
                "last_geocoded_at": "2010-06-09",
                "latitude": -26.214703,
                "longitude": 28.040485
            }
        },
        {
            "id": 3366477,
            "custom_id": null,
            "town_id": 147,
            "suburb_id": 2,
            "text": "luna test, 12 to 16 Laub St, Aanwins A.H., Johannesburg",
            "short_text": "luna test, Aanwins A.H., Johannesburg",
            "location_type": {
                "id": 15,
                "name": "Private House",
                "surcharge": false,
                "surcharge_amount": 0
            }
        },
        {
            "id": 3366478,
            "custom_id": null,
            "town_id": 147,
            "suburb_id": 2,
            "text": "luna test, 12 to 16 Laub St, Aanwins A.H., Johannesburg",
            "short_text": "luna test, Aanwins A.H., Johannesburg",
            "location_type": {
                "id": 15,
                "name": "Private House",
                "surcharge": false,
                "surcharge_amount": 0
            }
        }
    ],
    "links": {
        "first": "http:\/\/api.collivery.co.za\/v3\/address?page=1",
        "last": "http:\/\/api.collivery.co.za\/v3\/address?page=25",
        "prev": null,
        "next": "http:\/\/api.collivery.co.za\/v3\/address?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 25,
        "path": "http:\/\/api.collivery.co.za\/v3\/address",
        "per_page": 3,
        "to": 3,
        "total": 75
    }
}

HTTP Request

GET v3/address

Query Parameters

Parameter Status Description
per_page optional The limit per page. If this option is provided, 'links' and meta will exist in the; response with further information about the full list of addresses. 0 is the same as not limiting. Default is 100.
include optional A comma separated list of relationships to return. Available entries: contacts, suburb, town, active_waybills.
custom_id optional Search by this custom address id only.
search optional Search in street, building, company_name, suburb or town for a match.
town_id optional Limit to results with this town id.
suburb_id optional Limit to results with this suburb id.

Store

Save a new Address.

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.collivery.co.za/v3/address',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'town_id' => 147,
            'town_name' => 'Johannesburg',
            'suburb_id' => 1936,
            'suburb_name' => 'Selby',
            'company_name' => 'MDS Collivery',
            'building' => 'MDS House',
            'street_number' => '58c',
            'street' => 'Webber Street',
            'location_type' => 1,
            'location_type_name' => 'Business Premises',
            'contact' => [
                'id' => 2519728,
                'full_name' => 'John Doe',
                'cellphone' => '0723456789',
                'email_address' => 'demo@collivery.co.za',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/address"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "town_id": 147,
    "town_name": "Johannesburg",
    "suburb_id": 1936,
    "suburb_name": "Selby",
    "company_name": "MDS Collivery",
    "building": "MDS House",
    "street_number": "58c",
    "street": "Webber Street",
    "location_type": 1,
    "location_type_name": "Business Premises",
    "contact": {
        "id": 2519728,
        "full_name": "John Doe",
        "cellphone": "0723456789",
        "email_address": "demo@collivery.co.za"
    }
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.collivery.co.za/v3/address" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"town_id":147,"town_name":"Johannesburg","suburb_id":1936,"suburb_name":"Selby","company_name":"MDS Collivery","building":"MDS House","street_number":"58c","street":"Webber Street","location_type":1,"location_type_name":"Business Premises","contact":{"id":2519728,"full_name":"John Doe","cellphone":"0723456789","email_address":"demo@collivery.co.za"}}'

Example response (201):

{
    "data": {
        "id": 3457079,
        "custom_id": null,
        "town_id": 147,
        "suburb_id": 1936,
        "text": "MDS Collivery, MDS House, 58c Webber Street, Selby, Johannesburg",
        "short_text": "MDS Collivery, Selby, Johannesburg",
        "location_type": {
            "id": 1,
            "name": "Business Premises",
            "surcharge": false,
            "surcharge_amount": 0
        },
        "contacts": [
            {
                "id": 3628019,
                "full_name": "John Doe ",
                "cell_no": "0723456789",
                "cellphone": "0723456789",
                "work_no": "",
                "work_phone": "",
                "email": "demo@collivery.co.za"
            }
        ]
    }
}

HTTP Request

POST v3/address

Body Parameters

Parameter Type Status Description
custom_id string optional The custom id you would like to assign to this address. Must be unique. Max 20 characters.
town_id integer required without town_name. Can be obtained from /towns/ endpoint.
town_name string required without town_id. Can be obtained from /towns/ endpoint.
suburb_id integer required without suburb_name. Can be obtained from /suburbs/ endpoint.
suburb_name string required without suburb_id. Can be obtained from /suburbs/ endpoint.
company_name string optional The name of the company of the address. Max 50 characters.
building string optional The building of the address. Max 50 characters.
street_number string optional The number on the street of the address. Max 5 characters.
street string required The name of the street that the address is on. Max 50 characters.
location_type integer required without location_type_name. The id of the location type for the address. Can be obtained from /location_types/ endpoint.
location_type_name string required without location_type. The name of the location type for the address. Can be obtained from /location_types/ endpoint.
contact object optional optional If you are creating/updating a contact with the address, please ensure that it is a valid JSON object.
contact.id integer optional optional Only required for update requests. The id of the contact that you wish to update.
contact.full_name string optional optional If you are creating a contact with the address, their full name. Required if any of cellphone, work_phone or email_address is present in the contact object. Min 2 characters, max 50 characters.
contact.cellphone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and work_phone is not provided. Min 10 characters, max 20 characters.
contact.work_phone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and cellphone is not provided. Min 10 characters, max 20 characters.
contact.email_address string optional optional If you are creating a contact with the address, their full name. Useful for tracking updates to be sent to. Max 50 characters.

Show

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/address/952',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/address/952"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/address/952" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "id": 952,
        "custom_id": null,
        "town_id": 147,
        "suburb_id": 1936,
        "text": "MDS JHB, 58C Webber St, Selby, Johannesburg",
        "short_text": "MDS JHB, Selby, Johannesburg",
        "location_type": {
            "id": 1,
            "name": "Business Premises",
            "surcharge": false,
            "surcharge_amount": 0
        },
        "contacts": [
            {
                "id": 593,
                "full_name": "MDS Collivery JHB ",
                "cell_no": "0861637000",
                "cellphone": "0861637000",
                "work_no": "0112414900",
                "work_phone": "0112414900",
                "email": "jhb@collivery.co.za"
            }
        ],
        "geocode_data": {
            "accuracy": 8,
            "accuracy_type": "Address",
            "last_geocoded_at": "2010-06-09",
            "latitude": -26.214703,
            "longitude": 28.040485
        }
    }
}

HTTP Request

GET v3/address/{address}

URL Parameters

Parameter Status Description
address optional number required The address id.

Update

Modify the details of a pre-existing address.

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.collivery.co.za/v3/address/952',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'town_id' => 147,
            'town_name' => 'Johannesburg',
            'suburb_id' => 1936,
            'suburb_name' => 'Selby',
            'company_name' => 'MDS Collivery',
            'building' => 'MDS House',
            'street_number' => '58c',
            'street' => 'Webber Street',
            'location_type' => 1,
            'location_type_name' => 'Business Premises',
            'contact' => [
                'id' => 2519728,
                'full_name' => 'John Doe',
                'cellphone' => '0723456789',
                'email_address' => 'demo@collivery.co.za',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/address/952"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "town_id": 147,
    "town_name": "Johannesburg",
    "suburb_id": 1936,
    "suburb_name": "Selby",
    "company_name": "MDS Collivery",
    "building": "MDS House",
    "street_number": "58c",
    "street": "Webber Street",
    "location_type": 1,
    "location_type_name": "Business Premises",
    "contact": {
        "id": 2519728,
        "full_name": "John Doe",
        "cellphone": "0723456789",
        "email_address": "demo@collivery.co.za"
    }
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.collivery.co.za/v3/address/952" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"town_id":147,"town_name":"Johannesburg","suburb_id":1936,"suburb_name":"Selby","company_name":"MDS Collivery","building":"MDS House","street_number":"58c","street":"Webber Street","location_type":1,"location_type_name":"Business Premises","contact":{"id":2519728,"full_name":"John Doe","cellphone":"0723456789","email_address":"demo@collivery.co.za"}}'

Example response (200):

{
    "data": {
        "id": 2415979,
        "custom_id": "",
        "town": "Johannesburg",
        "town_id": 147,
        "suburb": "Selby",
        "suburb_id": 1936,
        "text": "MDS Collivery, MDS House, 58c Webber Street, Selby, Johannesburg",
        "short_text": "MDS Collivery, Selby, Johannesburg",
        "geocode_data": {
            "accuracy": 5,
            "accuracy_type": "Suburb",
            "last_geocoded_at": "1900-01-01",
            "latitude": 0,
            "longitude": 0
        }
    }
}

Example response (400):

{
    "error": {
        "http_code_text": "Bad Request",
        "http_code": 400,
        "message": "There are waybills linked to that address, rather create a new one."
    }
}

HTTP Request

PUT v3/address/{address}

PATCH v3/address/{address}

URL Parameters

Parameter Status Description
address optional number required The address id.

Body Parameters

Parameter Type Status Description
custom_id string optional The custom id you would like to assign to this address. Must be unique. Max 20 characters.
town_id integer required without town_name. Can be obtained from /towns/ endpoint.
town_name string required without town_id. Can be obtained from /towns/ endpoint.
suburb_id integer required without suburb_name. Can be obtained from /suburbs/ endpoint.
suburb_name string required without suburb_id. Can be obtained from /suburbs/ endpoint.
company_name string optional The name of the company of the address. Max 50 characters.
building string optional The building of the address. Max 50 characters.
street_number string optional The number on the street of the address. Max 5 characters.
street string required The name of the street that the address is on. Max 50 characters.
location_type integer required without location_type_name. The id of the location type for the address. Can be obtained from /location_types/ endpoint.
location_type_name string required without location_type. The name of the location type for the address. Can be obtained from /location_types/ endpoint.
contact object optional optional If you are creating/updating a contact with the address, please ensure that it is a valid JSON object.
contact.id integer optional optional Only required for update requests. The id of the contact that you wish to update.
contact.full_name string optional optional If you are creating a contact with the address, their full name. Required if any of cellphone, work_phone or email_address is present in the contact object. Min 2 characters, max 50 characters.
contact.cellphone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and work_phone is not provided. Min 10 characters, max 20 characters.
contact.work_phone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and cellphone is not provided. Min 10 characters, max 20 characters.
contact.email_address string optional optional If you are creating a contact with the address, their full name. Useful for tracking updates to be sent to. Max 50 characters.

Delete

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.collivery.co.za/v3/address/952',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/address/952"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.collivery.co.za/v3/address/952" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "message": "Address # 952 has been deleted"
    }
}

Example response (400):

{
    "error": {
        "http_code_text": "Bad Request",
        "http_code": 400,
        "message": "Address # 952 is already used for waybills, you cannot delete it."
    }
}

HTTP Request

DELETE v3/address/{address}

URL Parameters

Parameter Status Description
address optional number required The address id.

Show Default Address

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/default_address',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/default_address"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/default_address" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "id": 2415979,
        "custom_id": "",
        "town": "Johannesburg",
        "town_id": 147,
        "suburb": "Selby",
        "suburb_id": 1936,
        "text": "MDS Collivery, MDS House, 58c Webber Street, Selby, Johannesburg",
        "short_text": "MDS Collivery, Selby, Johannesburg"
    }
}

Example response (400):

{
    "error": {
        "http_code_text": "Bad Request",
        "http_code": 400,
        "message": "Default address not found."
    }
}

HTTP Request

GET v3/default_address

3. Contacts

Manage Address Contacts

For legacy reasons, on all endpoints all of cell_no/cellphone and work_no/work_phone are returned

Index

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/contacts',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'query' => [
            'per_page'=> '3',
            'search'=> 'Collivery',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/contacts"
);

let params = {
    "per_page": "3",
    "search": "Collivery",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/contacts?per_page=3&search=Collivery" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "id": 729097,
            "email": "support@collivery.co.za",
            "full_name": "Collivery Support",
            "cell_no": null,
            "cellphone": null,
            "work_no": "0123456789",
            "work_phone": "0123456789"
        },
        {
            "id": 729098,
            "email": "integration@collivery.co.za",
            "full_name": "Collivery Integration",
            "cell_no": null,
            "cellphone": null,
            "work_no": "0123456789",
            "work_phone": "0123456789"
        },
        {
            "id": 729099,
            "email": "api@collivery.co.za",
            "full_name": "Collivery Api",
            "cell_no": null,
            "cellphone": null,
            "work_no": "0123456789",
            "work_phone": "0123456789"
        }
    ],
    "links": {
        "first": "https:\/\/api.collivery.co.za\/v3\/contacts?page=1",
        "last": "https:\/\/api.collivery.co.za\/v3\/contacts?page=1532",
        "next": "https:\/\/api.collivery.co.za\/v3\/contacts?page=1501",
        "prev": "https:\/\/api.collivery.co.za\/v3\/contacts?page=1499"
    },
    "meta": {
        "current_page": 1500,
        "from": 4498,
        "last_page": 1532,
        "path": "https:\/\/api.collivery.co.za\/v3\/contacts",
        "per_page": "3",
        "to": 4500,
        "total": 4596
    }
}

HTTP Request

GET v3/contacts

Query Parameters

Parameter Status Description
per_page optional The limit per page. If this option is provided, links and meta will exist in the response with further information about the full list of addresses. 0 is the same as not limiting. Default is 100.
address_id optional Limit to contacts for this specific address.
search optional Search in name for a match.

Store

Save a new Contact.

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.collivery.co.za/v3/contacts',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'address_id' => 952,
            'email' => 'foo@example.com',
            'full_name' => 'John Doe',
            'cellphone' => '0721234567',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/contacts"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "address_id": 952,
    "email": "foo@example.com",
    "full_name": "John Doe",
    "cellphone": "0721234567"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.collivery.co.za/v3/contacts" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"address_id":952,"email":"foo@example.com","full_name":"John Doe","cellphone":"0721234567"}'

Example response (201):

{
    "data": {
        "id": 3628020,
        "full_name": "John Doe ",
        "cell_no": "0721234567",
        "cellphone": "0721234567",
        "work_no": null,
        "work_phone": null,
        "email": "foo@example.com"
    }
}

HTTP Request

POST v3/contacts

Body Parameters

Parameter Type Status Description
address_id integer required The id of the address you wish to add this contact to. Can be fetched through the /addresses endpoint.
email string optional optional Valid email address. Minimum 5 characters.
full_name string optional required. The contact's full name. Minimum 3 characters.
cellphone string required without work_phone. Minimum 10 characters. For legacy reasons, cell_no is also supported.
work_phone string required without cellphone. Minimum 10 characters. For legacy reasons, work_no is also supported.

Show

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/contacts/593',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/contacts/593"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/contacts/593" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "id": 593,
        "full_name": "MDS Collivery JHB ",
        "cell_no": "0861637000",
        "cellphone": "0861637000",
        "work_no": "0112414900",
        "work_phone": "0112414900",
        "email": "jhb@collivery.co.za"
    }
}

HTTP Request

GET v3/contacts/{contact}

URL Parameters

Parameter Status Description
contact optional number required The contact id

Update

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.collivery.co.za/v3/contacts/593',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'address_id' => 952,
            'email' => 'foo@example.com',
            'full_name' => 'John Doe',
            'cellphone' => '0721234567',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/contacts/593"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "address_id": 952,
    "email": "foo@example.com",
    "full_name": "John Doe",
    "cellphone": "0721234567"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.collivery.co.za/v3/contacts/593" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"address_id":952,"email":"foo@example.com","full_name":"John Doe","cellphone":"0721234567"}'

Example response (200):

{
    "data": {
        "id": 593,
        "full_name": "John Doe ",
        "cell_no": "0721234567",
        "cellphone": "0721234567",
        "work_no": null,
        "work_phone": null,
        "email": "foo@example.com"
    }
}

HTTP Request

PUT v3/contacts/{contact}

PATCH v3/contacts/{contact}

URL Parameters

Parameter Status Description
contact optional number required The contact id

Body Parameters

Parameter Type Status Description
address_id integer required The id of the address you wish to add this contact to. Can be fetched through the /addresses endpoint.
email string optional optional Valid email address. Minimum 5 characters.
full_name string optional required. The contact's full name. Minimum 3 characters.
cellphone string required without work_phone. Minimum 10 characters. For legacy reasons, cell_no is also supported.
work_phone string required without cellphone. Minimum 10 characters. For legacy reasons, work_no is also supported.

Delete

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.collivery.co.za/v3/contacts/593',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/contacts/593"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.collivery.co.za/v3/contacts/593" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "message": "Contact # 593 has been deleted."
    }
}

Example response (400):

{
    "error": {
        "http_code_text": "Bad Request",
        "http_code": 400,
        "message": "Contact # 593 is already used for waybills, you cannot delete it."
    }
}

HTTP Request

DELETE v3/contacts/{contact}

URL Parameters

Parameter Status Description
contact optional

4. Get Quote

Request a quote

Get a waybill quote based on the parameters provided.

### Any time warnings as well as adjusted times are returned in a "meta" array

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.collivery.co.za/v3/quote',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'services' => [
                2.0,
            ],
            'parcels' => [
                [
                    'length' => 21.5,
                    'width' => 10.0,
                    'height' => 5.5,
                    'weight' => 5.2,
                    'quantity' => 2,
                ],
            ],
            'collection_town' => 147,
            'delivery_town' => 200,
            'collection_location_type' => 1,
            'delivery_location_type' => 5,
            'collection_time' => '2025-01-24 12:00',
            'delivery_time' => '2025-01-25 16:00:00',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/quote"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "services": [
        2
    ],
    "parcels": [
        {
            "length": 21.5,
            "width": 10,
            "height": 5.5,
            "weight": 5.2,
            "quantity": 2
        }
    ],
    "collection_town": 147,
    "delivery_town": 200,
    "collection_location_type": 1,
    "delivery_location_type": 5,
    "collection_time": "2025-01-24 12:00",
    "delivery_time": "2025-01-25 16:00:00"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.collivery.co.za/v3/quote" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"services":[2],"parcels":[{"length":21.5,"width":10,"height":5.5,"weight":5.2,"quantity":2}],"collection_town":147,"delivery_town":200,"collection_location_type":1,"delivery_location_type":5,"collection_time":"2025-01-24 12:00","delivery_time":"2025-01-25 16:00:00"}'

Example response (200):

{
    "data": [
        {
            "service_type": 2,
            "total": 887.2
        }
    ],
    "meta": {
        "times": {
            "2": {
                "collection_time": "2025-01-24 12:00",
                "delivery_time": "2025-01-25 16:00"
            }
        },
        "warnings": [],
        "surcharges": {
            "2": {
                "locationTypeSurcharge": 120,
                "regionalSurcharge": 88
            }
        }
    }
}

HTTP Request

POST v3/quote

Body Parameters

Parameter Type Status Description
services.* number optional A list of the services you would like a quote on. Any or none of 1,2,3,5. Defaults to all services.
parcels.* object optional Very important for determining accurate an quote. Will default to an "average" parcel if not supplied. Dimensions are limited to 1000, weight is limited to 400
parcels.*.length float optional The length of the parcel. Values in centimetres. Can be supplied as floats or integers.
parcels.*.width float optional The width of the parcel. Values in centimetres. Can be supplied as floats or integers.
parcels.*.height float optional The height of the parcel. Values in centimetres. Can be supplied as floats or integers.
parcels.*.weight float optional The weight of the parcel. Values in kilograms. Can be supplied as floats or integers.
parcels.*.quantity integer optional The amount of parcels of this type.
collection_address integer/object optional optional Required if collection_town is not supplied. Can be the id of the address or a json object if the address is not yet stored. See below for object structure
delivery_address integer/object optional optional Required if delivery_town is not supplied. Can be the id of the address or a json object if the address is not yet stored. See below for object structure
collection_town integer optional optional Required if collection_address is not supplied.
delivery_town integer optional optional Required if delivery_address is not supplied.
collection_location_type integer optional optional Must be a valid location type. Values can be gotten from our /location_type endpoint.
delivery_location_type integer optional optional Must be a valid location type. Values can be gotten from our /location_type endpoint.
collection_time string optional optional Any future date/time representation that can be parsed by PHP strtotime(). Interpreted as GMT+2. If left empty no time surcharges will be encountered. Must be after current time.
delivery_time string optional Any future date/time representation that can be parsed by PHP strtotime(). Interpreted as GMT+2. If left empty no time surcharges will be encountered. Must be after collection_time.
exclude_weekend boolean optional optional Whether to allow for weekend collection or delivery. Surcharges will be applied. Defaults to true.
risk_cover boolean optional optional Whether to enable risk cover over and above the default cover. See terms and conditions. Surcharges will be applied. Defaults to false.
rica boolean optional optional Whether this delivery requires RICA information and documentation to be supplied. Surcharges will be applied. Defaults to false.
consignee boolean optional optional Whether this delivery can only be received by the person it is addressed to, with identity document required. Surcharges will be applied. Defaults to false.
sms_tracking boolean optional optional Whether to send SMS updates to you, the collection and delivery contacts. Surcharges will be applied. Defaults to false.
collection_address.custom_id string optional The custom id you would like to assign to this address. Must be unique. Max 20 characters.
collection_address.town_id integer optional Required without town_name. Can be obtained from /towns/ endpoint.
collection_address.town_name string optional Required without town_id. Can be obtained from /towns/ endpoint.
collection_address.suburb_id integer optional Required without suburb_name. Can be obtained from /suburbs/ endpoint.
collection_address.suburb_name string optional Required without suburb_id. Can be obtained from /suburbs/ endpoint.
collection_address.company_name string optional The name of the company of the address. Max 50 characters.
collection_address.building string optional The building of the address. Max 50 characters.
collection_address.street_number string optional The number on the street of the address. Max 5 characters.
collection_address.street string optional optional Required if the collection_address is filled. The name of the street that the address is on. Max 50 characters.
collection_address.location_type integer optional Required without location_type_name. The id of the location type for the address. Can be obtained from /location_types/ endpoint.
collection_address.location_type_name string optional Required without location_type. The name of the location type for the address. Can be obtained from /location_types/ endpoint.
delivery_address.custom_id string optional The custom id you would like to assign to this address. Must be unique. Max 20 characters.
delivery_address.town_id integer optional Required without town_name. Can be obtained from /towns/ endpoint.
delivery_address.town_name string optional Required without town_id. Can be obtained from /towns/ endpoint.
delivery_address.suburb_id integer optional Required without suburb_name. Can be obtained from /suburbs/ endpoint.
delivery_address.suburb_name string optional Required without suburb_id. Can be obtained from /suburbs/ endpoint.
delivery_address.company_name string optional The name of the company of the address. Max 50 characters.
delivery_address.building string optional The building of the address. Max 50 characters.
delivery_address.street_number string optional The number on the street of the address. Max 5 characters.
delivery_address.street string optional optional Required if the delivery_address is filled. The name of the street that the address is on. Max 50 characters.
delivery_address.location_type integer optional Required without location_type_name. The id of the location type for the address. Can be obtained from /location_types/ endpoint.
delivery_address.location_type_name string optional Required without location_type. The name of the location type for the address. Can be obtained from /location_types/ endpoint.

5. Waybills

Store

Create a new waybill

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.collivery.co.za/v3/waybill',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'service' => 3,
            'parcels' => [
                [
                    'length' => 21.5,
                    'width' => 10.0,
                    'height' => 5.5,
                    'weight' => 5.2,
                    'quantity' => 2,
                ],
            ],
            'collection_address' => '952',
            'collection_contact' => 593,
            'delivery_address' => '955',
            'delivery_contact' => 596,
            'collection_time' => '2025-01-24',
            'delivery_time' => '2025-01-25',
            'exclude_weekend' => true,
            'risk_cover' => true,
            'battery_type' => 'pi_965',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/waybill"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "service": 3,
    "parcels": [
        {
            "length": 21.5,
            "width": 10,
            "height": 5.5,
            "weight": 5.2,
            "quantity": 2
        }
    ],
    "collection_address": "952",
    "collection_contact": 593,
    "delivery_address": "955",
    "delivery_contact": 596,
    "collection_time": "2025-01-24",
    "delivery_time": "2025-01-25",
    "exclude_weekend": true,
    "risk_cover": true,
    "battery_type": "pi_965"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.collivery.co.za/v3/waybill" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"service":3,"parcels":[{"length":21.5,"width":10,"height":5.5,"weight":5.2,"quantity":2}],"collection_address":"952","collection_contact":593,"delivery_address":"955","delivery_contact":596,"collection_time":"2025-01-24","delivery_time":"2025-01-25","exclude_weekend":true,"risk_cover":true,"battery_type":"pi_965"}'

Example response (201):

{
    "data": {
        "id": 5336526,
        "custom_id": "",
        "service_type_id": 3,
        "service_type_name": "Road Freight",
        "collection_time": 1737698400,
        "customer_reference": "",
        "delivery_time": 1738159200,
        "parcel_count": 2,
        "special_instructions": "pi_965 ",
        "collection_address_id": 952,
        "collection_contact_id": 593,
        "delivery_address_id": 955,
        "delivery_contact_id": 596,
        "status_id": 2,
        "status_name": "Waiting Payment",
        "parcel_description": "pi_965 ",
        "weight": 10.4,
        "volumetric_weight": 0.6,
        "total_price": 251.2,
        "risk_cover": true,
        "parcels": [
            {
                "id": 9063477,
                "waybill_id": 5336526,
                "parcel_number": 1,
                "custom_id": "",
                "quantity": 2,
                "length": "22.0",
                "width": "10.0",
                "height": "6.0",
                "weight": "5.2",
                "volumetric_weight": "0.3",
                "created_at": "2021-07-23 11:19:14",
                "add_method": "client"
            }
        ]
    },
    "meta": {
        "payment_needed": "https:\/\/collivery.net\/payment_requests\/store?waybills%5B0%5D=5336526",
        "payment_reference": "C147779",
        "opening_hours": [
            "The earliest collect after time is 8:00. Collection time has been adjusted.",
            "The earliest deliver before time is 8:00. Delivery time has been adjusted."
        ],
        "delivery_hours": [
            "Minimum hours from Johannesburg to Durban on the Road Freight service is 72, you requested the waybill be delivered within 24 hours. Weekends included. Deliver before time has adjusted."
        ],
        "delivery_time": [
            "Road Freight and Road Freight express only deliver at 16:00. Deliver before time has adjusted."
        ],
        "service_type": [
            "Road Freight service needs at least 3 working days between collection and delivery. Moving delivery date forward."
        ]
    }
}

HTTP Request

POST v3/waybill

Body Parameters

Parameter Type Status Description
service integer optional A service you would like to deliver the waybill on. Defaults to 2 (Overnight Express).
parcels.* object optional Very important for determining accurate an quote. Will default to an "average" parcel if not supplied. Dimensions are limited to 1000, weight is limited to 400
parcels.*.length float optional The length of the parcel. Values in centimetres. Can be supplied as floats or integers.
parcels.*.width float optional The width of the parcel. Values in centimetres. Can be supplied as floats or integers.
parcels.*.height float optional The height of the parcel. Values in centimetres. Can be supplied as floats or integers.
parcels.*.weight float optional The weight of the parcel. Values in kilograms. Can be supplied as floats or integers.
parcels.*.quantity integer optional The amount of parcels of this type.
delivery_method integer optional The vehicle that we should collect it with. Defaults to 1 (Motorbike).
collection_address integer/object optional optional Required if collection_town is not supplied. Can be the id of the address or a json object if the address is not yet stored. See below for object structure.
collection_contact integer optional optional The id of the Collection Contact. Required only if you are not providing the contact object in collection_address.
delivery_address integer/object optional optional Required if delivery_town is not supplied. Can be the id of the address or a json object if the address is not yet stored. See below for object structure.
delivery_contact integer optional optional The id of the Delivery Contact. Required only if you are not providing the contact object in delivery_address.
collection_time string optional optional Any future date/time representation that can be parsed by PHP strtotime(). Interpreted as GMT+2. If left empty no time surcharges will be encountered. Must be after current time.
delivery_time string optional Any future date/time representation that can be parsed by PHP strtotime(). Interpreted as GMT+2. If left empty no time surcharges will be encountered. Must be after collection_time. Example:
exclude_weekend boolean optional optional Whether to allow for weekend collection or delivery. Surcharges will be applied. Defaults to true.
custom_id string optional A custom id for you to track the waybill by. Max 25 characters.
reference string optional Customer reference number. Max 100 characters.
description string optional A description of the package. Max 100 characters.
special_instructions string optional Any instructions on the handling, collection or delivery of your waybill. Max 2048 characters.
risk_cover boolean optional optional Whether to enable risk cover over and above the default cover. See terms and conditions. Surcharges will be applied. Defaults to false.
rica boolean optional optional Whether this delivery requires RICA information and documentation to be supplied. Surcharges will be applied. Defaults to false.
consignee boolean optional optional Whether this delivery can only be received by the person it is addressed to, with identity document required. Surcharges will be applied. Defaults to false.
sms_tracking boolean optional optional Whether to send SMS updates to you, the collection and delivery contacts. Surcharges will be applied. Defaults to false.
battery_type string optional optional Does the parcel contain any lithium ion batteries. The values for this can be gotten from our /battery_types endpoint. Defaults to false.
collection_address.custom_id string optional The custom id you would like to assign to this address. Must be unique. Max 20 characters.
collection_address.town_id integer optional Required without town_name. Can be obtained from /towns/ endpoint.
collection_address.town_name string optional Required without town_id. Can be obtained from /towns/ endpoint.
collection_address.suburb_id integer optional Required without suburb_name. Can be obtained from /suburbs/ endpoint.
collection_address.suburb_name string optional Required without suburb_id. Can be obtained from /suburbs/ endpoint.
collection_address.company_name string optional The name of the company of the address. Max 50 characters.
collection_address.building string optional The building of the address. Max 50 characters.
collection_address.street_number string optional The number on the street of the address. Max 5 characters.
collection_address.street string optional optional Required if the collection_address is filled. The name of the street that the address is on. Max 50 characters.
collection_address.location_type integer optional Required without location_type_name. The id of the location type for the address. Can be obtained from /location_types/ endpoint.
collection_address.location_type_name string optional Required without location_type. The name of the location type for the address. Can be obtained from /location_types/ endpoint.
collection_address.contact object optional optional If you are creating a contact with the address, please ensure that it is a valid JSON object.
collection_address.contact.full_name string optional optional If you are creating a contact with the address, their full name. Required if any of cellphone, work_phone or email_address is present in the contact object. Min 2 characters, max 50 characters.
collection_address.contact.cellphone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and work_phone is not provided. Min 10 characters, max 20 characters.
collection_address.contact.work_phone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and cellphone is not provided. Min 10 characters, max 20 characters.
collection_address.contact.email_address string optional optional If you are creating a contact with the address, their full name. Useful for tracking updates to be sent to. Max 50 characters.
delivery_address.custom_id string optional The custom id you would like to assign to this address. Must be unique. Max 20 characters.
delivery_address.town_id integer optional Required without town_name. Can be obtained from /towns/ endpoint.
delivery_address.town_name string optional Required without town_id. Can be obtained from /towns/ endpoint.
delivery_address.suburb_id integer optional Required without suburb_name. Can be obtained from /suburbs/ endpoint.
delivery_address.suburb_name string optional Required without suburb_id. Can be obtained from /suburbs/ endpoint.
delivery_address.company_name string optional The name of the company of the address. Max 50 characters.
delivery_address.building string optional The building of the address. Max 50 characters.
delivery_address.street_number string optional The number on the street of the address. Max 5 characters.
delivery_address.street string optional optional Required if the delivery_address is filled. The name of the street that the address is on. Max 50 characters.
delivery_address.location_type integer optional Required without location_type_name. The id of the location type for the address. Can be obtained from /location_types/ endpoint.
delivery_address.location_type_name string optional Required without location_type. The name of the location type for the address. Can be obtained from /location_types/ endpoint.
delivery_address.contact object optional optional If you are creating a contact with the address, please ensure that it is a valid JSON object.
delivery_address.contact.full_name string optional optional If you are creating a contact with the address, their full name. Required if any of cellphone, work_phone or email_address is present in the contact object. Min 2 characters, max 50 characters.
delivery_address.contact.cellphone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and work_phone is not provided. Min 10 characters, max 20 characters.
delivery_address.contact.work_phone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and cellphone is not provided. Min 10 characters, max 20 characters.
delivery_address.contact.email_address string optional optional If you are creating a contact with the address, their full name. Useful for tracking updates to be sent to. Max 50 characters.

Show

This will return a waybill's information, optionally along with addresses, contacts, proofs of delivery as needed

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/waybill/4001907',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'query' => [
            'include'=> 'client,collection_address',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/waybill/4001907"
);

let params = {
    "include": "client,collection_address",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/waybill/4001907?include=client,collection_address" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "id": 4001907,
        "custom_id": "",
        "service_type_id": 2,
        "service_type_name": "Next Day",
        "collection_time": 1559127600,
        "customer_reference": "",
        "delivery_time": 1559224800,
        "parcel_count": 1,
        "special_instructions": "",
        "collection_address_id": 647187,
        "collection_contact_id": 671846,
        "delivery_address_id": 660058,
        "delivery_contact_id": 684889,
        "status_id": 6,
        "status_name": "Invoiced",
        "parcel_description": "",
        "weight": 0.4,
        "volumetric_weight": 0.6,
        "total_price": 100,
        "risk_cover": false,
        "parcels": [
            {
                "add_method": "client",
                "created_at": "2020-09-18 14:33:41",
                "custom_id": "",
                "height": "6.0",
                "id": 7699472,
                "waybill_id": 4001907,
                "length": "22.0",
                "parcel_number": 1,
                "quantity": 1,
                "volumetric_weight": "0.3",
                "weight": "5.2",
                "width": "10.0"
            }
        ],
        "client": {
            "id": 116,
            "name": "Test Collivery (Pty) Ltd",
            "landline_number": "011 241 4911",
            "mobile_number": null,
            "account_code": null,
            "account_type": "account"
        },
        "collection_address": {
            "id": 647187,
            "custom_id": null,
            "town_id": 147,
            "suburb_id": 1936,
            "text": "MDS Collivery, MDS House, 58c Webber St, Selby, Johannesburg",
            "short_text": "MDS Collivery, Selby, Johannesburg"
        }
    }
}

Example response (403):

{
    "error": {
        "http_code_text": "Forbidden",
        "http_code": 403,
        "message": "That waybill is not linked to your account."
    }
}

HTTP Request

GET v3/waybill/{waybill}

URL Parameters

Parameter Status Description
waybill required The waybill id.

Query Parameters

Parameter Status Description
include optional A comma separated list of relationships to return. Available entries: client, collection_address, delivery_address, collection_contact, delivery_contact, proofs_of_delivery.

Update

Allows you to update the waybill's service type.

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.collivery.co.za/v3/waybill/4001907',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'query' => [
            'include'=> 'client,collection_address',
        ],
        'json' => [
            'service' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/waybill/4001907"
);

let params = {
    "include": "client,collection_address",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "service": 3
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.collivery.co.za/v3/waybill/4001907?include=client,collection_address" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"service":3}'

Example response (200):

{
    "data": {
        "id": 4001907,
        "custom_id": "",
        "service_type_id": 3,
        "service_type_name": "Road Freight",
        "collection_time": 1559127600,
        "customer_reference": "",
        "delivery_time": 1559224800,
        "parcel_count": 1,
        "special_instructions": "",
        "collection_address_id": 647187,
        "collection_contact_id": 671846,
        "delivery_address_id": 660058,
        "delivery_contact_id": 684889,
        "status_id": 6,
        "status_name": "Invoiced",
        "parcel_description": "",
        "weight": 0.4,
        "volumetric_weight": 0.6,
        "total_price": 100,
        "risk_cover": false,
        "parcels": [
            {
                "add_method": "client",
                "created_at": "2020-09-18 14:33:41",
                "custom_id": "",
                "height": "6.0",
                "id": 7699472,
                "waybill_id": 4001907,
                "length": "22.0",
                "parcel_number": 1,
                "quantity": 1,
                "volumetric_weight": "0.3",
                "weight": "5.2",
                "width": "10.0"
            }
        ],
        "client": {
            "id": 116,
            "name": "Test Collivery (Pty) Ltd",
            "landline_number": "011 241 4911",
            "mobile_number": null,
            "account_code": null,
            "account_type": "account"
        },
        "collection_address": {
            "id": 647187,
            "custom_id": null,
            "town_id": 147,
            "suburb_id": 1936,
            "text": "MDS Collivery, MDS House, 58c Webber St, Selby, Johannesburg",
            "short_text": "MDS Collivery, Selby, Johannesburg"
        }
    }
}

Example response (401):

{
    "error": {
        "http_code_text": "Bad Request",
        "http_code": 401,
        "message": "Waybill # 4001907 has already started collection\/delivery process, cannot update."
    }
}

HTTP Request

PUT v3/waybill/{waybill}

PATCH v3/waybill/{waybill}

URL Parameters

Parameter Status Description
waybill required The waybill id.

Query Parameters

Parameter Status Description
include optional A comma separated list of relationships to return. Available entries: client, collection_address, delivery_address, collection_contact, delivery_contact, proofs_of_delivery.

Body Parameters

Parameter Type Status Description
service integer optional The new service you would like to deliver the waybill on.

6. Status Tracking

Fetch and query status updates for your waybills

Index

Show a list of status tracking records

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/status_tracking',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'query' => [
            'statuses'=> '1,3',
            'per_page'=> '3',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/status_tracking"
);

let params = {
    "statuses": "1,3",
    "per_page": "3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/status_tracking?statuses=1,3&per_page=3" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "status_id": 1,
            "status_name": "Waiting Client Acceptance",
            "waybill_id": 4105972,
            "created_at": "2019-08-12 06:02"
        },
        {
            "status_id": 3,
            "status_name": "Quote Accepted",
            "waybill_id": 4105972,
            "created_at": "2019-08-12 06:02"
        },
        {
            "status_id": 1,
            "status_name": "Waiting Client Acceptance",
            "waybill_id": 4105999,
            "created_at": "2019-08-12 06:03"
        }
    ],
    "links": {
        "first": "http:\/\/api.collivery.local\/v3\/status_tracking?page=1",
        "last": "http:\/\/api.collivery.local\/v3\/status_tracking?page=33",
        "prev": null,
        "next": "http:\/\/api.collivery.local\/v3\/status_tracking?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 33,
        "path": "http:\/\/api.collivery.local\/v3\/status_tracking",
        "per_page": "3",
        "to": 3,
        "total": 98
    }
}

HTTP Request

GET v3/status_tracking

Query Parameters

Parameter Status Description
statuses optional optional A comma-separated list of statuses to limit the results to. Defaults to all statuses.
per_page optional optional The limit per page. If this option is provided, links and meta will exist in the response with further information about the full list of addresses. 0 is the same as not limiting. Default is 100.
start_date optional optional Any valid time representation that can be parsed by PHP strtotime(). Defaults to a week ago.
end_date optional optional.

Show

Display all status tracking for a specific waybill

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/status_tracking/4001907',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/status_tracking/4001907"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/status_tracking/4001907" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "status_id": 1,
            "status_name": "Waiting Client Acceptance",
            "waybill_id": 4001907,
            "created_at": "2019-05-29 12:13"
        },
        {
            "status_id": 3,
            "status_name": "Quote Accepted",
            "waybill_id": 4001907,
            "created_at": "2019-05-29 12:13"
        },
        {
            "status_id": 10,
            "status_name": "Collection Driver Dispatched",
            "waybill_id": 4001907,
            "created_at": "2019-05-29 12:14"
        },
        {
            "status_id": 5,
            "status_name": "Collivery Cancelled",
            "waybill_id": 4001907,
            "created_at": "2019-05-29 20:41"
        }
    ]
}

HTTP Request

GET v3/status_tracking/{waybill}

URL Parameters

Parameter Status Description
waybill optional number required The waybill id.

Update

Accept or Cancel a waybill

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.collivery.co.za/v3/status_tracking/4001907',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'status_id' => 3.0,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/status_tracking/4001907"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "status_id": 3
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.collivery.co.za/v3/status_tracking/4001907" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"status_id":3}'

Example response (200):

{
    "data": {
        "message": "Waybill 4001907 updated to Quote Accepted"
    }
}

Example response (400):

null

Example response (400):

{
    "error": {
        "http_code_text": "Bad Request",
        "http_code": 400,
        "message": "Waybill # 4001907 has already started collection\/delivery process, cannot cancel."
    }
}

HTTP Request

PUT v3/status_tracking/{waybill}

PATCH v3/status_tracking/{waybill}

URL Parameters

Parameter Status Description
waybill optional number required The waybill id.

Body Parameters

Parameter Type Status Description
status_id number required The id of the status you want to update to. Must be 3 (Quote Accepted) or 5 (Cancelled).

7. Waybill Documents

Get your Quote or Waybill documents

Index

List your waybill documents

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/waybill_documents/4001907',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/waybill_documents/4001907"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/waybill_documents/4001907" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "type": "waybill",
            "file_name": "4001907-waybill.pdf",
            "pages": 1,
            "mime": "application\/pdf",
            "size": 35907,
            "created_at": "2021-07-23 11:19:14",
            "image_url": "https:\/\/api.collivery.co.za\/v3\/waybill_documents\/4001907\/waybill"
        },
        {
            "type": "quote",
            "file_name": "4001907-quote.pdf",
            "pages": 1,
            "mime": "application\/pdf",
            "size": 27136,
            "created_at": "2021-07-23 11:19:14",
            "image_url": "https:\/\/api.collivery.co.za\/v3\/waybill_documents\/4001907\/quote"
        }
    ]
}

HTTP Request

GET v3/waybill_documents/{waybill}

URL Parameters

Parameter Status Description
waybill optional number required The waybill id you are requesting documents for.

Show

Get the details and base64 encoded image of the waybill document

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/waybill_documents/4001907/waybill',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/waybill_documents/4001907/waybill"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/waybill_documents/4001907/waybill" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "id": 4001907,
        "type": "waybill",
        "file_name": "4001907.pdf",
        "pages": 1,
        "mime": "application\/pdf",
        "size": 2605,
        "created_at": "2019-05-29 18:41:11",
        "image": "JVBERi0xLjMgCjEgMCBvYmoKPDwKL1BhZ2VzIDIgMCBSCi9UeXBlIC9DYXRhbG9nCj4+CmVuZG9iagoyIDAgb2JqCjw8Ci9UeXBlIC9QYWdlcwovS2lkcyBbIDMgMCBSIF0KL0NvdW50IDEKPj4KZW5kb2JqCjMgMCBvYmoKPDwKL1R5cGUgL1BhZ2UKL1BhcmVudCAyIDAgUgovUmVzb3VyY2VzIDw8Ci9YT2JqZWN0IDw8IC9JbTAgOCAwIFIgPj4KL1Byb2NTZXQgNiAwIFIgPj4KL01lZGlhQm94IFswIDAgMSAxXQovQ3JvcEJveCBbMCAwIDEgMV0KL0NvbnRlbnRzIDQgMCBSCi9UaHVtYiAxMSAwIFIKPj4KZW5kb2JqCjQgMCBvYmoKPDwKL0xlbmd0aCA1IDAgUgo+PgpzdHJlYW0KcQoxIDAgMCAxIDAgMCBjbQovSW0wIERvClEKCmVuZHN0cmVhbQplbmRvYmoKNSAwIG9iagoyNwplbmRvYmoKNiAwIG9iagpbIC9QREYgL1RleHQgL0ltYWdlQyBdCmVuZG9iago3IDAgb2JqCjw8Cj4+CmVuZG9iago4IDAgb2JqCjw8Ci9UeXBlIC9YT2JqZWN0Ci9TdWJ0eXBlIC9JbWFnZQovTmFtZSAvSW0wCi9GaWx0ZXIgWyAvRENURGVjb2RlIF0KL1dpZHRoIDEKL0hlaWdodCAxCi9Db2xvclNwYWNlIDEwIDAgUgovQml0c1BlckNvbXBvbmVudCA4Ci9MZW5ndGggOSAwIFIKPj4Kc3RyZWFtCv\/Y\/+AAEEpGSUYAAQEAAAEAAQAA\/9sAQwAMCAkKCQcMCgoKDQ0MDhIeExIQEBIkGhsVHismLSwqJikpLzVEOi8yQDMpKTtRPEBGSUxNTC45VFpTSllES0xJ\/8AACwgAAQABAQERAP\/EABQAAQAAAAAAAAAAAAAAAAAAAAf\/xAAUEAEAAAAAAAAAAAAAAAAAAAAA\/9oACAEBAAA\/AFV\/\/9kKZW5kc3RyZWFtCmVuZG9iago5IDAgb2JqCjE2MAplbmRvYmoKMTAgMCBvYmoKL0RldmljZUdyYXkKZW5kb2JqCjExIDAgb2JqCjw8Ci9GaWx0ZXIgWyAvRENURGVjb2RlIF0KL1dpZHRoIDEKL0hlaWdodCAxCi9Db2xvclNwYWNlIDEwIDAgUgovQml0c1BlckNvbXBvbmVudCA4Ci9MZW5ndGggMTIgMCBSCj4+CnN0cmVhbQr\/2P\/gABBKRklGAAEBAAABAAEAAP\/bAEMADAgJCgkHDAoKCg0NDA4SHhMSEBASJBobFR4rJi0sKiYpKS81RDovMkAzKSk7UTxARklMTUwuOVRaU0pZREtMSf\/AAAsIAAEAAQEBEQD\/xAAUAAEAAAAAAAAAAAAAAAAAAAAH\/8QAFBABAAAAAAAAAAAAAAAAAAAAAP\/aAAgBAQAAPwBVf\/\/ZCmVuZHN0cmVhbQplbmRvYmoKMTIgMCBvYmoKMTYwCmVuZG9iagoxMyAwIG9iago8PAo+PgplbmRvYmoKMTQgMCBvYmoKMTYwCmVuZG9iagoxNSAwIG9iago8PAo+PgplbmRvYmoKMTYgMCBvYmoKMTYwCmVuZG9iagoxNyAwIG9iago8PAovVGl0bGUgPEZFRkYwMDYxMDAwMD4KL0NyZWF0aW9uRGF0ZSAoRDoyMDE5MDkxMTA2MjMxMykKL01vZERhdGUgKEQ6MjAxOTA5MTEwNjIzMTMpCi9Qcm9kdWNlciAoaHR0cHM6Ly9pbWFnZW1hZ2ljay5vcmcpCj4+CmVuZG9iagp4cmVmCjAgMTgKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDEwIDAwMDAwIG4gCjAwMDAwMDAwNTkgMDAwMDAgbiAKMDAwMDAwMDExOCAwMDAwMCBuIAowMDAwMDAwMjkyIDAwMDAwIG4gCjAwMDAwMDAzNzIgMDAwMDAgbiAKMDAwMDAwMDM5MCAwMDAwMCBuIAowMDAwMDAwNDI4IDAwMDAwIG4gCjAwMDAwMDA0NDkgMDAwMDAgbiAKMDAwMDAwMDc4NSAwMDAwMCBuIAowMDAwMDAwODA0IDAwMDAwIG4gCjAwMDAwMDA4MzIgMDAwMDAgbiAKMDAwMDAwMTEyOCAwMDAwMCBuIAowMDAwMDAxMTQ4IDAwMDAwIG4gCjAwMDAwMDExNzAgMDAwMDAgbiAKMDAwMDAwMTE5MCAwMDAwMCBuIAowMDAwMDAxMjEyIDAwMDAwIG4gCjAwMDAwMDEyMzIgMDAwMDAgbiAKdHJhaWxlcgo8PAovU2l6ZSAxOAovSW5mbyAxNyAwIFIKL1Jvb3QgMSAwIFIKL0lEIFs8ZTAwZTVlYjk0NDQxODJmMzUyMzIzMzc0ZWY0ZTA4ZWJjYjc4NDcyNWZkZDRmZDYxMmQ3NzMwNTQwYjNlMGM4Yz4gPGUwMGU1ZWI5NDQ0MTgyZjM1MjMyMzM3NGVmNGUwOGViY2I3ODQ3MjVmZGQ0ZmQ2MTJkNzczMDU0MGIzZTBjOGM+XQo+PgpzdGFydHhyZWYKMTM3MwolJUVPRgo"
    }
}

HTTP Request

GET v3/waybill_documents/{waybill}/{type}

URL Parameters

Parameter Status Description
waybill optional number required The waybill id you are requesting documents for.
type optional string required The type of document, 'waybill' or 'quote'.

8. Proofs of Delivery

Index

List your waybill proofs of delivery

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/proofs_of_delivery',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'query' => [
            'per_page'=> '3',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/proofs_of_delivery"
);

let params = {
    "per_page": "3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/proofs_of_delivery?per_page=3" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "id": 170452,
            "type": "POD",
            "file_name": "342118.pdf",
            "pages": 1,
            "mime": "application\/pdf",
            "size": 48971,
            "created_at": "2010-09-27 11:15:03",
            "image_url": "https:\/\/api.collivery.co.za\/v3\/proofs_of_delivery\/170452"
        },
        {
            "id": 182535,
            "type": "POD",
            "file_name": "356551.pdf",
            "pages": 1,
            "mime": "application\/pdf",
            "size": 112152,
            "created_at": "2010-10-20 14:16:18",
            "image_url": "https:\/\/api.collivery.co.za\/v3\/proofs_of_delivery\/182535"
        },
        {
            "id": 211515,
            "type": "POD",
            "file_name": "390109.pdf",
            "pages": 1,
            "mime": "application\/pdf",
            "size": 57001,
            "created_at": "2010-12-08 10:23:25",
            "image_url": "https:\/\/api.collivery.co.za\/v3\/proofs_of_delivery\/211515"
        }
    ],
    "links": {
        "first": "http:\/\/api.collivery.co.za\/v3\/proofs_of_delivery?page=1",
        "last": "http:\/\/api.collivery.co.za\/v3\/proofs_of_delivery?page=9",
        "prev": null,
        "next": "http:\/\/api.collivery.co.za\/v3\/proofs_of_delivery?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 9,
        "path": "http:\/\/api.collivery.co.za\/v3\/proofs_of_delivery",
        "per_page": 3,
        "to": 3,
        "total": 26
    }
}

HTTP Request

GET v3/proofs_of_delivery

Query Parameters

Parameter Status Description
per_page optional The limit per page. If this option is provided, links and meta will exist in the response with further information about the full list of addresses. 0 is the same as not limiting. Default is 100.
waybill_id optional Limit to results with this waybill.

Show

Get the details and base64 encoded image of the waybill proof of delivery

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/proofs_of_delivery/211515',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/proofs_of_delivery/211515"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/proofs_of_delivery/211515" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "id": 211515,
        "type": "",
        "file_name": "4001907_POD.pdf",
        "pages": 1,
        "mime": "application\/pdf",
        "size": 2605,
        "created_at": "2019-05-29 18:41:11",
        "image_url": "https:\/\/api.collivery.co.za\/v3\/proofs_of_delivery\/211515",
        "image": "JVBERi0xLjMgCjEgMCBvYmoKPDwKL1BhZ2VzIDIgMCBSCi9UeXBlIC9DYXRhbG9nCj4+CmVuZG9iagoyIDAgb2JqCjw8Ci9UeXBlIC9QYWdlcwovS2lkcyBbIDMgMCBSIF0KL0NvdW50IDEKPj4KZW5kb2JqCjMgMCBvYmoKPDwKL1R5cGUgL1BhZ2UKL1BhcmVudCAyIDAgUgovUmVzb3VyY2VzIDw8Ci9YT2JqZWN0IDw8IC9JbTAgOCAwIFIgPj4KL1Byb2NTZXQgNiAwIFIgPj4KL01lZGlhQm94IFswIDAgMSAxXQovQ3JvcEJveCBbMCAwIDEgMV0KL0NvbnRlbnRzIDQgMCBSCi9UaHVtYiAxMSAwIFIKPj4KZW5kb2JqCjQgMCBvYmoKPDwKL0xlbmd0aCA1IDAgUgo+PgpzdHJlYW0KcQoxIDAgMCAxIDAgMCBjbQovSW0wIERvClEKCmVuZHN0cmVhbQplbmRvYmoKNSAwIG9iagoyNwplbmRvYmoKNiAwIG9iagpbIC9QREYgL1RleHQgL0ltYWdlQyBdCmVuZG9iago3IDAgb2JqCjw8Cj4+CmVuZG9iago4IDAgb2JqCjw8Ci9UeXBlIC9YT2JqZWN0Ci9TdWJ0eXBlIC9JbWFnZQovTmFtZSAvSW0wCi9GaWx0ZXIgWyAvRENURGVjb2RlIF0KL1dpZHRoIDEKL0hlaWdodCAxCi9Db2xvclNwYWNlIDEwIDAgUgovQml0c1BlckNvbXBvbmVudCA4Ci9MZW5ndGggOSAwIFIKPj4Kc3RyZWFtCv\/Y\/+AAEEpGSUYAAQEAAAEAAQAA\/9sAQwAMCAkKCQcMCgoKDQ0MDhIeExIQEBIkGhsVHismLSwqJikpLzVEOi8yQDMpKTtRPEBGSUxNTC45VFpTSllES0xJ\/8AACwgAAQABAQERAP\/EABQAAQAAAAAAAAAAAAAAAAAAAAf\/xAAUEAEAAAAAAAAAAAAAAAAAAAAA\/9oACAEBAAA\/AFV\/\/9kKZW5kc3RyZWFtCmVuZG9iago5IDAgb2JqCjE2MAplbmRvYmoKMTAgMCBvYmoKL0RldmljZUdyYXkKZW5kb2JqCjExIDAgb2JqCjw8Ci9GaWx0ZXIgWyAvRENURGVjb2RlIF0KL1dpZHRoIDEKL0hlaWdodCAxCi9Db2xvclNwYWNlIDEwIDAgUgovQml0c1BlckNvbXBvbmVudCA4Ci9MZW5ndGggMTIgMCBSCj4+CnN0cmVhbQr\/2P\/gABBKRklGAAEBAAABAAEAAP\/bAEMADAgJCgkHDAoKCg0NDA4SHhMSEBASJBobFR4rJi0sKiYpKS81RDovMkAzKSk7UTxARklMTUwuOVRaU0pZREtMSf\/AAAsIAAEAAQEBEQD\/xAAUAAEAAAAAAAAAAAAAAAAAAAAH\/8QAFBABAAAAAAAAAAAAAAAAAAAAAP\/aAAgBAQAAPwBVf\/\/ZCmVuZHN0cmVhbQplbmRvYmoKMTIgMCBvYmoKMTYwCmVuZG9iagoxMyAwIG9iago8PAo+PgplbmRvYmoKMTQgMCBvYmoKMTYwCmVuZG9iagoxNSAwIG9iago8PAo+PgplbmRvYmoKMTYgMCBvYmoKMTYwCmVuZG9iagoxNyAwIG9iago8PAovVGl0bGUgPEZFRkYwMDYxMDAwMD4KL0NyZWF0aW9uRGF0ZSAoRDoyMDE5MDkxMTA2MjMxMykKL01vZERhdGUgKEQ6MjAxOTA5MTEwNjIzMTMpCi9Qcm9kdWNlciAoaHR0cHM6Ly9pbWFnZW1hZ2ljay5vcmcpCj4+CmVuZG9iagp4cmVmCjAgMTgKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDEwIDAwMDAwIG4gCjAwMDAwMDAwNTkgMDAwMDAgbiAKMDAwMDAwMDExOCAwMDAwMCBuIAowMDAwMDAwMjkyIDAwMDAwIG4gCjAwMDAwMDAzNzIgMDAwMDAgbiAKMDAwMDAwMDM5MCAwMDAwMCBuIAowMDAwMDAwNDI4IDAwMDAwIG4gCjAwMDAwMDA0NDkgMDAwMDAgbiAKMDAwMDAwMDc4NSAwMDAwMCBuIAowMDAwMDAwODA0IDAwMDAwIG4gCjAwMDAwMDA4MzIgMDAwMDAgbiAKMDAwMDAwMTEyOCAwMDAwMCBuIAowMDAwMDAxMTQ4IDAwMDAwIG4gCjAwMDAwMDExNzAgMDAwMDAgbiAKMDAwMDAwMTE5MCAwMDAwMCBuIAowMDAwMDAxMjEyIDAwMDAwIG4gCjAwMDAwMDEyMzIgMDAwMDAgbiAKdHJhaWxlcgo8PAovU2l6ZSAxOAovSW5mbyAxNyAwIFIKL1Jvb3QgMSAwIFIKL0lEIFs8ZTAwZTVlYjk0NDQxODJmMzUyMzIzMzc0ZWY0ZTA4ZWJjYjc4NDcyNWZkZDRmZDYxMmQ3NzMwNTQwYjNlMGM4Yz4gPGUwMGU1ZWI5NDQ0MTgyZjM1MjMyMzM3NGVmNGUwOGViY2I3ODQ3MjVmZGQ0ZmQ2MTJkNzczMDU0MGIzZTBjOGM+XQo+PgpzdGFydHhyZWYKMTM3MwolJUVPRgo"
    }
}

HTTP Request

GET v3/proofs_of_delivery/{proofs_of_delivery}

URL Parameters

Parameter Status Description
proofs_of_delivery optional number required The proof of delivery id.

9. Parcel Images

Index

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/parcel_images',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'query' => [
            'per_page'=> '3',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/parcel_images"
);

let params = {
    "per_page": "3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/parcel_images?per_page=3" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "id": 2681479,
            "waybill_id": 3012330,
            "parcel_number": 1,
            "file_name": "3012330-1.jpeg",
            "mime_type": "image\/jpeg",
            "size": 26287,
            "created_at": "2017-07-17 13:06:57",
            "image_url": "https:\/\/api.collivery.co.za\/v3\/parcel_images\/2681479"
        },
        {
            "id": 2694043,
            "waybill_id": 3041631,
            "parcel_number": 1,
            "file_name": "3041631-1.jpeg",
            "mime_type": "image\/jpeg",
            "size": 32399,
            "created_at": "2017-07-25 14:37:50",
            "image_url": "https:\/\/api.collivery.co.za\/v3\/parcel_images\/2694043"
        },
        {
            "id": 2694087,
            "waybill_id": 3041631,
            "parcel_number": 2,
            "file_name": "3041631-2.jpeg",
            "mime_type": "image\/jpeg",
            "size": 34726,
            "created_at": "2017-07-25 14:52:37",
            "image_url": "https:\/\/api.collivery.co.za\/v3\/parcel_images\/2694087"
        }
    ],
    "links": {
        "first": "https:\/\/api.collivery.co.za\/v3\/parcel_images?page=1",
        "last": "https:\/\/api.collivery.co.za\/v3\/parcel_images?page=2",
        "next": "https:\/\/api.collivery.co.za\/v3\/parcel_images?page=2",
        "prev": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 2,
        "path": "https:\/\/api.collivery.co.za\/v3\/parcel_images",
        "per_page": "3",
        "to": 3,
        "total": 6
    }
}

HTTP Request

GET v3/parcel_images

Query Parameters

Parameter Status Description
per_page optional The limit per page. If this option is provided, links and meta will exist in the response with further information about the full list of addresses. 0 is the same as not limiting. Default is 100.
waybill_id optional A waybill id that you would like to limit the parcel images to.

Show

Get the base64 encoded image

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/parcel_images/3041631',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/parcel_images/3041631"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/parcel_images/3041631" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "file_name": "3041631-1.jpeg",
        "mime_type": "image\/jpeg",
        "image": "\/9j\/4AAQSkZJRgABAQAAAQABAAD\/2wCEAAUFBQUFBQUGBgUICAcICAsKCQkKCxEMDQwNDBEaEBMQEBMQGhcbFhUWGxcpIBwcICkvJyUnLzkzMzlHREddXX0BBQUFBQUFBQYGBQgIBwgICwoJCQoLEQwNDA0MERoQExAQExAaFxsWFRYbFykgHBwgKS8nJScvOTMzOUdER11dff\/CABEIAAEAAQMBIgACEQEDEQH\/xAAUAAEAAAAAAAAAAAAAAAAAAAAI\/9oACAEBAAAAAGX\/AP\/EABQBAQAAAAAAAAAAAAAAAAAAAAD\/2gAIAQIQAAAAf\/\/EABQBAQAAAAAAAAAAAAAAAAAAAAD\/2gAIAQMQAAAAf\/\/EABQQAQAAAAAAAAAAAAAAAAAAAAD\/2gAIAQEAAT8Af\/\/EABQRAQAAAAAAAAAAAAAAAAAAAAD\/2gAIAQIBAT8Af\/\/EABQRAQAAAAAAAAAAAAAAAAAAAAD\/2gAIAQMBAT8Af\/\/Z"
    }
}

HTTP Request

GET v3/parcel_images/{parcel_image}

URL Parameters

Parameter Status Description
parcel_image optional number required The parcel image id.

10. Towns

Show and search for Towns

Index

Show all towns for a country or search towns.

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/towns',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'query' => [
            'per_page'=> '3',
            'search'=> 'Joh',
            'province'=> 'Gauteng',
            'country'=> 'ZAF',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/towns"
);

let params = {
    "per_page": "3",
    "search": "Joh",
    "province": "Gauteng",
    "country": "ZAF",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/towns?per_page=3&search=Joh&province=Gauteng&country=ZAF" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "id": 147,
            "name": "Johannesburg",
            "province": "GAU",
            "latitude": -26.204103,
            "longitude": 28.047305
        }
    ],
    "links": {
        "first": "http:\/\/api.collivery.co.za\/v3\/towns?page=1",
        "last": "http:\/\/api.collivery.co.za\/v3\/towns?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http:\/\/api.collivery.co.za\/v3\/towns",
        "per_page": 3,
        "to": 1,
        "total": 1
    }
}

HTTP Request

GET v3/towns

Query Parameters

Parameter Status Description
per_page optional The limit per page. If this option is provided, links and meta will exist in the response with further information about the full list of addresses.0 is the same as not limiting. Default is 300.
search optional Search by town name.
province optional Filter by province name.
country optional The three letter abbreviation (ISO 3166) for the country. Defaults to ZAF.

11. Suburbs

Show and filter suburbs

Index

Show all suburbs for a town or country or search suburbs.

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/suburbs',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'query' => [
            'per_page'=> '3',
            'latitude'=> '-26.212500',
            'longitude'=> '28.037500',
            'town_id'=> '147',
            'country'=> 'ZAF',
            'postal_code'=> '2000',
            'postal_code_range'=> '100',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/suburbs"
);

let params = {
    "per_page": "3",
    "latitude": "-26.212500",
    "longitude": "28.037500",
    "town_id": "147",
    "country": "ZAF",
    "postal_code": "2000",
    "postal_code_range": "100",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/suburbs?per_page=3&latitude=-26.212500&longitude=28.037500&town_id=147&country=ZAF&postal_code=2000&postal_code_range=100" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "id": 1936,
            "name": "Selby",
            "latitude": -26.2125,
            "longitude": 28.0375,
            "town": {
                "id": 147,
                "name": "Johannesburg",
                "province": "GAU",
                "latitude": -26.204103,
                "longitude": 28.047305
            },
            "postal_code": "2001",
            "box_postal_code": null
        },
        {
            "id": 1458,
            "name": "New Centre",
            "latitude": -26.2125,
            "longitude": 28.045799,
            "town": {
                "id": 147,
                "name": "Johannesburg",
                "province": "GAU",
                "latitude": -26.204103,
                "longitude": 28.047305
            },
            "postal_code": "2001",
            "box_postal_code": null
        },
        {
            "id": 339,
            "name": "City West",
            "latitude": -26.2125,
            "longitude": 28.0292,
            "town": {
                "id": 147,
                "name": "Johannesburg",
                "province": "GAU",
                "latitude": -26.204103,
                "longitude": 28.047305
            },
            "postal_code": "2092",
            "box_postal_code": null
        }
    ],
    "links": {
        "first": "http:\/\/api.collivery.co.za\/v3\/suburbs?page=1",
        "last": null,
        "prev": null,
        "next": "http:\/\/api.collivery.co.za\/v3\/suburbs?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "http:\/\/api.collivery.co.za\/v3\/suburbs",
        "per_page": 3,
        "to": 3
    }
}

HTTP Request

GET v3/suburbs

Query Parameters

Parameter Status Description
per_page optional The limit per page. If this option is provided, links and meta will exist in the response with further information about the full list of addresses. 0 is the same as not limiting. Defaults is 2000.
search optional Search by suburb name.
latitude optional A latitude to match a closest suburb against. Required if longitude is provided.
longitude optional A longitude to match a closest suburb against. Required if latitude is provided.
town_id optional Required without country. Can be obtained from /towns/ endpoint.
country optional Required without town_id. The three letter abbreviation (ISO 3166) for the country. Defaults to ZAF.
postal_code optional A postal code to limit the result set to.
postal_code_range optional The range within which to match the postal codes. For example the 2000 with a range of 100 matches postal codes 1900 to 2100. Defaults to 0 (ie. exact postal code match)
postal_code_type optional The type of postal code to limit matches to. street or box are allowed. Defaults to a match on either.

Show

Show details of one particular suburb. Loaded with Town details included

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/suburbs/1936',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/suburbs/1936"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/suburbs/1936" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "id": 1936,
        "name": "Selby",
        "latitude": -26.2125,
        "longitude": 28.0375,
        "town": {
            "id": 147,
            "name": "Johannesburg",
            "province": "GAU",
            "latitude": -26.204103,
            "longitude": 28.047305
        },
        "postal_code": "2001",
        "box_postal_code": null
    }
}

HTTP Request

GET v3/suburbs/{suburb}

URL Parameters

Parameter Status Description
suburb optional number required The suburb id.

Search

Search for suburbs and/or town

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/town_suburb_search',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'query' => [
            'search_text'=> 'westcli',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/town_suburb_search"
);

let params = {
    "search_text": "westcli",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/town_suburb_search?search_text=westcli" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "formatted_result": "Westcliff, Johannesburg, GAU",
            "suburb": {
                "id": 2336,
                "name": "Westcliff",
                "latitude": -26.170799,
                "longitude": 28.0292,
                "town": {
                    "id": 147,
                    "name": "Johannesburg",
                    "province": "GAU",
                    "latitude": -26.204103,
                    "longitude": 28.047305
                },
                "postal_code": "2193",
                "box_postal_code": "2193"
            }
        },
        {
            "formatted_result": "Westcliff, Durban, KZN",
            "suburb": {
                "id": 3721,
                "name": "Westcliff",
                "latitude": -29.9125,
                "longitude": 30.887501,
                "town": {
                    "id": 83,
                    "name": "Durban",
                    "province": "KZN",
                    "latitude": -29.85868,
                    "longitude": 31.02184
                },
                "postal_code": "7200",
                "box_postal_code": "7200"
            }
        }
    ]
}

HTTP Request

GET v3/town_suburb_search

Query Parameters

Parameter Status Description
search_text required The search text to use. Min 3 characters.

12. Service Types

Show all service types or searched

Index

Get available service types with delivery days

Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/service_types',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/service_types"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/service_types" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "id": 1,
            "code": "SDX",
            "text": "Same Day",
            "description": "Will be delivered same day at times specified",
            "delivery_days": 0
        },
        {
            "id": 2,
            "code": "ONX",
            "text": "Next Day",
            "description": "Will be delivered next day at times specified",
            "delivery_days": 1
        },
        {
            "id": 5,
            "code": "ECO",
            "text": "Road Freight Express",
            "description": "Will be delivered within 2 working days",
            "delivery_days": 2
        },
        {
            "id": 3,
            "code": "FRT",
            "text": "Road Freight",
            "description": "For heavy cargo. Delivery within 3 working days",
            "delivery_days": 3
        }
    ]
}

HTTP Request

GET v3/service_types

Show

Get specific service type by id

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/service_type/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/service_type/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/service_type/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "id": 1,
        "code": "SDX",
        "text": "Same Day",
        "description": "Will be delivered same day at times specified",
        "delivery_days": 0
    }
}

HTTP Request

GET v3/service_type/{id}

13. Location Types

Index

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/location_types',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'query' => [
            'search'=> 'business',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/location_types"
);

let params = {
    "search": "business",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/location_types?search=business" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "id": 1,
            "name": "Business Premises",
            "surcharge": false,
            "surcharge_amount": 0
        }
    ]
}

HTTP Request

GET v3/location_types

Query Parameters

Parameter Status Description
search optional An optional search string matched against the location types names.
surcharge_only optional {include, exclude} include will return only surchargeable location types, exclude will return only non-surchargeable location types.

14. Terms and Conditions

Index

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/terms_and_conditions',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/terms_and_conditions"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/terms_and_conditions" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": {
        "Definitions": [
            {
                "key": 1,
                "value": "“MDS” shall mean MDS Collivery (Pty) Ltd, its staff, agents or sub-contractors."
            },
            {
                "key": 2,
                "value": "“Goods” shall mean any documents, parcels or freight accepted for carriage by MDS."
            },
            {
                "key": 3,
                "value": "“Carriage” shall mean the transport of goods from one point to another by MDS (the “Carrier”) using means it deems suitable."
            },
            {
                "key": 4,
                "value": "“Client” shall mean the party responsible for the payment for the carriage of the goods."
            },
            {
                "key": 5,
                "value": "“Owner” shall mean the party who has a financial interest in the goods."
            },
            {
                "key": 6,
                "value": "“Parties” shall mean the Client, the Owner, the sender, the receiver or the Carrier, as the context may require."
            },
            {
                "key": 7,
                "value": "“Waybill” is the accompanying document which identifies the Client, the number and weight of packages involved and instructions regarding the time and place of both the collection and delivery, copies of which are signed by the parties and serve as proof of handover of the goods from one party to the other."
            }
        ],
        "Terms and Conditions": [
            {
                "key": 1,
                "value": "MDS is not a public\/common carrier and may refuse to accept any goods for carriage without providing reason for such refusal."
            },
            {
                "key": 2,
                "value": "By using our collection and delivery service you agree to be bound by our terms and conditions, as set out in this document, and you acknowledge that our terms and conditions will constitute a valid, binding and enforceable agreement."
            },
            {
                "key": 3,
                "value": "These terms & conditions shall apply to all transactions concluded by or on the Client's behalf on our website. (www.collivery.co.za or collivery.net)."
            },
            {
                "key": 4,
                "value": "A certificate issued by an administrator of our website shall constitute prima facie proof of any fact related to our website, including (but not limited to) which version of the terms and conditions that govern a particular dispute and the content that was published or functionality was available on our website at a specific point in time."
            },
            {
                "key": 5,
                "value": "For purposes of Section 22(2) of the Electronic Communications and Transactions Act, 25 of 2002 you accept that the agreement will be regarded as concluded at Randburg, Gauteng Province."
            },
            {
                "key": 6,
                "value": "All matters arising from this agreement, its validity, existence or termination shall be determined in accordance with the laws of the time of the Republic of South Africa, and you hereby submit to the jurisdiction of the Magistrates' Court of Johannesburg\/Randburg."
            },
            {
                "key": 7,
                "value": "MDS' prices are set out in its price list or are as negotiated or quoted to the Client and are subject to review from time to time."
            },
            {
                "key": 8,
                "value": "Prices quoted are based on the information provided by the Client. Should this information be found to be incorrect, MDS has the right to adjust the prices based on the correct information while continuing with the carriage."
            },
            {
                "key": 9,
                "value": "Any credit limit, invoice frequency, or payment terms set by MDS shall be at its sole and absolute discretion and may be changed by MDS depending on circumstances that MDS believes justifies such changes."
            },
            {
                "key": "The Customer Acknowledges That",
                "value": [
                    {
                        "key": 1,
                        "value": "In terms of the Disaster Management Act 57 of 2002 (\"the Act\") and the current Alert Level Regulations thereof (\"the Regulations\"), MDS Collivery can only deliver the goods to the Customer in relation to goods and services as defined in the Regulations (\"the allowed purpose\")"
                    },
                    {
                        "key": 2,
                        "value": "MDS Collivery is delivering the goods to the Customer on the strict understanding the goods are purchased and will be used and\/or on-sold by the Customer for the allowed purpose.  The Customer indemnifies and holds(MDS Collivery, its affiliates and their respective personnel harmless from and against any liability and losses arising from or in connection with the Customer's failure to purchase the goods in accordance with the provisions of the Act and the Regulations."
                    }
                ]
            }
        ],
        "Liability": [
            {
                "key": "MDS' liability to the Client in respect of goods in its care:",
                "value": [
                    {
                        "key": 1,
                        "value": "Will terminate once proof of delivery has been obtained from the receiving party at the address stated on the waybill."
                    },
                    {
                        "key": 2,
                        "value": "Shall be limited to an amount of R1 000.00 (One Thousand Rand)."
                    },
                    {
                        "key": 3,
                        "value": "Shall exclude indirect and consequential damages."
                    },
                    {
                        "key": 4,
                        "value": "Where MDS has agreed to accept the additional risk of carriage, such risk shall not exceed an amount of R10 000.00 (Ten thousand Rand) relating to any one waybill. This risk relates to the loss of goods, and does not cover damage resulting from inadequate packaging of the items by you or your agents. This acceptance of risk relates exclusively to the direct cost of replacement of goods, and shall in no way cover any indirect or consequential losses."
                    }
                ]
            },
            {
                "key": 2,
                "value": "Any claim for loss or damage should be lodged within 7 days of loss by completing the on-line claim form on the customer interface. Any claim lodged after such date will not be considered."
            },
            {
                "key": 3,
                "value": "Failure to supply necessary documents requested to support the claim will result in the claim not being considered."
            },
            {
                "key": 4,
                "value": "Valid Claims will only be paid by MDS in respect of any consignment after the Client has paid all outstanding Freight Charges in respect of that consignment and where the Client’s account with MDS has been paid in accordance with the credit terms extended."
            },
            {
                "key": 5,
                "value": "Freight charges relating to the consignment covered by the Risk Cover shall not be included in the calculation of any amount payable under the risk cover offered by MDS."
            },
            {
                "key": 6,
                "value": "Where a claim has been paid in full for goods damaged, MDS reserves the right to take possession of the goods as salvage and to dispose of such goods as it sees fit."
            },
            {
                "key": 7,
                "value": "MDS shall not be liable for failure to fulfil its obligations if such failure is due to war, civil disobedience, industrial dispute, acts of God, or any event beyond MDS' reasonable control."
            },
            {
                "key": 8,
                "value": "If MDS is unable for any reason to effect delivery of the goods, all reasonable steps will be taken to return the goods to the Client. The Client will, however, be responsible for the costs of carriage, attempted delivery and return of the goods. Any failure to deliver or any late deliveries may not be used as motivation for non-payment for that delivery."
            },
            {
                "key": 9,
                "value": "MDS will not be responsible for any fulfilment of Customs formalities or payments. However, MDS will assist the Client as far as possible, on condition that such assistance will be rendered at the sole risk and responsibility of the Client and the Client undertakes to indemnify MDS against any claims in this respect."
            },
            {
                "key": "The Client warrants that:",
                "value": [
                    {
                        "key": 1,
                        "value": "The goods are accurately described on the waybill."
                    },
                    {
                        "key": 2,
                        "value": "The waybill is printed and affixed to the parcel."
                    },
                    {
                        "key": 3,
                        "value": "The goods are adequately packed and accurately addressed on the system generated waybill to enable delivery to take place with ordinary care and handling."
                    },
                    {
                        "key": 4,
                        "value": "The Client has to the best of its knowledge and belief, complied with all laws, rules and regulations regarding, the carriage and that the goods are not prohibited by Government regulation."
                    }
                ]
            },
            {
                "key": 10,
                "value": "The Client agrees to MDS' terms of payment and agrees that MDS shall be entitled to suspend, delay and\/or cancel collection and\/or delivery of any consignment(s) in the event of non payment, or to hold the consignments until such time as the account has been settled in full or to MDS' satisfaction."
            },
            {
                "key": 11,
                "value": "Failure to pay your account within 30 (thirty) days from the date of delivery of a tax invoice will attract interest in terms of the National Credit Act."
            },
            {
                "key": 12,
                "value": "Disputes and account queries must be made in writing to the accounts department within 7 (seven) days after receipt of invoice with specific details of the dispute or query."
            },
            {
                "key": 13,
                "value": "You will be liable for all legal costs incurred by MDS on a scale as between attorney and Client, (including, but not limited to Sheriffs fees, collection commission and tracing agent's fees) in the event of MDS having to institute legal action in order to secure payment of any outstanding account."
            }
        ],
        "Risk Cover Exclusions": [
            {
                "key": "MDS will not be liable for any claims made by Client in any of the following circumstances:",
                "value": [
                    {
                        "key": 1,
                        "value": "Where the Client fails to submit the Claim to MDS within the relevant time limits."
                    },
                    {
                        "key": 2,
                        "value": "Where MDS is in possession of an unendorsed proof of delivery form for the consignment."
                    },
                    {
                        "key": 3,
                        "value": "Where the Goods consigned are Excluded Goods, where “Excluded Goods” means each of the following items:- \n            Money, bullion, credit cards, pre-paid cards, jewelry, watches, precious stones, furs, treasury notes, securities; stamps, patterns or manuscripts, plans, designs, explosives and all livestock or plants, guns, ammunition, hazardous goods and dangerous goods \/ materials, negotiable instruments, gemstones, works of art, securities, drugs, all framed pictures; artwork, solar panels or parts, mirrors and negotiable instruments, including collectible coins, cellphones, furniture and antiques, including fossils or fossil pieces, motor vehicle panels and body parts including windscreens are carried entirely at your risk. Second - hand goods that have not been declared as such to MDS, who reserves the right to inspect second hand goods before acceptance and to delay the transit time by one day to effect such inspection."
                    },
                    {
                        "key": 4,
                        "value": "Where MDS in its reasonable opinion considers the Packaging of the Goods to be inadequate for rail, air or road transportation. In the event of a claim for damage, the receiver must retain all inner and outer packaging materials as well as the damaged goods. Failure by the receiver to retain the original goods and packaging at the original delivery location or the failure to make the delivered goods available for inspection will invalidate the claim."
                    },
                    {
                        "key": 5,
                        "value": "Where the Goods are determined by MDS to have been defective prior to the Carriage."
                    },
                    {
                        "key": 6,
                        "value": "Where damage, mechanical failure or other operational defect in the Goods could not, in the reasonable opinion of MDS, have been caused by the Carriage."
                    },
                    {
                        "key": 7,
                        "value": "Where MDS fails, delays or is unable to carry out its obligations under this contract due to strikes and \/ or lockouts (whether of MDS' own employees or those of others and whether or not MDS could have avoided the same by acceding to the demands of the employees responsible for such action), acts of God, war, terrorism, fire, flood, embargo, litigation, acts of government or any agency instrumentality or any political subdivision thereof or any other cause beyond the control MDS."
                    },
                    {
                        "key": 8,
                        "value": "Where the goods have been lost or damaged as a result of derailments, collisions, overturning or any similar incident."
                    },
                    {
                        "key": 9,
                        "value": "Where the Goods have not been packed in the original manufacturer's packaging or the equivalent."
                    },
                    {
                        "key": 10,
                        "value": "Where the Delivery Address is a post office box, a roadside drop or postal mail box."
                    }
                ]
            }
        ],
        "Amendments to Terms and Conditions of Contract ": [
            {
                "key": 1,
                "value": "MDS reserves the right to amend these terms and conditions of contract from time to time, without prior notice to the Customer."
            }
        ]
    },
    "last_updated": 1605175290
}

HTTP Request

GET v3/terms_and_conditions

15. Battery Types

Index

Get all battery types, to be used when booking a waybill. Should be aggressively cached, or even statically defined.

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/battery_types',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/battery_types"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/battery_types" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "id": "pi_965",
            "name": "PI 965",
            "description": "Lithium Ion batteries packaged \/ sent on their own."
        },
        {
            "id": "pi_966",
            "name": "PI 966",
            "description": "Lithium Ion batteries WITH equipment. (Same box, but NOT inside the item)"
        },
        {
            "id": "pi_967",
            "name": "PI 967",
            "description": "Lithium Ion batteries contained IN equipment. (Not removed from the item)"
        }
    ]
}

HTTP Request

GET v3/battery_types

16. Vendors

Manage Vendors

Index

Show all vendors, or all vendors of a certain type

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.collivery.co.za/v3/vendors',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'vendor_id' => '123152',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/vendors"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "vendor_id": "123152"
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X GET \
    -G "https://api.collivery.co.za/v3/vendors" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"vendor_id":"123152"}'

Example response (200):

{
    "data": [
        {
            "id": 1770,
            "vendor_type": "TAK_SUP",
            "vendor_id": 32143451,
            "verified": false,
            "deleted": false
        },
        {
            "id": 1774,
            "vendor_type": "TAK_SUP",
            "vendor_id": 32143451,
            "verified": false,
            "deleted": false
        },
        {
            "id": 1775,
            "vendor_type": "TAK_SUP",
            "vendor_id": 32143451,
            "verified": false,
            "deleted": false
        },
        {
            "id": 1776,
            "vendor_type": "TAK_SUP",
            "vendor_id": 32143451,
            "verified": false,
            "deleted": false
        }
    ]
}

HTTP Request

GET v3/vendors

Body Parameters

Parameter Type Status Description
vendor_id string optional optional The vendor id. Required if vendor_type TAK_SEL.

Store

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.collivery.co.za/v3/vendors',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'vendor_type' => 'TAK_SUP',
            'vendor_id' => '123152',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/vendors"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "vendor_type": "TAK_SUP",
    "vendor_id": "123152"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.collivery.co.za/v3/vendors" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"vendor_type":"TAK_SUP","vendor_id":"123152"}'

Example response (200):

{
    "data": [
        {
            "id": 1770,
            "vendor_type": "TAK_SUP",
            "vendor_id": 123152,
            "verified": false,
            "deleted": false
        }
    ]
}

HTTP Request

POST v3/vendors

Body Parameters

Parameter Type Status Description
vendor_type string required The vendor type SUP_SUP, TAK_SUP or TAK_SEL.
vendor_id string optional optional The vendor id. Required if vendor_type TAK_SEL.

Update

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://api.collivery.co.za/v3/vendors/1770',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'vendor_type' => 'TAK_SUP',
            'vendor_id' => '123152',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/vendors/1770"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "vendor_type": "TAK_SUP",
    "vendor_id": "123152"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X PUT \
    "https://api.collivery.co.za/v3/vendors/1770" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"vendor_type":"TAK_SUP","vendor_id":"123152"}'

Example response (200):

{
    "data": [
        {
            "id": 1770,
            "vendor_type": "TAK_SUP",
            "vendor_id": 123152,
            "verified": false,
            "deleted": false
        }
    ]
}

HTTP Request

PUT v3/vendors/{vendor}

PATCH v3/vendors/{vendor}

URL Parameters

Parameter Status Description
vendor optional number required The vendor id.

Body Parameters

Parameter Type Status Description
vendor_type string required The vendor type SUP_SUP, TAK_SUP or TAK_SEL.
vendor_id string optional optional The vendor id. Required if vendor_type TAK_SEL.

Destroy

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.collivery.co.za/v3/vendors/1770',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/vendors/1770"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X DELETE \
    "https://api.collivery.co.za/v3/vendors/1770" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com"

Example response (200):

{
    "data": [
        {
            "id": 1770,
            "vendor_type": "TAK_SUP",
            "vendor_id": 123152,
            "verified": false,
            "deleted": true
        }
    ]
}

HTTP Request

DELETE v3/vendors/{vendor}

URL Parameters

Parameter Status Description
vendor optional number required The vendor id.

17. Vendor Waybills

Add Vendor Waybill bookings

Store

Create a new vendor waybill

Requires authentication Requires headers

Example request:


$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.collivery.co.za/v3/vendor_bookings',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'X-App-Name' => 'My Custom App',
            'X-App-Version' => '0.2.1',
            'X-App-Host' => '.NET Framework 4.8',
            'X-App-Lang' => 'C#',
            'X-App-Url' => 'https://example.com',
        ],
        'json' => [
            'collection_address' => '955',
            'delivery_address' => '955',
            'vendor_depot' => 'CPT',
            'service_type' => 3,
            'vehicle_type' => 2,
            'collection_time' => '2025-01-24',
            'risk_cover' => true,
            'orders' => [
                [
                    'length' => 21.5,
                    'width' => 10.0,
                    'height' => 5.5,
                    'weight' => 5.5,
                    'parcel_count' => 2,
                    'vendor_id' => 1772,
                    'due_date' => '2012-02-25',
                    'purchase_order_number' => 'ex',
                    'asn' => 'ex',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.collivery.co.za/v3/vendor_bookings"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "X-App-Name": "My Custom App",
    "X-App-Version": "0.2.1",
    "X-App-Host": ".NET Framework 4.8",
    "X-App-Lang": "C#",
    "X-App-Url": "https://example.com",
};

let body = {
    "collection_address": "955",
    "delivery_address": "955",
    "vendor_depot": "CPT",
    "service_type": 3,
    "vehicle_type": 2,
    "collection_time": "2025-01-24",
    "risk_cover": true,
    "orders": [
        {
            "length": 21.5,
            "width": 10,
            "height": 5.5,
            "weight": 5.5,
            "parcel_count": 2,
            "vendor_id": 1772,
            "due_date": "2012-02-25",
            "purchase_order_number": "ex",
            "asn": "ex"
        }
    ]
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));
curl -X POST \
    "https://api.collivery.co.za/v3/vendor_bookings" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-App-Name: My Custom App" \
    -H "X-App-Version: 0.2.1" \
    -H "X-App-Host: .NET Framework 4.8" \
    -H "X-App-Lang: C#" \
    -H "X-App-Url: https://example.com" \
    -d '{"collection_address":"955","delivery_address":"955","vendor_depot":"CPT","service_type":3,"vehicle_type":2,"collection_time":"2025-01-24","risk_cover":true,"orders":[{"length":21.5,"width":10,"height":5.5,"weight":5.5,"parcel_count":2,"vendor_id":1772,"due_date":"2012-02-25","purchase_order_number":"ex","asn":"ex"}]}'

Example response (201):

{
    "data": {
        "id": 5336527,
        "custom_id": "",
        "service_type_id": 3,
        "service_type_name": "Road Freight",
        "collection_time": 1737698400,
        "customer_reference": "",
        "delivery_time": 1738159200,
        "parcel_count": 2,
        "special_instructions": "Takealot : ex",
        "collection_address_id": 955,
        "collection_contact_id": 596,
        "delivery_address_id": 40,
        "delivery_contact_id": 1864689,
        "status_id": 1,
        "status_name": "Waiting Client Acceptance",
        "parcel_description": "",
        "weight": 11,
        "volumetric_weight": 0.6,
        "total_price": 167.6,
        "risk_cover": true,
        "client": {
            "id": 40,
            "name": "Takealot",
            "landline_number": "111-111-1111",
            "mobile_number": "111-111-1111",
            "account_code": "TAKEALOTCOM",
            "account_type": "pre-paid"
        },
        "collection_address": {
            "id": 955,
            "custom_id": null,
            "town_id": 83,
            "suburb_id": 3593,
            "text": "MDS DBN, Unit 4, Greenfields Business Centre, 1451 Chris Hani Rd, Red Hill, Durban",
            "short_text": "MDS DBN, Red Hill, Durban",
            "location_type": {
                "id": 1,
                "name": "Business Premises",
                "surcharge": false,
                "surcharge_amount": 0
            },
            "geocode_data": {
                "accuracy": 6,
                "accuracy_type": "Street",
                "last_geocoded_at": "2010-06-09",
                "latitude": -29.76,
                "longitude": 31.021999
            }
        },
        "delivery_address": {
            "id": 40,
            "custom_id": null,
            "town_id": 68,
            "suburb_id": 2932,
            "text": "takealot.com Cape Town, Block B, Montague Park Business Estate, Topaz Boulevard, Montague Gardens, Cape Town",
            "short_text": "takealot.com Cape Town, Montague Gardens, Cape Town",
            "location_type": {
                "id": 1,
                "name": "Business Premises",
                "surcharge": false,
                "surcharge_amount": 0
            },
            "geocode_data": {
                "accuracy": 6,
                "accuracy_type": "Street",
                "last_geocoded_at": "3000-01-01",
                "latitude": -33.8519,
                "longitude": 18.5182
            }
        },
        "parcels": [
            {
                "id": 9063478,
                "waybill_id": 5336527,
                "parcel_number": 1,
                "custom_id": "TAK_ex",
                "quantity": 2,
                "length": "22.0",
                "width": "10.0",
                "height": "6.0",
                "weight": "5.5",
                "volumetric_weight": "0.3",
                "created_at": "2021-07-23 11:19:14",
                "add_method": "client"
            }
        ]
    },
    "meta": {
        "opening_hours": [
            "The earliest collect after time is 8:00. Collection time has been adjusted."
        ]
    }
}

HTTP Request

POST v3/vendor_bookings

Body Parameters

Parameter Type Status Description
collection_address integer/object optional optional Required if delivery_address not supplied, can be the id of the address or a json object if the address is not yet stored. See below for object structure.
delivery_address integer/object optional optional Required if collection_address not supplied, can be the id of the address or a json object if the address is not yet stored. See below for object structure.
vendor_depot string required Takealot JNB (JNB) or Takealot CPT (CPT) depot.
service_type integer required A service you would like to deliver the waybill on. Defaults to 2 (Overnight Express).
vehicle_type integer required The vehicle that we should collect it with. Defaults to 1 (Motorbike).
collection_time string required Any future date/time representation that can be parsed by PHP strtotime(). Interpreted as GMT+2. If left empty no time surcharges will be encountered. Must be after current time.
risk_cover boolean optional optional Whether to enable risk cover over and above the default cover. See terms and conditions. Surcharges will be applied. Defaults to false.
orders.*.length float optional optional The length of the parcel. Values in centimetres. Can be supplied as floats or integers.
orders.*.width float optional optional The width of the parcel. Values in centimetres. Can be supplied as floats or integers.
orders.*.height float optional optional The height of the parcel. Values in centimetres. Can be supplied as floats or integers.
orders.*.weight float optional optional The weight of the parcel. Values in kilograms. Can be supplied as floats or integers.
orders.*.parcel_count integer required The amount of parcels of this type.
orders.*.vendor_id integer required The id of the vendor stored with Collivery.
orders.*.due_date date required The date the order is due at Vendor depot.
orders.*.purchase_order_number string required The Purchase order number. Example 165488742
orders.*.asn string optional optional The ASN of order. Example TAL_12341
collection_address.custom_id string optional The custom id you would like to assign to this address. Must be unique. Max 20 characters.
collection_address.town_id integer optional Required without town_name. Can be obtained from /towns/ endpoint.
collection_address.town_name string optional Required without town_id. Can be obtained from /towns/ endpoint.
collection_address.suburb_id integer optional Required without suburb_name. Can be obtained from /suburbs/ endpoint.
collection_address.suburb_name string optional Required without suburb_id. Can be obtained from /suburbs/ endpoint.
collection_address.company_name string optional The name of the company of the address. Max 50 characters.
collection_address.building string optional The building of the address. Max 50 characters.
collection_address.street_number string optional The number on the street of the address. Max 5 characters.
collection_address.street string optional optional Required if the address is filled. The name of the street that the address is on. Max 50 characters.
collection_address.location_type integer optional Required without location_type_name. The id of the location type for the address. Can be obtained from /location_types/ endpoint.
collection_address.location_type_name string optional Required without location_type. The name of the location type for the address. Can be obtained from /location_types/ endpoint.
collection_address.contact object optional optional If you are creating a contact with the address, please ensure that it is a valid JSON object.
collection_address.contact.full_name string optional optional If you are creating a contact with the address, their full name. Required if any of cellphone, work_phone or email_address is present in the contact object. Min 2 characters, max 50 characters.
collection_address.contact.cellphone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and work_phone is not provided. Min 10 characters, max 20 characters.
collection_address.contact.work_phone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and cellphone is not provided. Min 10 characters, max 20 characters.
collection_address.contact.email_address string optional optional If you are creating a contact with the address, their full name. Useful for tracking updates to be sent to. Max 50 characters.
delivery_address.custom_id string optional The custom id you would like to assign to this address. Must be unique. Max 20 characters.
delivery_address.town_id integer optional Required without town_name. Can be obtained from /towns/ endpoint.
delivery_address.town_name string optional Required without town_id. Can be obtained from /towns/ endpoint.
delivery_address.suburb_id integer optional Required without suburb_name. Can be obtained from /suburbs/ endpoint.
delivery_address.suburb_name string optional Required without suburb_id. Can be obtained from /suburbs/ endpoint.
delivery_address.company_name string optional The name of the company of the address. Max 50 characters.
delivery_address.building string optional The building of the address. Max 50 characters.
delivery_address.street_number string optional The number on the street of the address. Max 5 characters.
delivery_address.street string optional optional Required if the address is filled. The name of the street that the address is on. Max 50 characters.
delivery_address.location_type integer optional Required without location_type_name. The id of the location type for the address. Can be obtained from /location_types/ endpoint.
delivery_address.location_type_name string optional Required without location_type. The name of the location type for the address. Can be obtained from /location_types/ endpoint.
delivery_address.contact object optional optional If you are creating a contact with the address, please ensure that it is a valid JSON object.
delivery_address.contact.full_name string optional optional If you are creating a contact with the address, their full name. Required if any of cellphone, work_phone or email_address is present in the contact object. Min 2 characters, max 50 characters.
delivery_address.contact.cellphone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and work_phone is not provided. Min 10 characters, max 20 characters.
delivery_address.contact.work_phone string optional optional If you are creating a contact with the address, their cellphone. Required if any of full_name or email_address is present in the contact object - and cellphone is not provided. Min 10 characters, max 20 characters.
delivery_address.contact.email_address string optional optional If you are creating a contact with the address, their full name. Useful for tracking updates to be sent to. Max 50 characters.

18. Errors

The API uses the following error codes:

Error Code Meaning
400 Bad Request -- There is something wrong with the data you provided
401 Unauthorized -- Your API key is wrong.
404 Not Found -- The url does not exist or the specified resource could not be found
405 Method Not Allowed -- You tried to access an endpoint with an invalid method
412 Precondition Failed -- The data you provided fails validation. Please see error messages
429 Too Many Requests -- You're requesting too many times within a minute
500 Internal Server Error -- We had a problem with our server. Try again later.