# DeliveryMethod

An object representing a delivery method.

# Properties

Property Type Description
uid integer The unique identifier of the delivery method.
name object Name of the delivery method, by language.
description object Description of the delivery method, by language.
limitToCustomergroups array A list of Customergroup uid's which the delivery method are limited to. If the property is null then there are no limitation set.
freeDeliveryMinimumSpend object The minimum amount to spend on an order to get free delivery with this delivery method, by currency.
preferred boolean If this is the preferred delivery method according to the shop.
allowBulky boolean If this delivery method allows delivery of bulky articles.
allowCod boolean If this delivery method allows cash on delivery as a means to pay for the order.
codCountry string For which country cash on delivery is available for.
rates array An array of delivery rates. See Rates.

# Rates

These are the properties for the rates object.

Property Type Description
name string Name of the delivery rate.
countryVatRates array VAT-rate, by country. See CountryVatRate.
weightIntervals array Weight intervals. See WeightInterval.

# CountryVatRate

Property Type Description
vatRate number VAT-rate.
states object VAT-rate, by state.

# WeightInterval

Property Type Description
weightMin number Minimum weight for the interval.
weightMax number Maximum weight for the interval.
price object Price for the interval, by currency.

# 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".

DeliveryMethod.count({
  "/name/en": {
    "startsWith": "My delivery"
  }
})

# 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.

DeliveryMethod.get(123122, [
  "name"
])

# getSchema

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

# Parameters

The unique identifier of a shipment method or null for a new instance.

# list

Returns an array of objects representing delivery methods. Limited to administrators 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:

DeliveryMethod.list([
  "name",
  "uid"
], {
  "limit": 2
})

# 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.