Update the current customer's marketing consent

Opts the signed-in customer in or out of marketing on one channel, or on every channel with `channel: "all"`. Send `optIn: true` to opt in and `optIn: false` to opt out. On an opt-in, the optional `locale` and `consentVersion` record the language and version of the consent text the buyer saw. An opt-out ignores them and keeps the record of the earlier opt-in. Returns 200 with the updated `{ channels }`. A customer whose email is not verified gets 403 `CUSTOMER_EMAIL_NOT_VERIFIED`. Without a valid session token, returns 401 `CUSTOMER_AUTH_REQUIRED`. > **Note:** Available only on sites with e-commerce enabled.

Required access
Send
  • Publishable keyX-Lynkow-Pk
  • Customer session tokenAuthorization
Site access
PATCH/customers/me/marketing-consent
Base URLhttps://api.lynkow.com/storefront/{siteId}

Request body
required

  • channel
    enum
    required

    Required. One of: whatsapp, email, all

    One of: whatsappemailall

  • optIn
    boolean
    required

    Required. Opt-in verb: true re-opts the channel in, false opts it out (opt-out always wins).

  • consentVersion
    string

    Label of the consent text shown, recorded with an opt-in. Cut to 100 characters; an unusable value is ignored.

  • locale
    string

    Language of the consent text, recorded with an opt-in. An opt-out or an unusable value is ignored

Feedback

Was this page helpful?