DeliveryMethod

An object representing a delivery method.

Properties

Property Description
description Description of the delivery method.
limitToCustomergroups A list of Customergroup uid's which the delivery method are limited to. If the property is null then there are no limitation set.
name Name of the delivery method, by language.
uid The unique identifier of the delivery method.

Methods

count

Takes a filter object and returns the number of shipment methods found, as an integer.

Parameters

A filter object specifying which shipment methods to count. See Filter objects on the page List selection.

Example

The request below returns the number of delivery methods found where the name in English starts with "My delivery".

API Console
DeliveryMethod.count(
  {
    "/name/en": {
      "startsWith": "My delivery"
    }
  }
)
Response
1

get

Fetches information about a delivery method.

Parameters

Parameter Description
uid The unique identifier of a shipment method.
query Which info to return. See Query language.

Example

The request below returns the name of the shipment method with the unique identifier 123122.

API Console
DeliveryMethod.get(123122, "name")
Response
{
 "name": {"en", "My delivery method"}
}

getSchema

Fetches the JSON Schema which can be used for client-side validation.

Parameters

Parameter Description
uid The unique identifier of a shipment method.

list

Returns an array of objects representing delivery methods. Limited to admin role only.

Parameters

Parameter Description
query A query object specifying what to fetch from each shipment method. This is the same as for get. See Query language.
selection A list selection specifying which shipment methods to fetch. See List selection.

Example

The following request returns an array of max two delivery methods with the properties name and uid:

API Console
DeliveryMethod.list(["name", "uid"], {"limit": 2})
Response
[
  {
    "name":
      {
        "en": "My delivery method"
      },
    "uid": 123122
  },
  {
    "name":
      {
        "en": "My second delivery method"
      },
    "uid": 123123
  },
]

set

Updates a delivery method.

Parameters

Parameter Description
uid The unique identifier of a shipment method to update.
patch An object containing the properties and values to set for the shipment method.
query A query specifying what to return after a successful set (optional).

validate

Validates the data to be set. The performed validation is the same as in set; it validates the resulting object and includes all the required properties. However, nothing is saved.

Parameters

Parameter Description
uid The unique identifier of an existing shipment method or null.
patch An object containing the properties and values to set before validating.

Returns

An array of validation-error objects, each containing the keys pointer (a property referenced using a JSON Pointer) and message (a readable text in the language of the context). If there are no validation errors, then an empty array is returned.