You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
cancelOrder
Method used to cancel an order, completely or partially.
This method sends a POST request to the cancelOrder endpoint of the Alokai Middleware. In turn, it exchanges data with the doCancelOrder endpoint exposed by the SAP OCC API Orders Controller.
This method will only work for an registered user.
Signature
export declare function cancelOrder<Props extends CancelOrderProps = CancelOrderProps>(
props: Props,
options?: MethodOptions
): Promise<void>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | Props | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
options | Optional | MethodOptions | Options that can be passed to additionally configure the request or customize the logic in a plugin. |
Returns
Returns a representation of an Order.
Referenced Types
Examples
Cancelling an order from a cart.
import { sdk } from '~/sdk';
await sdk.commerce.cancelOrder({
code: 'order-code',
entries: {
cancellationRequestEntryInputs: [
{
orderEntryNumber: 0,
quantity: 1,
},
],
},
});