You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
removeConsent
Withdraw consent on behalf of an authenticated user in SAP Commerce Cloud.
This method exchanges data with the removeConsent endpoint exposed by the SAP OCC API Consents Controller.
The method removes consent on behalf of an authenticated user based on the vsf-sap-token cookie (which is assigned to that customer). The cookie must be present in the request for the method to work properly.
Signature
export declare function removeConsent(
context: SapccIntegrationContext,
props: RemoveConsentProps
): Promise<void>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | SapccIntegrationContext | |
props | Required | RemoveConsentProps | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
Returns
This method does not return anything.
Referenced Types
Examples
Withdrawing consent with a given consentCode.
import { sdk } from '~/sdk';
await sdk.commerce.removeConsent({ consentCode: '000007PU' });