Methods


Entity Properties


delivery_label.info

delivery_label.info (int $labelId, array $fields = []) Retrieve delivery label information.

Parameters

labelId
integer
Delivery label internal id
fields
array
  • null - Basic label data.
  • array - Array of fields. Allowed: “packages”, “destination_address”, “origin_address”

Return Value

An object with Delivery Label Properties.

Example Request

Request
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "12e6f7398eb7a992219477aaa771725d",
        "delivery_label.info",
        [
            "2",
            [
                "packages",
                "destination_address",
                "origin_address",
                "files"
            ]
        ]
    ]
}

Example Response

Response
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result": [
        {
            "label_id": "8",
            "delivery_id": "26",
            "warehouse_id": "1",
            "status": "valid",
            "shipping_method": "ups_03",
            "created_at": "2021-01-20T10:03:55+00:00",
            "updated_at": "2021-01-20T10:04:01+00:00",
            "packages": [
                {
                    "warehouse_id": "1",
                    "label_id": "8",
                    "carrier": "ups",
                    "weight": "18.000",
                    "weight_unit": "lb",
                    "dimensions": {
                        "length": "10.000",
                        "width": "11.000",
                        "height": "12.000"
                    },
                    "dimension_unit": "in",
                    "tracking": [
                        {
                            "number": "1Z49R7V89024431506",
                            "description": "UPS Ground"
                        }
                    ],
                    "package_items": [
                        {
                            "delivery_item_id": 2,
                            "sku": "O-VS-Oregano-p3",
                            "quantity": "4.000"
                        },
                        {
                            "delivery_item_id": 3,
                            "sku": "O-VS-Mint-p2",
                            "quantity": "4.000"
                        },
                        {
                            "delivery_item_id": 5,
                            "sku": "VS-Bags-p1",
                            "quantity": "4.000"
                        }
                    ]
                }
            ],
            "destination_address": {
                "region": "New York",
                "postcode": "13088",
                "lastname": "Marquez",
                "street": "4616 Crossroads Park Dr",
                "city": "Liverpool",
                "email": null,
                "telephone": "865-971-4663",
                "firstname": "Sherlock",
                "company": null,
                "classification": "com",
                "is_valid": null,
                "country": "US"
            },
            "origin_address": {
                "region": "New York",
                "postcode": "10036",
                "lastname": "Gates",
                "street": "11 Times Square",
                "city": "New York",
                "email": null,
                "telephone": "212.245.2100",
                "firstname": "Bill",
                "company": "Microsoft",
                "classification": null,
                "is_valid": null,
                "country": "US"
            },
            "files": {
                "label": {
                    "type": "pdf",
                    "data": "base64encoded..."
                },
                "auxiliary_label": {
                    "type": "pdf",
                    "data": "bas64encoded..."
                },
                "customs_documents": null
            }
        }
    ]
}

Error Codes

codemessage
100Requested delivery label does not exist.

delivery_label.search(object|null $filters = [], array|null $options = [], array|null $fields = []) An array of objects. Each object will contain Delivery Label Properties.

Parameters

filters
object | null
  • null - Retrieve list of all delivery labels.
  • object - Retrieve list of delivery labels using specified Search Filters.
options
array | null
  • null - No options will be applied.
  • object - Apply specified Search Options.
fields
array | null
  • null - Basic label data.
  • array - Array of fields. Allowed: “packages”, “destination_address”, “origin_address”

Return Value

An array of objects. Each object will contain Delivery Label Properties.

Example Request

Request
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "12e6f7398eb7a992219477aaa771725d",
        "delivery_label.search",
        [
            { "label_id": { "eq" : "2" } },
            {
                "limit": 100,
                "page": 1
            },
            [
                "packages",
                "destination_address",
                "origin_address",
                "files"
            ]
        ]
    ]
}

Example Response

Response
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "result": {
        "results": [
            {
                "label_id": "2",
                "delivery_id": "22",
                "warehouse_id": "1",
                "status": "valid",
                "shipping_method": "ups_03",
                "created_at": "2021-01-18T13:57:25+00:00",
                "updated_at": "2021-01-18T13:57:29+00:00",
                "packages": [
                    {
                        "warehouse_id": "1",
                        "label_id": "2",
                        "carrier": "ups",
                        "weight": "45.000",
                        "weight_unit": "lb",
                        "dimensions": {
                            "length": "10.000",
                            "width": "11.000",
                            "height": "12.000"
                        },
                        "dimension_unit": "in",
                        "tracking": [
                            {
                                "number": "1Z49R7V89024877071",
                                "description": "UPS Ground"
                            }
                        ],
                        "package_items": [
                            {
                                "delivery_item_id": "68",
                                "sku": "O-VS-Oregano-p3",
                                "quantity": "10.000"
                            },
                            {
                                "delivery_item_id": "69",
                                "sku": "O-VS-Mint-p2",
                                "quantity": "10.000"
                            },
                            {
                                "delivery_item_id": "70",
                                "sku": "VS-Bags-p1",
                                "quantity": "10.000"
                            }
                        ]
                    }
                ],
                "destination_address": {
                    "region": "New York",
                    "postcode": "13088",
                    "lastname": "Marquez",
                    "street": "4616 Crossroads Park Dr",
                    "city": "Liverpool",
                    "email": null,
                    "telephone": "865-971-4663",
                    "firstname": "Sherlock",
                    "company": null,
                    "classification": "com",
                    "is_valid": null,
                    "country": "US"
                },
                "origin_address": {
                    "region": "New York",
                    "postcode": "10036",
                    "lastname": "Gates",
                    "street": "11 Times Square",
                    "city": "New York",
                    "email": null,
                    "telephone": "212.245.2100",
                    "firstname": "Bill",
                    "company": "Microsoft",
                    "classification": null,
                    "is_valid": null,
                    "country": "US"
                },
                "files": {
                    "label": {
                        "type": "pdf",
                        "data": "base64encoded..."
                    },
                    "auxiliary_label": {
                        "type": "pdf",
                        "data": "bas64encoded..."
                    },
                    "customs_documents": null
                }
            }
        ],
        "totalCount": 1,
        "numPages": 1
    }
}

