Commerce Connect REST API

PUT Commerce Webstore Checkouts

PUT /commerce/webstores/{webstoreId}/checkouts

Operation ID: putCheckoutStartV2. Tags: Commerce B2B Resources.

Start Checkout Session V2

Start 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.

Available in: v55.0

Note: PUT is supported in version 57.0 and later.

Parameters

  • webstoreId (path, string (Id), required) The ID of the web store.
    Pattern: ^(0ZE)\w*.
  • effectiveAccountId (query, string)

    ID of the buyer account or guest buyer profile for which the request is made. If unspecified, the default value is determined from context.

    Available in: v55.0

Request body

Input to start a Commerce store checkout for a cart.

Available in: v55.0

Media type: application/json. Schema: CheckoutStartInput.

Example: example_1 Payload 1

{
  "cartId": "0a6456789012345AAA",
  "customFields": [
    {
      "attributes": {
        "type": "WebCart"
      },
      "CartCustomNumberField__c": 1,
      "CartCustomTextField__c": "Text1"
    },
    {
      "attributes": {
        "type": "CartDeliveryGroup"
      },
      "CdgDistrict__c": "District1"
    },
    {
      "attributes": {
        "type": "CartDeliveryGroup"
      },
      "id": "0a7xx000000006TAAQ",
      "CdgWardField__c": 8
    }
  ]
}

Responses

  • 200 Checkout Checkout for a Commerce store.

    Media type: application/json. Schema: CheckoutSessionV2.

    Example: example_1 Payload 1

    Here’s an example for POST.

    {
      "checkoutId": "2z9R000000008LfIAI"
    }

    Example: example_2 Payload 2

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

    {
      "checkoutId": "2z9R000000008LfIAI",
      "deliveryGroups": {
        "count": 1,
        "items": [
          {
            "deliveryAddress": {
              "name": "Alan Johnson",
              "firstName": "Alan",
              "lastName": "Johnson",
              "region": "CA",
              "country": "US",
              "city": "San Francisco",
              "street": "415 Mission St",
              "companyName": "Salesforce",
              "postalCode": "94105"
            },
            "availableDeliveryMethods": [
              {
                "id": "2Dmxx0000004CFVCA2",
                "name": "Delivery Method 1",
                "shippingFee": "3.14",
                "currencyIsoCode": "USD",
                "carrier": "UPS",
                "classOfService": "Same day UPS Ground"
              },
              {
                "id": "2Dmxx0000005DEWDB3",
                "name": "Delivery Method 2",
                "shippingFee": "2.03",
                "currencyIsoCode": "USD",
                "carrier": "UPS",
                "classOfService": "Next day UPS Ground"
              }
            ],
            "id": "0a7xx0000000000CA2",
            "isDefault": true,
            "name": "Default Delivery",
            "desiredDeliveryDate": "2021-05-28T16:41:41.090Z",
            "shippingInstructions": "type code 1234 on gate keypad",
            "customFields": [
              {
                "attributes": {
                  "type": "CartDeliveryGroup"
                },
                "MyCustomTextField__c": "Text",
                "MyCustomNumberField__c": 12345,
                "MyCustomPhoneField__c": "4145551212",
                "MyCustomAddressField__c": {
                  "street": "415 Mission St",
                  "postalCode": "94105",
                  "city": "San Francisco",
                  "state": "California",
                  "stateCode": "US_CA",
                  "country": "United States",
                  "countryCode": "US",
                  "geocodeAccuracy": "City",
                  "latitude": 34,
                  "longitude": 85.9
                }
              }
            ]
          }
        ]
      },
      "customFields": [
        {
          "attributes": {
            "type": "WebCart"
          },
          "MyCustomTextField__c": "Text",
          "MyCustomNumberField__c": 12.34,
          "MyCustomPercentField__c": 0.2345,
          "MyCustomGeolocationField__c": {
            "latitude": 33.345,
            "longitude": 45.567
          }
        }
      ]
    }