Shopper Orders

POST Submits an order for a basket.

POST /organizations/{organizationId}/orders

Operation ID: createOrder. Security: ShopperToken (sfcc.shopper-baskets-orders.rw, sfcc.shopper-standard); ShopperClientContextToken (sfcc.shopper-baskets-orders.rw, sfcc.shopper-standard).

Submits an order based on a prepared basket. The only considered value from the request body is basketId.

Parameters

  • organizationId (path, OrganizationId, required) An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character realm identifier and a 3-character instance type identifier.

    Example

    f_ecom_zzxy_prd
  • siteId (query, SiteId, required) The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.

    Example: SiteId

    RefArch
  • locale (query, LocaleCode) A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter Accept-Language following RFC 2616 & RFC 1766. This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.

    Example: LanguageCountry

    en-US

    Example: CountryCode

    US
  • sfdc_usid (header, string (uuid)) A unique shopper identifier (USID) for tracking client context. Used with endpoints secured with ShopperClientContextToken. This header is required for all endpoints secured with ShopperClientContextToken.
    Example: 550e8400-e29b-41d4-a716-446655440000.
  • sfdc_dw_dnt (header, string) Do Not Track header for privacy preferences. Used with endpoints secured with ShopperClientContextToken. If this header is not passed with endpoints secured with ShopperClientContextToken default value of 0 will be used.
    Allowed values: 0, 1. Example: 1.
  • sfdc_shopper_context (header, string) Shopper context information (for example clientIP, sourceCode, and customQualifiers) passed in from a trusted backend application.

Request body

Media type: application/json. Schema: Basket.

Example: OrderPost

{
  "basketId": "a10ff320829cb0eef93ca5310a"
}

