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

replaceOrgCartEntries

Replace entries in the B2B cart

This method exchanges data with the replaceOrgCartEntries endpoint exposed by the SAP OCC API B2B Carts Controller.

Signature

export declare function replaceOrgCartEntries(
	context: SapccIntegrationContext,
	props: ReplaceOrgCartEntriesProps
): Promise<CartModificationList>;

Parameters

NameRequiredTypeDescription
contextRequiredSapccIntegrationContext
propsRequiredReplaceOrgCartEntriesPropsParameter object which can be used with this method. Refer to its type definition to learn about possible properties.

Returns

Returns cart modification list

Referenced Types

Examples

Replacing entries in the B2B cart

const { cartModifications } = await sdk.commerce.replaceOrgCartEntries({
  cartId: "00035084",
  orderEntryList: {
    orderEntries: [
      {
         quantity: 3,
         product: {
           code: "3881017"
         }
      }
    ]
  }
});

Replacing entries in the B2B cart and selecting response fields.

const { cartModifications } = await sdk.commerce.replaceOrgCartEntries({
  cartId: "00035084",
  fields: 'cartModifications(statusCode)',
  orderEntryList: {
    orderEntries: [
      {
         quantity: 3,
         product: {
           code: "3881017"
         }
      }
    ]
  }
});

On this page