> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# Update the current customer's marketing consent

**Publié le** : 2026-08-19
**Catégorie** : Commerce

## `PATCH /customers/me/marketing-consent`

**Update the current customer's marketing consent**

The buyer opts a single channel (or `all`) in or out. Opt-out stamps `opt_out_at`
(opt-out always wins over any prior opt-in); re-opt-in stamps a fresh `opt_in_at`
with `opt_in_source = manual` and clears `opt_out_at`. Writes ONLY the current
customer's rows (tenant-scoped); audits `customer.marketing_opted_in` /
`customer.marketing_opted_out`. Requires a buyer who has proven inbox control: a
session on an unverified row is refused 403 and writes nothing. Behind the publishable
key, the `customer_accounts` flag, and the customer-auth middleware. Returns 200 with
the refreshed `{ channels }`.

> **Note:** This endpoint requires the e-commerce feature to be enabled on your site.

### Request Body

Content-Type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `channel` | "whatsapp" \| "email" \| "all" | Yes | Required. One of: whatsapp, email, all |
| `optIn` | boolean | Yes | Required. Opt-in verb: true re-opts the channel in, false opts it out (opt-out always wins).. Boolean |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Missing or invalid storefront publishable key |
| `402` | The site subscription does not currently permit this operation |
| `403` | The storefront key origin is not allowed |
| `404` | Site, resource, or commerce feature not found |
| `422` | Validation error |


---