Queries and mutations for managing Shipping Methods in the platform.

Queries

Query Shipping Methods

QUERYshippingMethods
Arguments
where​
String​
sort​
Array of String​
limit​
Int​
offset​
Int​

Get Shipping Method

QUERYshippingMethod
Arguments
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Get Shipping Methods By Cart

QUERYshippingMethodsByCart
Arguments
id​
String​

Get Shipping Methods By Location

QUERYshippingMethodsByLocation
Arguments
country​
state​
String​
currency​

Mutations

Create Shipping Method

MUTATIONcreateShippingMethod
Arguments
draft​

Update Shipping Method

MUTATIONupdateShippingMethod
Arguments
version​
Long​
actions​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Delete Shipping Method

MUTATIONdeleteShippingMethod
Arguments
version​
Long​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Output types

ShippingMethod

name​
String​
Unique name of the ShippingMethod within a Project.
zoneRates​
Array of ZoneRate​
Defines ShippingRates (prices) for specific Zones.
active​
Boolean​

Indicates if the ShippingMethod is active.

If true, the ShippingMethod can be used during the creation or update of a Cart or Order.
isDefault​
Boolean​
Whether this ShippingMethod is the Project's default ShippingMethod. When retrieving matching Shipping Methods, it is returned as the first item in the array. This flag does not automatically apply the Shipping Method to Carts.
predicate​
String​
Valid Cart predicate to select a ShippingMethod for a Cart.
key​
String​

User-defined unique identifier of the ShippingMethod.

carrier​
String​
Name of the carrier that delivers the parcel, for example DHL.
taxCategoryRef​
TaxCategory of all ZoneRates of the ShippingMethod.
localizedDescriptionAllLocales​
Array of LocalizedString​

Localized description of the ShippingMethod.

localizedNameAllLocales​
Array of LocalizedString​

Localized name of the ShippingMethod.

storesRef​
Array of KeyReference​
  • If a value exists, the Shipping Method applies to Carts with a Store that matches any Store in this field.
  • If empty, the Shipping Method applies to all Carts, irrespective of a Store.
stores​
Array of Store​
  • If a value exists, the Shipping Method applies to Carts with a Store that matches any Store in this field.
  • If empty, the Shipping Method applies to all Carts, irrespective of a Store.
localizedDescription​
String​

Localized description of the ShippingMethod.

localizedName​
String​

Localized name of the ShippingMethod.

taxCategory​
TaxCategory of all ZoneRates of the ShippingMethod.
custom​

Custom Fields of the ShippingMethod.

id​
String​

Unique identifier of the ShippingMethod.

version​
Long​

Current version of the ShippingMethod.

createdAt​

Date and time (UTC) the ShippingMethod was initially created.

lastModifiedAt​

Date and time (UTC) the ShippingMethod was last updated.

createdBy​

IDs and references that created the ShippingMethod.

lastModifiedBy​

IDs and references that last modified the ShippingMethod.

ShippingMethodQueryResult

offset​
Int​
count​
Int​
total​
Long​
exists​
Boolean​
results​
Array of ShippingMethod​

ZoneRate

Defines shipping rates in different currencies for a specific Zone.
shippingRates​
Array of ShippingRate​

Shipping rates defined per currency.

zoneRef​
Zone for which the shipping rates are valid.
zone​
Zone​
Zone for which the shipping rates are valid.

ShippingRate

Shipping Rate

price​

Currency amount of the ShippingRate.

freeAbove​
Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.
isMatching​
Boolean​
Whether the ShippingRate matches given Cart or Location. Only appears in response to requests for Get ShippingMethods for a Cart or Get ShippingMethods for a Location.
tiers​

Price tiers for the ShippingRate.

ShippingRatePriceTier

type​
String​

ShippingRateCartValuePriceTier

minimumCentAmount​
Int​
price​
isMatching​
Boolean​
type​
String​

ShippingRateCartScorePriceTier

score​
Int​
price​
priceFunction​
isMatching​
Boolean​
type​
String​

PriceFunction

function​
String​
To calculate a Price based on the score, use +, -, * and parentheses. The score is inserted with x. The function returns the cent amount.
For example, to charge $1.99 for a score of 1, $3.99 for a score of 2, $5.99 for a score of 3 and onwards, the function is: (200 * x) - 1). To charge $4.50, $6.00, and $7.50 for express shipping, the function is: (150 * x) + 300.
currencyCode​

ShippingRateCartClassificationPriceTier

value​
String​
price​
isMatching​
Boolean​
type​
String​

Input types

ShippingMethodDraft

name​
String​
Unique name for the ShippingMethod within a Project.
localizedName​

Localized name of the ShippingMethod.

description​
String​

The usage of parameter 'description' is deprecated in favor of using 'localizedDescription'

localizedDescription​

Localized description of the ShippingMethod.

