1.17.1
API Overview
The Shopper Orders API enables you to:
- Create orders based on baskets prepared using the Shopper Baskets API.
- Add a customer's payment instrument to an order.
You can choose to supply the full payment information or supply only a customer payment instrument ID and amount. If the customer payment instrument ID is set, all the other properties (except amount) are ignored and the payment data is resolved from the stored customer payment information.
Note: The API doesn’t allow the storage of credit card numbers. The endpoint provides the storage of masked credit card numbers only.
To update the payment status, use the Orders API.
Responses from this API are not cached because order data is transactional and unique to each shopper.
For additional guidance when working with baskets, see Build Baskets and Place Orders.
Authentication & Authorization
The client requesting order information must have access to the Orders resource. The Shopper Orders API requires a shopper access token from the Shopper Login and API Access Service (SLAS).
For details on how to request a shopper access token from SLAS, see the guest user flows for public clients and private clients in the SLAS guides.
You must include sfcc.shopper-baskets-orders or sfcc.shopper-baskets-orders.rw in the client ID used to generate the SLAS token. For a full list of permissions, see the Authorization Scopes Catalog.
Customization
Custom Properties
This API supports custom properties (prefixed with c_). For details, see Custom Properties.
Hooks
For details on working with hooks, see Extensibility with Hooks.
Response Details
Personalization
Responses from this API are not personalized via the Shopper Context API.
Caching
Responses from this API are not cached. Order data is transactional and unique to each shopper.
Timeouts
Shopper API requests must respond within 10 seconds, including any hook execution. If a response exceeds this threshold, an HTTP 504 status code is returned. For details, see Timeouts and Limits.
Error Handling
Error responses follow the RFC 7807 problem detail format. To trace errors, include a correlation-id header in your request — the response returns it as x-correlation-id. For details, see HTTP Status Codes and Errors.
Use Cases
Create an Order from a Basket
Place an order by providing a basket ID. The basket must have a valid shipping address, shipping method, billing address, and payment instrument.
curl "https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-orders/v1/organizations/{organizationId}/orders?siteId=RefArch" \
-X POST \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{ "basketId": "{basketId}" }'
Related APIs
- Orders (Admin) — Update order status, payment status, and shipping addresses.
- Shopper Baskets — Build and manage baskets before placing an order.
Let us know so we can improve!