Evaluate the shipping costs for a cart.
Operation ID: postCartEvaluateShippingEvaluates the shipping costs for an existing cart.
curl "https://{yourinstance}.salesforce.com/services/data/v64.0/commerce/webstores/{webstoreId}/carts/{activeCartOrId}/actions/evaluate-shipping" \
-X POST \
-H "content-type: application/json" \
-d '{
"customFields": [
{
"attributes": {
"type": "WebCart"
},
"WebCartCustomField1__c": "Foo"
},
{
"attributes": {
"type": "CartItem"
},
"id": "0a9xx0000000002CI1",
"CartItemCustomField1__c": "CI1_Field1Value",
"CartItemCustomField2__c": "CI1_Field2Value"
},
{
"attributes": {
"type": "CartItem"
},
"id": "0a9xx0000000002CI2",
"CartItemCustomField1__c": "CI2_Field1Value",
"CartItemCustomField2__c": "CI2_Field2Value"
},
{
"attributes": {
"type": "CartDeliveryGroup"
},
"id": "0a7xx000000000CDG1",
"CartDeliveryGroupCustomField1__c": "CDG1_Field1Value",
"CartDeliveryGroupCustomField2__c": "CDG1_Field2Value"
}
],
"shippingAddress": {
"name": "Alan Johnson",
"firstName": "Alan",
"id": "0a6xx0000000000",
"lastName": "Johnson",
"region": "CA",
"country": "US",
"city": "San Francisco",
"street": "415 Mission St",
"postalCode": 94105
}
}'
The valid value is—cartId (ID of the cart), active (this value is only to be used for authenticated users), or current (cart that isn’t closed or pending deletion).
The ID of the web store.
Optional. The ID of the account for which the request is made. If unspecified, defaults to the account ID for the context user.
{
"customFields": [
{
"attributes": {
"type": "WebCart"
},
"WebCartCustomField1__c": "Foo"
},
{
"attributes": {
"type": "CartItem"
},
"id": "0a9xx0000000002CI1",
"CartItemCustomField1__c": "CI1_Field1Value",
"CartItemCustomField2__c": "CI1_Field2Value"
},
{
"attributes": {
"type": "CartItem"
},
"id": "0a9xx0000000002CI2",
"CartItemCustomField1__c": "CI2_Field1Value",
"CartItemCustomField2__c": "CI2_Field2Value"
},
{
"attributes": {
"type": "CartDeliveryGroup"
},
"id": "0a7xx000000000CDG1",
"CartDeliveryGroupCustomField1__c": "CDG1_Field1Value",
"CartDeliveryGroupCustomField2__c": "CDG1_Field2Value"
}
],
"shippingAddress": {
"name": "Alan Johnson",
"firstName": "Alan",
"id": "0a6xx0000000000",
"lastName": "Johnson",
"region": "CA",
"country": "US",
"city": "San Francisco",
"street": "415 Mission St",
"postalCode": 94105
}
}
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.
Details of the shipping address input request.
Success
{
"message": "",
"status": "Completed",
"data": [
{
"errorCode": "UNKNOWN_EXCEPTION",
"message": "Invalid parameter value \\\"3K0SG000000OT\\\" for parameter \\\"id\\\"."
}
]
}
Properties inherited from sfdc.commerce.cart.connect.api.output.CommerceResultRepresentationBase.
The message related to the request.
An asynchronous processing status of the cart, if asynchronous processing is enabled for the store.
- Completed
- Errored
- Processing
Properties defined inline.
Summary of information about a cart and its contents.
{
"accountId": "3K0SG000000OTaQ0AW",
"asyncOperationStatus": null,
"cartId": "0a6SG000001qGHpYAM",
"currencyIsoCode": "USD",
"customFields": [],
"firstPymtGrandTotalAmount": 0,
"firstPymtTotalAmount": 0,
"firstPymtTotalListPrice": 0,
"firstPymtTotalTaxAmount": 0,
"grandTotalAmount": 0,
"isSecondary": false,
"messagesSummary": {
"errorCount": null,
"hasErrors": null,
"limitedMessages": [],
"relatedEntityId": null,
"totalLineItemsWithErrors": null
},
"name": "My Cart",
"orderOwnerId": null,
"ownerId": "005SG00000Gjt8oYAB",
"purchaseOrderNumber": null,
"status": "Active",
"taxType": "Automatic",
"totalAmountWithItemAdjustment": 0,
"totalCartLevelAdjustmentAmount": 0,
"totalChargeAmount": 0,
"totalChargeAmountWithItemAdjustment": 0,
"totalListPrice": 0,
"totalProductAmount": 0,
"totalProductAmountAfterAdjustments": 0,
"totalProductCount": 0,
"totalProductLineItemCount": 0,
"totalProductListAmount": 0,
"totalPromotionalAdjustmentAmount": 0,
"totalSubProductCount": 0,
"totalTaxAmount": 0,
"type": "Cart",
"uniqueProductCount": 0,
"webstoreId": "0ZESG000001n96S4AQ"
}