A customer's marketing consent
GET
/customers/{id}/marketing
const url = 'https://example.com/customers/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/marketing';const options = { method: 'GET', headers: {cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/customers/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/marketing \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token>Each channel (email, sms, phone, post) as it stands: granted, withdrawn or never_asked, with when it changed, where and who changed it. Then every change, newest first, as written at the time: the channel, the new state, the source (shop_signup, shop_checkout, shop_account, office, import, api), how the customer told the office, who, the words a shopper was shown, and any note. The history cannot be edited or deleted.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
UUID v7
string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Responses
Section titled “Responses”Consent and its history
Media typeapplication/json
object
channels
required
Array<object>
object
channel
required
string
state
required
string
changedAt
required
string | null format: date-time
source
required
string | null
by
required
string | null
email
required
string | null
history
required
Array<object>
object
id
required
UUID v7
string format: uuid
channel
required
string
state
required
string
source
required
string
method
required
string | null
by
required
string
byKind
required
string
wording
required
string | null
note
required
string | null
email
required
string | null
at
required
string format: date-time
Example
{ "channels": [ { "channel": "email", "state": "granted", "source": "shop_signup" } ], "history": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "channel": "email", "state": "granted", "source": "shop_signup", "method": "phone", "byKind": "staff" } ]}Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not a member, missing the scope, or a support session
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}No such customer
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
Media typeapplication/json
object
error
required
string
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}