Skip to content

A customer's marketing consent

GET
/customers/{id}/marketing
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.

id
required

UUID v7

string format: uuid

Example

019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f

UUID v7

Consent and its history

Media typeapplication/json
object
channels
required
Array<object>
object
channel
required
string
Allowed values: email sms phone post
state
required
string
Allowed values: granted withdrawn never_asked other_address unconfirmed
changedAt
required
string | null format: date-time
source
required
string | null
Allowed values: shop_signup shop_checkout shop_account office import api
by
required
string | null
email
required
string | null
history
required
Array<object>
object
id
required

UUID v7

string format: uuid
channel
required
string
Allowed values: email sms phone post
state
required
string
Allowed values: granted withdrawn unconfirmed
source
required
string
Allowed values: shop_signup shop_checkout shop_account office import api
method
required
string | null
Allowed values: phone in_person in_writing email other
by
required
string
byKind
required
string
Allowed values: staff customer system
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
Allowed values: validation
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string

Example

{
"error": "validation",
"issues": [
{
"path": "email",
"message": "Invalid email"
}
]
}