Newer Version Available

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

Commerce Webstore Checkout

Get, delete, or update a Commerce store checkout.

If a store is segmented into markets, this API looks at the language parameter appended to the URL to determine the shopper’s locale and returns the appropriate values.

Resource
1/commerce/webstores/webstoreId/checkouts/activeOrCheckoutId
Values for activeOrCheckoutId are:
  • checkoutId—ID of the checkout.
  • active—Active checkout.
Available version
55.0
If you want to use this resource with a WebStore of type B2CE, open a case with Salesforce Support and provide this information:
  • Salesforce organization ID
  • Tenant ID (You can find this ID on the Manage Cloud-to-Cloud Connections page in Setup)
  • B2C Commerce Business Manager login URL
  • B2C Commerce site IDs
HTTP methods
DELETE, GET, PATCH

To ensure that asynchronous checkout processes, such as calculating shipping, taxes, and promotions, finish, you must make a GET request to /commerce/webstores/webstoreId/checkouts/activeOrCheckoutId or /commerce/webstores/webstoreId/checkouts/checkoutId at least one time after making a PATCH request to /commerce/webstores/webstoreId/checkouts/activeOrCheckoutId. While the asynchronous checkout processes, GET requests return a 202 status. When checkout processing is complete, requests return a 200 status with up-to-date data.

Note

Response for DELETE
204: Successful Delete
Request body for PATCH
Root XML tag
<checkout>
JSON example
1{
2  "deliveryAddress": {
3    "name": "Alan Johnson",
4    "firstName": "Alan",
5    "lastName": "Johnson",
6    "region": "CA",
7    "country": "US",
8    "city": "San Francisco",
9    "street": "415 Mission St",
10    "postalCode": "94105"
11  },
12  "desiredDeliveryDate": "2021-05-28T16:41:41.090Z",
13  "shippingInstructions": "type code 1234 on gate keypad",
14  "customFields": [
15    {
16      "attributes": {
17        "type": "WebCart"
18      },
19      "Id": "0a6xx0000000000",
20      "MyCustomTextField__c": "Foo",
21      "MyCustomNumberField__c": 12.34,
22      "MyCustomPercentField__c": 0.2345,
23      "MyCustomGeolocationField__c": {
24        "latitude": 33.345,
25        "longitude": 45.567
26      }
27    },
28    {
29      "attributes": {
30        "type": "CartDeliveryGroup"
31      },
32      "Id": "0a7SB000000oBujYAE",
33      "MyCustomTextField__c": "Bar",
34      "MyCustomNumberField__c": 4.55,
35      "MyCustomPhoneField__c": "4145551212",
36      "MyCustomAddressField__c": {
37        "street": "100 Folsom Street",
38        "city": "San Francisco",
39        "state": "California", //This field isn't currently supported in customFields.
40        "stateCode": "US_CA",
41        "postalCode": "93555",
42        "country": "United States", //This field isn't currently supported in customFields.
43        "countryCode": "US",
44        "geocodeAccuracy": "City",
45        "latitude": 34,
46        "longitude": 85.9
47      }
48    }
49  ]
50}
Properties
Name Type Description Required or Optional Available Version
contactInfo Contact Information Input Contact information for the checkout. Optional 55.0
customFields sObject Attributes Input[]

Array of sObjects and custom fields for the sObjects. Standard fields are ignored. Currently, only the WebCart and CartDeliveryGroup sObjects are supported. You can specify up to 21 sObjects in the array: one WebCart and multiple CartDeliveryGroups. If the store enables split shipments, you can specify custom fields for multiple CartDeliveryGroups.

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.

Although you can specify custom fields in the request, they’re omitted from Connect API responses. After the custom field values are set, however, they’re accessible using the Cart Calculate API, the CreateOrder extension, and integrations.

You can specify this property only if you specify at least one other property. For example, you can set custom fields in PATCH checkouts when you specify the guest contact information or a delivery method (in addition to setting the delivery address).

We currently don’t support updating the country and state fields through customFields as part of the address update using the PATCH request.

Optional 60.0
delivery​Address Checkout Address Input Shipping address for the checkout. Optional 55.0
delivery​MethodId String Delivery method ID for the checkout. Optional 55.0
desired​Delivery​Date String Desired delivery date for the checkout. Optional 55.0
shipping​Instructions String Special shipping instructions for the checkout. Optional 55.0
Response body for GET and PATCH
Checkout