Checkout

Checkout for a Commerce store.
JSON examples

Here’s an example for POST.

1{
2  "checkoutId": "2z9R000000008LfIAI"
3}

Here’s an example for PUT when delivery methods and delivery groups are present.

1{
2  "checkoutId": "2z9R000000008LfIAI",
3  "deliveryGroups": {
4    "count": 1,
5    "items": [
6      {
7        "deliveryAddress": {
8          "name": "Alan Johnson",
9          "firstName": "Alan",
10          "lastName": "Johnson",
11          "region": "CA",
12          "country": "US",
13          "city": "San Francisco",
14          "street": "415 Mission St",
15          "companyName": "Salesforce",
16          "postalCode": "94105"
17        },
18        "availableDeliveryMethods": [
19          {
20            "id": "2Dmxx0000004CFVCA2",
21            "name": "Delivery Method 1",
22            "shippingFee": "3.14",
23            "currencyIsoCode": "USD",
24            "carrier": "UPS",
25            "classOfService": "Same day UPS Ground"
26          },
27          {
28            "id": "2Dmxx0000005DEWDB3",
29            "name": "Delivery Method 2",
30            "shippingFee": "2.03",
31            "currencyIsoCode": "USD",
32            "carrier": "UPS",
33            "classOfService": "Next day UPS Ground"
34          }
35        ],
36        "id": "0a7xx0000000000CA2",
37        "isDefault": true,
38        "name": "Default Delivery",
39        "desiredDeliveryDate": "2021-05-28T16:41:41.090Z",
40        "shippingInstructions": "type code 1234 on gate keypad",
41        "customFields": [
42          {
43            "attributes": {
44              "type": "CartDeliveryGroup"
45            },
46            "MyCustomTextField__c": "Text",
47            "MyCustomNumberField__c": 12345,
48            "MyCustomPhoneField__c": "4145551212",
49            "MyCustomAddressField__c": {
50              "street": "415 Mission St",
51              "postalCode": "94105",
52              "city": "San Francisco",
53              "state": "California",
54              "stateCode": "US_CA",
55              "country": "United States",
56              "countryCode": "US",
57              "geocodeAccuracy": "City",
58              "latitude": 34,
59              "longitude": 85.9
60            }
61          }
62        ]
63      }
64    ]
65  },
66  "customFields": [
67    {
68      "attributes": {
69        "type": "WebCart"
70      },
71      "MyCustomTextField__c": "Text",
72      "MyCustomNumberField__c": 12.34,
73      "MyCustomPercentField__c": 0.2345,
74      "MyCustomGeolocationField__c": {
75        "latitude": 33.345,
76        "longitude": 45.567
77      }
78    }
79  ]
80}
Property Name Type Description Filter Group and Version Available Version
cart​Summary Cart Summary Information Summary details of a cart. Small, 61.0 61.0
checkout​Id String ID for the checkout. Small, 55.0 55.0
contact​Info Contact Info Information for a guest contact. Small, 55.0 55.0
custom​Fields SObject[]

Array of sObjects and viewable custom fields for the sObjects. Currently, only the WebCart and CartDeliveryGroup sObjects are supported. The custom fields can be of type Checkbox, Currency, Date, Email, LongTextArea, Number, Percent, Phone, Text, TextArea, or Url.

The supported format for dateTime fields is yyyy-MM-​ddTHH:mm:ss.SSSZ.

The supported format for time fields is HH:mm.ss.SSSZ.

The customFields property isn't supported in stores built on an Aura template.

Small, 62.0 62.0
delivery​Groups Delivery Group Collection Available delivery group for checkout. Big, 55.0 55.0
errors Checkout Error[] List of errors, if any, for the checkout. Small, 55.0 55.0
orderReference​Number String Globally unique identifier (GUID) of the payment order generated after successful completion of a payment request. Small, 61.0 61.0
status​Code String HTTP response code for the request. Small, 57.0 57.0