Responses

  • 200 Success, the response body contains the submitted order.

    Media type: application/json. Schema: Order.

    Example: Order

    {
      "adjustedMerchandizeTotalTax": 30,
      "adjustedShippingTotalTax": 0.8,
      "billingAddress": {
        "address1": "104 Presidential Way",
        "city": "Woburn",
        "countryCode": "US",
        "firstName": "Stephanie",
        "fullName": "Stephanie Miller",
        "id": "5f695b6f4bb63cb686483d65a0",
        "lastName": "Miller",
        "postalCode": "01801",
        "stateCode": "MA"
      },
      "channelType": "storefront",
      "confirmationStatus": "not_confirmed",
      "couponItems": [
        {
          "code": "5ties",
          "couponItemId": "d3f7ae47e5897a6b5d2fd541f0",
          "statusCode": "applied",
          "valid": true
        }
      ],
      "createdBy": "Customer",
      "creationDate": "2019-10-22T12:17:28.341Z",
      "currency": "USD",
      "customerInfo": {
        "customerId": "beQeANXJNsd0xcINsB6cSrobQa",
        "customerName": "Stephanie Miller",
        "email": "shopper@salesforce-test.com"
      },
      "customerName": "Stephanie Miller",
      "exportStatus": "not_exported",
      "groupedTaxItems": [
        {
          "taxRate": 0.05,
          "taxValue": 30.8
        }
      ],
      "guest": true,
      "giftCertificateItems": [
        {
          "amount": 1,
          "giftCertificateItemId": "540db3ffe58bfb04ab673757d7",
          "recipientEmail": "miller@salesforce-test.com",
          "shipmentId": "me"
        }
      ],
      "lastModified": "2019-10-22T12:17:28.376Z",
      "merchandizeTotalTax": 30,
      "orderNo": "00000410",
      "orderPriceAdjustments": [
        {
          "appliedDiscount": {
            "amount": 10,
            "type": "amount"
          },
          "reasonCode": "customer service",
          "createdBy": "support",
          "creationDate": "2019-10-22T12:17:28.347Z",
          "custom": true,
          "lastModified": "2019-10-22T12:17:28.349Z",
          "manual": true,
          "price": -10,
          "priceAdjustmentId": "63b9eb9b4a92bd3e5c6ee804c2",
          "promotionId": "5ties"
        }
      ],
      "orderToken": "7gJDIFlnho_mXrxfxVB9Neic3J7szzR9glvgU5Ath-I",
      "orderTotal": 586.76,
      "orderViewCode": "YGXrGbZWlr29tIsGnYgR5o_8OxBMXWigevx1WD0X1Hc",
      "paymentInstruments": [
        {
          "amount": 20,
          "paymentInstrumentId": "ca47e0da3d49b067b630db624a",
          "paymentMethodId": "BML"
        },
        {
          "amount": 566.76,
          "paymentCard": {
            "cardType": "Visa",
            "creditCardExpired": false
          },
          "paymentInstrumentId": "6b970a04ca8a468a64b9936764",
          "paymentMethodId": "CREDIT_CARD"
        }
      ],
      "paymentStatus": "not_paid",
      "productItems": [
        {
          "adjustedTax": 30,
          "basePrice": 199.99,
          "bonusProductLineItem": false,
          "gift": false,
          "itemId": "d9516eecc64bd90b0022714d26",
          "itemText": "Green Umbrella - Sustained Edition",
          "optionItems": [
            {
              "adjustedTax": 0,
              "basePrice": 0,
              "bonusProductLineItem": false,
              "gift": false,
              "itemId": "8991e8d7adf0f46ffbc584e175",
              "itemText": "We will plant a tree for your order.",
              "optionId": "plantATree",
              "optionValueId": "000",
              "price": 0,
              "priceAfterItemDiscount": 0,
              "priceAfterOrderDiscount": 0,
              "productId": "000",
              "productName": "Plant a tree.",
              "quantity": 3,
              "shipmentId": "me",
              "tax": 0,
              "taxBasis": 0,
              "taxClassId": "standard",
              "taxRate": 0.05
            }
          ],
          "price": 599.99,
          "priceAfterItemDiscount": 599.99,
          "priceAfterOrderDiscount": 589.99,
          "productId": "green-umbrella",
          "productName": "Green Umbrella - Sustained Edition",
          "quantity": 3,
          "shipmentId": "me",
          "tax": 30,
          "taxBasis": 599.97,
          "taxClassId": "standard",
          "taxRate": 0.05
        }
      ],
      "productSubTotal": 599.97,
      "productTotal": 599.97,
      "shipments": [
        {
          "adjustedMerchandizeTotalTax": 37,
          "adjustedShippingTotalTax": 0.5,
          "deliveryWindow": {
            "startAt": "2026-05-04T14:00:00Z",
            "endAt": "2026-05-07T22:00:00Z"
          },
          "gift": false,
          "merchandizeTotalTax": 30,
          "orderCutoffAt": "2026-04-27T14:00:00Z",
          "productSubTotal": 599.97,
          "productTotal": 599.97,
          "shipmentId": "me",
          "shipmentTotal": 646.76,
          "shippingAddress": {
            "address1": "4162  Turkey Pen Road",
            "city": "New York",
            "countryCode": "US",
            "firstName": "Agustin",
            "fullName": "Agustin Estes",
            "id": "d5d95acf5381dc6e273b4336a7",
            "lastName": "Estes",
            "postalCode": "10016",
            "stateCode": "NY"
          },
          "shippingMethod": {
            "description": "Order received within 7-10 business days",
            "id": "001",
            "name": "Ground",
            "price": 15.99,
            "deliveryWindow": {
              "startAt": "2026-05-04T14:00:00Z",
              "endAt": "2026-05-07T22:00:00Z"
            },
            "orderCutoffAt": "2026-04-27T14:00:00Z"
          },
          "shippingStatus": "not_shipped",
          "shippingTotal": 15.99,
          "shippingTotalTax": 0.8,
          "taxTotal": 30.8
        }
      ],
      "shippingItems": [
        {
          "adjustedTax": 0.8,
          "basePrice": 15.99,
          "itemId": "768abee75aa8015239a9696c7e",
          "itemText": "Shipping",
          "price": 15.99,
          "priceAfterItemDiscount": 15.99,
          "shipmentId": "me",
          "tax": 0.8,
          "taxBasis": 15.99,
          "taxClassId": "standard",
          "taxRate": 0.05
        }
      ],
      "shippingStatus": "not_shipped",
      "shippingTotal": 15.99,
      "shippingTotalTax": 0.8,
      "status": "created",
      "taxation": "net",
      "taxTotal": 30.8
    }
  • 400

    Possible reasons:

    • a failure during the creation of a gift certificate for a gift certificate item.
    • the basket ID in the request body is null or empty.
    • an invalid product item.
    • an option with the specified option ID is unknown.
    • an option with the specified option value ID is unknown.
    • a product item is not available.
    • the customer assigned to the basket does not match the verified customer represented by the JWT token.
    • the basket contains flashes (validation errors that prevent order placement).

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: BadRequest

    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/bad-request",
      "title": "Bad Request",
      "detail": "Decoding of the property with path '$.failedExample.[1].intProperty' failed because the expected type is 'Integer|Decimal' but the actual type was 'String'."
    }
  • 404 The basket with the given basket ID is unknown.

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: BasketNotFound

    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/basket-not-found",
      "title": "Basket Not Found",
      "detail": "No basket with ID '123' could be found."
    }