With Shipping Methods you can specify which shipping services (like DHL, DHL Express, and UPS) you want to provide to your customers for deliveries to different areas of the world at rates you can define. Furthermore, you can extend this resource according to your needs to store custom content, metadata, or to model your workflow.
A maximum number of 100
Shipping Methods can be created per Project. Learn more about this limit.
Learn more about Shipping Methods in our self-paced Shipping methods module.
Representations
ShippingMethod
id ​String​ | Unique identifier of the ShippingMethod. |
version ​Int​ | Current version of the ShippingMethod. |
key ​String​ | User-defined unique identifier of the ShippingMethod. MinLength:2 ​MaxLength: 256 ​Pattern: ^[A-Za-z0-9_-]+$ ​ |
name ​String​ | Unique name of the ShippingMethod within a Project. |
localizedName ​ | Localized name of the ShippingMethod. |
description ​String​ | Description of the ShippingMethod. (markDeprecated)​ |
localizedDescription ​ | Localized description of the ShippingMethod. |
taxCategory ​ | TaxCategory of all ZoneRates of the ShippingMethod. |
zoneRates ​Array of ZoneRate​ | Defines ShippingRates (prices) for specific Zones. |
active ​Boolean​ | Indicates if the ShippingMethod is active. If |
isDefault ​Boolean​ | If |
predicate ​String​ | Valid Cart predicate to select a ShippingMethod for a Cart. |
custom ​CustomFields​ | Custom Fields of the ShippingMethod. |
createdAt ​DateTime​ | Date and time (UTC) the ShippingMethod was initially created. |
createdBy ​BETACreatedBy​ | IDs and references that created the ShippingMethod. |
lastModifiedAt ​DateTime​ | Date and time (UTC) the ShippingMethod was last updated. |
lastModifiedBy ​BETA | IDs and references that last modified the ShippingMethod. |
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
ShippingMethodDraft
key ​String​ | User-defined unique identifier for the ShippingMethod. MinLength:2 ​MaxLength: 256 ​Pattern: ^[A-Za-z0-9_-]+$ ​ |
name ​String​ | Unique name for the ShippingMethod within a Project. |
localizedName ​ | Localized name of the ShippingMethod. |
description ​String​ | Description of the ShippingMethod. (markDeprecated)​ |
localizedDescription ​ | Localized description of the ShippingMethod. |
taxCategory ​ | TaxCategory for all ZoneRates of the ShippingMethod. |
zoneRates ​Array of ZoneRateDraft​ | Defines ShippingRates (prices) for specific zones. |
active ​Boolean​ | If set to |
isDefault ​Boolean​ | If set to |
predicate ​String​ | Valid Cart predicate to select a ShippingMethod for a Cart. |
custom ​ | Custom Fields for the ShippingMethod. |
{
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"currencyCode": "EUR",
"centAmount": 570
}
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"currencyCode": "USD",
"centAmount": 990
}
}
]
}
],
"isDefault": false
}
ShippingMethodPagedQueryResponse
PagedQueryResult with results
containing an array of ShippingMethod.
limit ​Int​ | Number of results requested. Default:20 ​Minimum: 0 ​Maximum: 500 ​ |
count ​Int​ | Actual number of results returned. |
total ​Int​ | Total number of results matching the query.
This number is an estimation that is not strongly consistent.
This field is returned by default.
For improved performance, calculating this field can be deactivated by using the query parameter |
offset ​Int​ | Number of elements skipped. Default:0 ​Maximum: 10000 ​ |
results ​Array of ShippingMethod​ | Shipping Methods matching the query. |
{
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
]
}
ShippingMethodReference
Reference to a ShippingMethod.
id ​String​ | Unique identifier of the referenced ShippingMethod. |
typeId ​ | shipping-method Type of referenced resource. |
obj ​ | Contains the representation of the expanded ShippingMethod. Only present in responses to requests with Reference Expansion for ShippingMethods. |
ShippingMethodResourceIdentifier
ResourceIdentifier to a ShippingMethod. Either id
or key
is required. If both are set, an InvalidJsonInput error is returned.
id ​String​ | Unique identifier of the referenced ShippingMethod. Required if |
key ​String​ | User-defined unique identifier of the referenced ShippingMethod. Required if |
typeId ​ | shipping-method Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource. |
ZoneRate
Defines shipping rates in different currencies for a specific Zone.
zone ​ | Zone for which the shipping rates are valid. |
shippingRates ​Array of ShippingRate​ | Shipping rates defined per currency. |
ZoneRateDraft
zone ​ | Sets the Zone for which the shippng rates are valid. |
shippingRates ​Array of ShippingRateDraft​ | Shipping rates for the |
ShippingRate
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​ |
|
tiers ​Array of ShippingRatePriceTier​ | Price tiers for the ShippingRate. |
ShippingRateDraft
price ​Money​ | Money value of the ShippingRate. |
freeAbove ​Money​ | Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value. |
tiers ​Array of ShippingRatePriceTier​ | Price tiers for the ShippingRate. |
ShippingRatePriceTier
A price tier is selected instead of the default price when a certain threshold or specific Cart value is reached. If no tiered price is suitable for the Cart, the base price of the ShippingRate is used.
The API supports three different kinds of ShippingRatePriceTiers: CartValueTier, CartClassificationTier, and CartScoreTier.
To learn more, see Tiered shipping rates.
CartValueTier
This type is equivalent to ShippingRateCartValuePriceTier in the GraphQL API.
The ShippingRate maps to the value of the Cart and is used to select a tier.
The value of the Cart is the sum of all Line Item totals and Custom Line Item totals (via the totalPrice
field) after any Product Discounts and Cart Discounts have been applied.
If chosen, it is not possible to set a value for the shippingRateInput
on the Cart.
Tiers contain the centAmount
(a value of 100
in the currency USD
corresponds to $ 1.00
), and start at 1
.'
type ​ShippingRateTierType​ | CartValue |
minimumCentAmount ​Int​ | Minimum total price of a Cart for which a shipping rate applies. |
price ​Money​ | Fixed shipping rate Price for a CartValue. |
isMatching ​Boolean​ | Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query. |
{
"type": "CartValue",
"minimumCentAmount": 5000,
"price": {
"currencyCode": "EUR",
"centAmount": 300
}
}
CartClassificationTier
This type is equivalent to ShippingRateCartClassificationPriceTier in the GraphQL API.
The ShippingRate maps to an abstract Cart categorization expressed by strings (for example, Light
, Medium
, or Heavy
).
type ​ShippingRateTierType​ | CartClassification |
value ​String​ |
|
price ​Money​ | Fixed shipping rate for the selected classification. |
isMatching ​Boolean​ | Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query. |
{
"type": "CartClassification",
"value": "Heavy",
"price": {
"currencyCode": "EUR",
"centAmount": 5000
}
}
CartScoreTier
This type is equivalent to ShippingRateCartScorePriceTier in the GraphQL API.
The ShippingRate maps to an abstract Cart categorization expressed by integers (such as shipping scores or weight ranges).
Either price
or priceFunction
is required.
type ​ShippingRateTierType​ | CartScore |
score ​Int​ | Abstract value for categorizing a Cart. The range starts at |
price ​Money​ | Defines a fixed price for the |
priceFunction ​ | Dynamically calculates a Price for a range of scores. |
isMatching ​Boolean​ | Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query. |
{
"type": "CartScore",
"score": 5,
"price": {
"currencyCode": "USD",
"centAmount": 750
}
}
{
"type": "CartScore",
"score": 15,
"priceFunction": {
"currencyCode": "USD",
"function": "(50 * x) + 750"
}
}
PriceFunction
currencyCode ​CurrencyCode​ | Currency code compliant to ISO 4217. DisplayName:CurrencyCode ​ |
function ​String​ | To calculate a Price based on the score, use For example, to charge $1.99 for a score of |
Get ShippingMethod
Get ShippingMethod by ID
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
id String ​ |
|
expand | The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/shipping-methods/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
Get ShippingMethod by Key
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
key String ​ |
|
expand | The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/shipping-methods/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
Get matching Shipping Methods
for a Cart
Retrieves all the active ShippingMethods that can ship to the shipping address of the given Cart.
Each ShippingMethod contains exactly one ShippingRate with the flag isMatching
set to true
.
This ShippingRate is used when the ShippingMethod is added to the Cart.
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
expand | The parameter can be passed multiple times. |
cartId String ​ | ID of the Cart with a shipping address set. |
ShippingMethodPagedQueryResponse
asapplication/json
curl --get https://api.{region}.commercetools.com/{projectKey}/shipping-methods/matching-cart?cartId={cartId} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
]
}
for a Location
Retrieves all the active ShippingMethods that can ship to the given Location.
ShippingMethods that have a predicate
defined are automatically disqualified.
If the currency
parameter is given, then the ShippingMethods must also have a rate defined in the specified currency.
Each ShippingMethod contains at least one ShippingRate with the flag isMatching
set to true
.
If the currency
parameter is given, exactly one ShippingRate will contain it.
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
country | A two-digit country code as per ISO 3166-1 alpha-2. |
state String ​ | Name of the state, for example, Colorado. |
currency String ​ | The currency code compliant to ISO 4217. |
ShippingMethodPagedQueryResponse
asapplication/json
curl --get https://api.{region}.commercetools.com/{projectKey}/shipping-methods/matching-location?country={country} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
]
}
for a Cart and Location
Retrieves all the active ShippingMethods that can ship to the given Location
with a predicate
that matches the given Cart.
Each ShippingMethod contains exactly one ShippingRate with the flag isMatching
set to true
.
This ShippingRate is used when the ShippingMethod is added to the Cart.
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
expand | The parameter can be passed multiple times. |
country | A two-digit country code as per ISO 3166-1 alpha-2. |
state String ​ | Name of the state, for example, Colorado. |
cartId String ​ | ID of the Cart. |
ShippingMethodPagedQueryResponse
asapplication/json
curl --get https://api.{region}.commercetools.com/{projectKey}/shipping-methods/matching-cart-location?country={country}&cartId={cartId} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
]
}
for a Cart in Store
Retrieves all the active ShippingMethods that can ship to the shipping address of the given Cart in a given Store.
Each ShippingMethod contains exactly one ShippingRate with the flag isMatching
set to true
.
This ShippingRate is used when the ShippingMethod is added to the Cart.
view_orders:{projectKey}
view_orders:{projectKey}:{storeKey}
manage_customers:{projectKey}:{storeKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
manage_my_orders:{projectKey}:{storeKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
storeKey String ​ |
|
expand | The parameter can be passed multiple times. |
cartId String ​ | ID of the Cart with a shipping address set. |
ShippingMethodPagedQueryResponse
asapplication/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/shipping-methods/matching-cart?cartId={cartId} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
]
}
for an OrderEdit
Retrieves all the active ShippingMethods that can ship to the given Location for an OrderEdit.
If the OrderEdit preview cannot be generated, an EditPreviewFailed error is returned.
view_orders:{projectKey}
view_shipping_methods:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
orderEditId String ​ | The ID of the OrderEdit. |
country | A two-digit country code as per ISO 3166-1 alpha-2. |
state String ​ | Name of the state, for example, Colorado. |
ShippingMethodPagedQueryResponse
asapplication/json
curl --get https://api.{region}.commercetools.com/{projectKey}/shipping-methods/matching-orderedit?orderEditId={orderEditId}&country={country} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
]
}
Query ShippingMethods
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
where | The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limit Int ​ | Number of results requested. Default: 20 ​ |
offset Int ​ | Number of elements skipped. Default: 0 ​ |
withTotal Boolean ​ | Controls the calculation of the total number of query results. Set to Default: true ​ |
var.<varName> String ​ | Predicate parameter values. The parameter can be passed multiple times. |
ShippingMethodPagedQueryResponse
asapplication/json
curl --get https://api.{region}.commercetools.com/{projectKey}/shipping-methods -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"limit": 20,
"offset": 0,
"count": 1,
"total": 1,
"results": [
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
]
}
Check if ShippingMethod exists
Check if ShippingMethod exists by ID
Checks if a ShippingMethod exists for a given id
. Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
id String ​ |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/shipping-methods/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if ShippingMethod exists by Key
Checks if a ShippingMethod exists for a given key
. Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
key String ​ |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/shipping-methods/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if ShippingMethod exists by Query Predicate
Checks if a ShippingMethod exists for a given Query Predicate. Returns a 200 OK
status if any ShippingMethods match the Query Predicate or a 404 Not Found
otherwise.
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
where | The parameter can be passed multiple times. |
curl --head https://api.{region}.commercetools.com/{projectKey}/shipping-methods -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Check if matching ShippingMethod exists
for a Cart
Checks if an active ShippingMethod exists for the given Cart. Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
cartId String ​ | ID of the Cart with a shipping address set. |
curl --head https://api.{region}.commercetools.com/{projectKey}/shipping-methods/matching-cart?cartId={cartId} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
for a Location
Checks if an active ShippingMethod that can ship to the given Location exists. Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
country | A two-digit country code as per ISO 3166-1 alpha-2. |
state String ​ | Name of the state, for example, Colorado. |
currency String ​ | The currency code compliant to ISO 4217. |
curl --head https://api.{region}.commercetools.com/{projectKey}/shipping-methods/matching-location?country={country} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
for a Cart and Location
Checks if an active ShippingMethod that can ship to the given Location exists for the given Cart. Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
view_orders:{projectKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
country | A two-digit country code as per ISO 3166-1 alpha-2. |
state String ​ | Name of the state, for example, Colorado. |
cartId String ​ | ID of the Cart. |
curl --head https://api.{region}.commercetools.com/{projectKey}/shipping-methods/matching-cart-location?country={country}&cartId={cartId} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
for a Cart in Store
Checks if an active ShippingMethod that can ship to the shipping address of the given Cart exists in the given Store. Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
view_orders:{projectKey}
view_orders:{projectKey}:{storeKey}
manage_customers:{projectKey}:{storeKey}
view_shipping_methods:{projectKey}
manage_my_orders:{projectKey}
manage_my_orders:{projectKey}:{storeKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
storeKey String ​ |
|
cartId String ​ | ID of the Cart with a shipping address set. |
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/shipping-methods/matching-cart?cartId={cartId} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
for an OrderEdit
view_orders:{projectKey}
view_shipping_methods:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
orderEditId String ​ | The ID of the OrderEdit. |
country | A two-digit country code as per ISO 3166-1 alpha-2. |
state String ​ | Name of the state, for example, Colorado. |
curl --head https://api.{region}.commercetools.com/{projectKey}/shipping-methods/matching-orderedit?orderEditId={orderEditId}&country={country} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Create ShippingMethod
manage_orders:{projectKey}
manage_shipping_methods:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
expand | The parameter can be passed multiple times. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/shipping-methods -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"name" : "DHL",
"localizedDescription" : {
"en" : "Standard delivery"
},
"taxCategory" : {
"typeId" : "tax-category",
"id" : "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates" : [ {
"zone" : {
"typeId" : "zone",
"id" : "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates" : [ {
"price" : {
"currencyCode" : "EUR",
"centAmount" : 570
}
} ]
}, {
"zone" : {
"typeId" : "zone",
"id" : "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates" : [ {
"price" : {
"currencyCode" : "USD",
"centAmount" : 990
}
} ]
} ],
"isDefault" : false
}
DATA
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
Update ShippingMethod
Update ShippingMethod by ID
manage_orders:{projectKey}
manage_shipping_methods:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
id String ​ |
|
expand | The parameter can be passed multiple times. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/shipping-methods/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "changeName",
"name" : "New Name"
} ]
}
DATA
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
Update ShippingMethod by Key
manage_orders:{projectKey}
manage_shipping_methods:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
key String ​ |
|
expand | The parameter can be passed multiple times. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/shipping-methods/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "changeName",
"name" : "New Name"
} ]
}
DATA
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
Update actions
Set Key
action ​String​ | "setKey" |
key ​String​ | If 2 ​MaxLength: 256 ​Pattern: ^[A-Za-z0-9_-]+$ ​ |
{
"action": "setKey",
"key": "keyString"
}
Change Name
action ​String​ | "changeName" |
name ​String​ | Unique value to set within a Project. Must not be empty. |
{
"action": "changeName",
"name": "nameString"
}
Set Localized Name
action ​String​ | "setLocalizedName" |
localizedName ​ | Value to set. If empty, any existing value will be removed. |
{
"action": "setLocalizedName",
"localizedName": {
"en": "localizedNameString"
}
}
Set Localized Description
action ​String​ | "setLocalizedDescription" |
localizedDescription ​ | Value to set. If empty, any existing value will be removed. |
{
"action": "setLocalizedDescription",
"localizedDescription": {
"en": "localizedDescriptionString"
}
}
Change TaxCategory
action ​String​ | "changeTaxCategory" |
taxCategory ​ | Value to set. |
{
"action": "changeTaxCategory",
"taxCategory": {
"id": "{{tax-category-id}}",
"typeId": "tax-category"
}
}
Change Active
action ​String​ | "changeActive" |
active ​Boolean​ | Value to set. If set to |
{
"action": "changeActive",
"active": false
}
Change isDefault
action ​String​ | "changeIsDefault" |
isDefault ​Boolean​ | Value to set. Only one ShippingMethod can be default in a Project. |
{
"action": "changeIsDefault",
"isDefault": false
}
Add ShippingRate
action ​String​ | "addShippingRate" |
zone ​ | Zone to which the ShippingRate should be added. |
shippingRate ​ | Value to add to |
{
"action": "addShippingRate",
"zone": {
"typeId": "zone",
"id": "{{zone-id}}"
},
"shippingRate": {
"price": {
"currencyCode": "EUR",
"centAmount": 4000
}
}
}
Remove ShippingRate
action ​String​ | "removeShippingRate" |
zone ​ | Zone from which the ShippingRate should be removed. |
shippingRate ​ | Value to remove from |
{
"action": "removeShippingRate",
"zone": {
"typeId": "zone",
"id": "{{zone-id}}"
},
"shippingRate": {
"price": {
"currencyCode": "EUR",
"centAmount": 4000
}
}
}
Add Zone
action ​String​ | "addZone" |
zone ​ | Value to add to |
{
"action": "addZone",
"zone": {
"typeId": "zone",
"id": "{{zone-id}}"
}
}
Remove Zone
action ​String​ | "removeZone" |
zone ​ | Value to remove from |
{
"action": "removeZone",
"zone": {
"typeId": "zone",
"id": "{{zone-id}}"
}
}
Set Predicate
action ​String​ | "setPredicate" |
predicate ​String​ | A valid Cart predicate. If |
{
"action": "setPredicate",
"predicate": "1=1"
}
Set Custom Type
action ​String​ | "setCustomType" |
type ​ | Defines the Type that extends the ShippingMethod with Custom Fields. If absent, any existing Type and Custom Fields are removed from the ShippingMethod. |
fields ​ | Sets the Custom Fields fields for the ShippingMethod. |
{
"action": "setCustomType",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}
Set CustomField
This action sets, overwrites, or removes any existing Custom Field for an existing ShippingMethod.
action ​String​ | "setCustomField" |
name ​String​ | Name of the Custom Field. |
value ​ | If |
{
"action": "setCustomField",
"name": "exampleStringField",
"value": "TextString"
}
Delete ShippingMethod
Delete ShippingMethod by ID
manage_orders:{projectKey}
manage_shipping_methods:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
id String ​ |
|
version Int ​ | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/shipping-methods/{id}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}
Delete ShippingMethod by Key
manage_orders:{projectKey}
manage_shipping_methods:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ |
|
key String ​ |
|
version Int ​ | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/shipping-methods/key={key}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "eb8991df-2dcd-4e24-83fe-5df46ec04422",
"version": 3,
"name": "DHL",
"localizedDescription": {
"en": "Standard delivery"
},
"taxCategory": {
"typeId": "tax-category",
"id": "5a21f15b-34f8-4b7f-9407-d1eb82a73eba"
},
"zoneRates": [
{
"zone": {
"typeId": "zone",
"id": "5cb532be-c680-43ab-ba14-b664bb03dc35"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "EUR",
"centAmount": 570
},
"tiers": []
}
]
},
{
"zone": {
"typeId": "zone",
"id": "ebe01381-82be-4e63-9993-d1eb8f8e588b"
},
"shippingRates": [
{
"price": {
"type": "centPrecision",
"fractionDigits": 2,
"currencyCode": "USD",
"centAmount": 990
},
"tiers": []
}
]
}
],
"active": true,
"isDefault": false,
"createdAt": "2015-01-21T09:22:04.320Z",
"lastModifiedAt": "2016-02-24T13:36:56.748Z"
}