Newer Version Available

This content describes an older version of this product. View Latest

Commerce Webstore Cart, Evaluate Shipping

Evaluate the shipping costs for a cart.
Resource
1/commerce/webstores/${webstoreId}/carts/${activeCartOrId}/actions/evaluate-shipping
Values for activeCartOrId are:
  • cartId—ID of the cart.
  • active—Active cart. This value should only be used for authenticated users.
  • current—Cart that isn’t closed or pending deletion. Available in version 50.0 and later.
Available version
63.0
HTTP methods
POST
Request body for POST
Root XML tag
cartEvaluateShippingInput
JSON example
1{
2  "customFields": [
3     {
4       "attributes": {
5         "type": "WebCart"
6       },
7       "WebCartCustomField1__c": "Foo"
8     },
9     {
10       "attributes": {
11         "type": "CartItem"
12       },
13       "id": "0a9xx0000000002CI1",
14       "CartItemCustomField1__c": "CI1_Field1Value",
15       "CartItemCustomField2__c": "CI1_Field2Value"
16     },
17     {
18       "attributes": {
19         "type": "CartItem"
20       },
21       "id": "0a9xx0000000002CI2",
22       "CartItemCustomField1__c": "CI2_Field1Value",
23       "CartItemCustomField2__c": "CI2_Field2Value"
24     },
25     {
26       "attributes": {
27         "type": "CartDeliveryGroup"
28       },
29       "id": "0a7xx000000000CDG1",
30       "CartDeliveryGroupCustomField1__c": "CDG1_Field1Value",
31       "CartDeliveryGroupCustomField2__c": "CDG1_Field2Value"
32     }
33   ],
34  "shippingAddress": {
35    "name": "Alan Johnson",
36    "firstName": "Alan",
37    "id": "0a6xx0000000000",
38    "lastName": "Johnson",
39    "region": "CA",
40    "country": "US",
41    "city": "San Francisco",
42    "street": "415 Mission St",
43    "postalCode": "94105"
44  }
45}
Properties
Name Type Description Required or Optional Available Version
customFields sObject Attributes Input[] Array of sObjects and custom fields for the sObjects. Standard fields are ignored. The custom fields must already be defined for the sObject. Currently, the WebCart, CartItem, and CartDeliveryGroup sObjects are supported. Field-level security rules from the shopper profile are applied to the custom fields. The rules are applied for registered shoppers and for the guest shopper profile. See Create a Cart and Cart Item with Custom Fields in a Commerce Store. Optional 63.0
shippingAddress Cart Shipping Address Input Shipping address for a cart. Required 63.0
Request parameters for POST
Parameter Name Type Description Required or Optional Available Version
effective​AccountId String ID of the account for which the request is made. If unspecified, defaults to the account ID for the context user. Optional 63.0
Response body for POST
Cart Summary Result