Alokai
You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x

cancelOrder

Cancel an order, completely or partially.

This method 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(
	context: SapccIntegrationContext,
	props: CancelOrderProps
): Promise<void>;

Parameters

NameRequiredTypeDescription
contextRequiredSapccIntegrationContext
propsRequiredCancelOrderPropsParameter 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

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