api

Content type

The ParcelValue API uses the JSON API content type.

JSON API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. JSON API requires use of the JSON API media type (application/vnd.api+json) for exchanging data.

Any call to the API needs to send the proper Content-Type and Accept headers.

Request content data should follow the JSON API specification.

The currently supported JSON API version is 1.0.

For more information on JSON API please visit JSON:API — A specification for building APIs in JSON.

For more information on JSON data types please visit JSON Data Types.

Identification

For any resource object, the id member is generated by the API server on resource creation.

Examples

An example of the structure of a request data for the /shipments endpoint would be:

{
    "jsonapi": {
        "version": "1.0"
    },
    "data": {
        "type": "shipment",
        "attributes": {
            "shipDate": "2018-12-01",
            "shipFrom": {
                "name" : "Sender Name",
                "address1": "Sender street 123",
                "city": "Milano",
                "postalCode": 20129,
                "state": "MI",
                "country": "IT",
                "contact": "Sender Contactname",
                "phone": "1234567890",
                "email": "sender@ship.from"
            },
            "shipTo": {
                "name" : "Receiver Name",
                "address1": "Receiver address 123",
                "city": "Muenchen",
                "postalCode": 80331,
                "country": "DE",
                "contact": "Receiver Contactname",
                "phone": "987654321",
                "email": "receiver@ship.to"
            },
            "packages": [{
                "weight": {
                    "value": "1.2",
                    "units": "1"
                },
                "dimensions": {
                    "length": "32",
                    "width": "33",
                    "height": "34",
                    "units": "1"
                },
                "type": "CARTON"
            },
            {
                "weight": {
                    "value": "1.9",
                    "units": "1"
                },
                "dimensions": {
                    "length": "32",
                    "width": "33",
                    "height": "34",
                    "units": "1"
                },
                "type": "CARTON"
            }],
            "goodsDescription": "Items from order #1",
            "insuranceDescription": "Testers",
            "insuranceValue": "123.45",
            "invoiceSubtotal": {
                "amount": "13.69",
                "currency": "EUR"
            },
            "customerReference": "REF 123",
            "specialInstructions": "Second door on the left",
            "confirmationEmail": "documents@ship.from",
            "booking": true,
            "documentsOnly": false
        },
        "meta": {
            "carrierChoice": "DHL",
            "scheduledProcessing": true,
            "service": "express"
        }
    }
}

Please see https://jsonapi.org for more information.


README