Error Codes

codemessage
101Invalid filters given. Details in error message.

delivery_label.create

delivery_label.create (string $incrementId, object $address, array $packages, object $options) Create a new delivery label.

Parameters

incrementId
string
Delivery # (i.e., the ASN # or RMA # depending on the type)
address
object
Destination Address. See Delivery Label Address Properties.
packages
array
Array of delivery label packages. See Delivery Label Package Properties.
options
object

Return Value

An object with Delivery Label Properties.

Example Request

Request
{
    "jsonrpc":2.0,
    "id":1234,
    "method":"call",
    "params":[
        "12e6f7398eb7a992219477aaa771725d",
        "delivery_label.create",
        [
            "11000022",
            {
                "firstname" : "Bill",
                "lastname" : "Gates",
                "company" : "Microsoft",
                "street" : "11 Times Square",
                "city" : "New York",
                "region" : "NY",
                "postcode" : "10036",
                "country" : "US",
                "telephone" : "212.245.2100"
            },
            [
                {
                    "weight": "45.000",
                    "weight_unit": "lb",
                    "dimensions": {
                        "length": "10.000",
                        "width": "11.000",
                        "height": "12.000"
                    },
                    "dimension_unit": "in",
                    "package_items": [
                        {
                            "sku": "O-VS-Oregano-p3",
                            "quantity": "10.000"
                        },
                        {
                            "sku": "O-VS-Mint-p2",
                            "quantity": "10.000"
                        },
                        {
                            "sku": "VS-Bags-p1",
                            "quantity": "10.000"
                        }
                    ]
                }
            ],
            {
                "shipping_method":"ups_03",
                "return_service_type":"print_or_download"
            }
        ]
    ]
}

Example Response

Response
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "error" : null,
    "result": [
        {
            "label_id": "10",
            "delivery_id": "27",
            "warehouse_id": "1",
            "status": "valid",
            "shipping_method": "ups_03",
            "created_at": "2021-01-22T13:45:17+00:00",
            "updated_at": "2021-01-22T13:45:28+00:00",
            "packages": [
                {
                    "warehouse_id": "1",
                    "label_id": "10",
                    "carrier": "ups",
                    "weight": 45,
                    "weight_unit": "lb",
                    "dimensions": {
                        "length": 10,
                        "width": 11,
                        "height": 12
                    },
                    "dimension_unit": "in",
                    "tracking": [
                        {
                            "number": "1Z49R7V89013598741",
                            "description": "UPS Ground"
                        }
                    ],
                    "package_items": [
                        {
                            "delivery_item_id": "81",
                            "sku": "O-VS-Oregano-p3",
                            "quantity": 10
                        },
                        {
                            "delivery_item_id": "82",
                            "sku": "O-VS-Mint-p2",
                            "quantity": 10
                        },
                        {
                            "delivery_item_id": "83",
                            "sku": "VS-Bags-p1",
                            "quantity": 10
                        }
                    ]
                }
            ],
            "destination_address": {
                "firstname": "Sherlock",
                "lastname": "Marquez",
                "telephone": "865-971-4663",
                "street": "4616 Crossroads Park Dr",
                "city": "Liverpool",
                "postcode": "13088",
                "classification": "com",
                "region": "New York",
                "country": "US"
            },
            "origin_address": {
                "firstname": "Bill",
                "lastname": "Gates",
                "company": "Microsoft",
                "street": "11 Times Square",
                "city": "New York",
                "region": "New York",
                "postcode": "10036",
                "telephone": "212.245.2100",
                "email": null,
                "classification": null,
                "is_valid": null,
                "country": "US"
            },
            "files": {
                "label": {
                    "type": "pdf",
                    "data": "base64encoded..."
                },
                "auxiliary_label": {
                    "type": "pdf",
                    "data": "bas64encoded..."
                },
                "customs_documents": null
            }
        }
    ]
}

Error Codes

codemessage
100Requested delivery label does not exist.
101Invalid filters given. Details in error message.
102Invalid data given. Details in error message.
103Cannot void the delivery label. Details in error message.
104An unexpected error occurred while creating the delivery label.
105Requested delivery does not exist.

delivery_label.void

delivery_label.void (int $labelId) Void delivery label.

Parameters

labelId
integer
Delivery label internal id

Return Value

true if the Delivery Label was voided.

Example Request

Request
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "method" : "call",
    "params" : [
        "12e6f7398eb7a992219477aaa771725d",
        "delivery_label.void",
        [
            "8"
        ]
    ]
}

Example Response

Response
{
    "jsonrpc" : 2.0,
    "id" : 1234,
    "result": true
}

Error Codes

codemessage
103Cannot void the delivery label. Details in error message.

Entity Properties

Delivery Label Properties

Delivery Label Package Properties

Delivery Label Address Properties

Delivery Label Options

Delivery Label File Properties