taxCategory​
TaxCategory for all ZoneRates of the ShippingMethod.
zoneRates​
Array of ZoneRateDraft​
Defines ShippingRates (prices) for specific zones.
Default: []​
active​
Boolean​

Whether the ShippingMethod can be used during the creation or update of a Cart or Order.

isDefault​
Boolean​
Whether the ShippingMethod will be the Project's default ShippingMethod. When retrieving matching Shipping Methods, it is returned as the first item in the array. This flag does not automatically apply the Shipping Method to Carts.
predicate​
String​
Valid Cart predicate to select a ShippingMethod for a Cart.
key​
String​

User-defined unique identifier for the ShippingMethod.

custom​

Custom Fields for the ShippingMethod.

stores​
  • If defined and not empty, the Shipping Method applies to Carts with a Store that matches any Store in this field.
  • If not defined or empty, the Shipping Method applies to all Carts, irrespective of a Store.
If the number of referenced Stores exceeds the Stores per Shipping Method limit, an InvalidOperation error is returned.
carrier​
String​
Name of the carrier that delivers the parcel, for example DHL.

ZoneRateDraft

Sets the Zone for which the shippng rates are valid.
shippingRates​
Array of ShippingRateDraft​
Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.
Default: []​

ShippingRateDraft

price​

Money value of the ShippingRate.

freeAbove​
Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.
tiers​

Price tiers for the ShippingRate.

Default: []​

MoneyDraft

currencyCode​
centAmount​
Long​

ShippingRatePriceTierDraft

CartValue​
CartClassification​
CartScore​

ShippingRatePriceTierCartValueDraft

minimumCentAmount​
Int​
price​

MoneyDraft

currencyCode​
centAmount​
Long​

ShippingRatePriceTierCartClassificationDraft

value​
String​
price​

ShippingRatePriceTierCartScoreDraft

score​
Int​
price​
priceFunction​

PriceFunctionDraft

function​
String​
currencyCode​

ShippingMethodUpdateAction

addStore​
addShippingRate​
addZone​
changeActive​
changeIsDefault​
changeName​
changeTaxCategory​
removeStore​
removeShippingRate​
removeZone​
setCarrier​
setCustomField​
setCustomType​
setDescription​

This action is deprecated in favor of using 'setLocalizedDescription'

setKey​
setLocalizedDescription​
setLocalizedName​
setPredicate​
setStores​

Update actions

Add Store

Associates the ShippingMethod with a Store.

ResourceIdentifier of the Store to add.

Add Shipping Rate

Zone to which the ShippingRate should be added.
shippingRate​
Value to add to shippingRates.

Add Zone

Value to add to zoneRates.
Adds a new ZoneRate entry to the zoneRates array with the specified Zone and an empty shippingRates array. After adding the Zone, you can add ShippingRates for this Zone using the Add ShippingRate update action.

Change Active

active​
Boolean​

Value to set.

If set to false, the ShippingMethod cannot be used during the creation or update of a Cart or Order.

Change Is Default

isDefault​
Boolean​
Value to set. Only one ShippingMethod can be default in a Project.

Change Name

name​
String​
Unique value to set within a Project. Must not be empty.

Change Tax Category

taxCategory​

Value to set.

Remove Store

Removes the association to a Store from the ShippingMethod. If no more Stores are assigned, the ShippingMethod becomes a global ShippingMethod.

ResourceIdentifier of the Store to remove.

Remove Shipping Rate

Zone from which the ShippingRate should be removed.
shippingRate​
Value to remove from shippingRates.

Remove Zone

Value to remove from zoneRates.
Removes the entire ZoneRate entry for the specified Zone from the zoneRates array. This action deletes both the Zone reference and all ShippingRates associated with that Zone.

Set Carrier

carrier​
String​
Name of the carrier that delivers the parcel, for example DHL. If carrier is absent or null, it is removed if it exists.

Set Custom Field

This action sets, overwrites, or removes any existing Custom Field for an existing ShippingMethod.
name​
String​
Name of the Custom Field.
value​
String​
If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

Set Custom Type

fields​
Array of CustomFieldInput​
typeKey​
String​
typeId​
String​

Set Description

description​
String​

Value to set. If omitted, any existing value is removed.

Set Key

key​
String​
If key is absent or null, the existing key, if any, will be removed.

Set Localized Description

localizedDescription​

Value to set. If omitted, any existing value is removed.

Set Localized Name

localizedName​

Value to set. If omitted, any existing value is removed.

Set Predicate

predicate​
String​
A valid Cart predicate. If predicate is absent or null, it is removed if it exists.

Set Stores

Sets the Stores the ShippingMethod is associated with. Set stores to an empty array to make the ShippingMethod a global ShippingMethod.
stores​

ResourceIdentifiers of the Stores to set. Overrides the current list of Stores. Set to an empty array to remove all existing values.