get_order
Retrieve order details from SAP Commerce Cloud using user ID and order code to view specific purchase information.
Instructions
Get details of a specific order
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | User ID or email | |
| orderCode | Yes | Order code/number |
Implementation Reference
- src/index.ts:401-406 (handler)Dispatch handler case for the 'get_order' tool: validates userId and orderCode arguments, then calls hybrisClient.getOrder() to execute the tool logic.case 'get_order': result = await hybrisClient.getOrder( validateString(args, 'userId', true), validateString(args, 'orderCode', true) ); break;
- src/index.ts:176-193 (registration)Registration of the 'get_order' tool in the tools list, including name, description, and input schema requiring userId and orderCode.{ name: 'get_order', description: 'Get details of a specific order', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'User ID or email', }, orderCode: { type: 'string', description: 'Order code/number', }, }, required: ['userId', 'orderCode'], }, },
- src/index.ts:179-193 (schema)Input schema definition for the get_order tool, specifying required string parameters userId and orderCode.inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'User ID or email', }, orderCode: { type: 'string', description: 'Order code/number', }, }, required: ['userId', 'orderCode'], }, },
- src/hybris-client.ts:443-447 (helper)HybrisClient.getOrder method: the core implementation that performs a REST API request to retrieve order details from the Hybris OCC endpoint.async getOrder(userId: string, orderCode: string): Promise<Order> { return this.request<Order>( `/rest/v2/${encodeURIComponent(this.config.baseSiteId!)}/users/${encodeURIComponent(userId)}/orders/${encodeURIComponent(orderCode)}?fields=FULL` ); }