Alokai
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

NameRequiredTypeDescription
propsRequiredPropsParameter object which can be used with this method. Refer to its type definition to learn about possible properties.
optionsOptionalMethodOptionsOptions 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,
    },
  ],
 },
});

On this page