You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
getUserOrders
Get order from SAP Commerce Cloud.
This method exchanges data with the getUserOrders endpoint exposed by the SAP OCC API Orders Controller.
For logged-in users, make sure to pass order code as the code param. In case of anonymous users, pass order guid instead.
Signature
export declare function getUserOrders(
context: SapccIntegrationContext,
props: GetUserOrdersProps
): Promise<Order>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | SapccIntegrationContext | |
props | Required | GetUserOrdersProps | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
Returns
Returns a representation of an Order.
Referenced Types
Examples
Fetching an order.
import { sdk } from '~/sdk';
const order = await sdk.commerce.getUserOrder({ code: '00035084' });Fetching an order and selecting response fields.
import { sdk } from '~/sdk';
const order = await sdk.commerce.getUserOrder({ code: '00035084', fields: 'code,guid,deliveryStatus' });