Set Cookie Consent Preferences
Sets the status of a customer’s consent to allow data collection by cookies and scripts according to the following consent categories:
Essential (1) cookies and scripts are always allowed and can’t be denied. The endpoint accepts 1 in allow or deny, but including it in deny has no effect.
This endpoint only works if the cookie consent feature is enabled. It is assumed the shopper has not consented to anything until a value is explicitly set. The request body must be populated with a complete set of allowed and denied categories.
Once set, consent preferences will be saved as a cookie for guest shoppers. Consent preferences will be persisted to a shopper’s account to be used for future sessions once they have logged in. Consent preferences can also be managed using the Update customer consent endpoint.
Note
- Substitute your storefront domain for
yourstore.example.com.
Headers
The MIME type of the response body.
Request
Data sent to the Update customer consent endpoint when creating a customer during checkout.
Consent categories the shopper allows: 2 (Functional), 3 (Analytics), 4 (Targeting; Advertising). 1 (Essential) is accepted, but Essential is always allowed.
Consent categories the shopper denies: 2 (Functional), 3 (Analytics), 4 (Targeting; Advertising). 1 (Essential) is accepted but ignored, because Essential is always allowed.