Commerce Engine is now in beta. We're working hard to make it better for you.
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/auth/user/{id}/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"notification_preferences": {
"transactional": {
"email": true,
"sms": true,
"whatsapp": true
},
"promotional": {
"email": true,
"sms": true,
"whatsapp": true
},
"newsletter": {
"email": true,
"sms": true,
"whatsapp": true
}
}
}'
{
"message": "<string>",
"success": true,
"content": {
"notification_preferences": {
"transactional": {
"email": true,
"sms": true,
"whatsapp": true
},
"promotional": {
"email": true,
"sms": true,
"whatsapp": true
},
"newsletter": {
"email": true,
"sms": true,
"whatsapp": true
}
}
}
}
Create user notification preferences API allows clients to create a user’s notification preferences based on their unique user identifier (user_id).
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/auth/user/{id}/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"notification_preferences": {
"transactional": {
"email": true,
"sms": true,
"whatsapp": true
},
"promotional": {
"email": true,
"sms": true,
"whatsapp": true
},
"newsletter": {
"email": true,
"sms": true,
"whatsapp": true
}
}
}'
{
"message": "<string>",
"success": true,
"content": {
"notification_preferences": {
"transactional": {
"email": true,
"sms": true,
"whatsapp": true
},
"promotional": {
"email": true,
"sms": true,
"whatsapp": true
},
"newsletter": {
"email": true,
"sms": true,
"whatsapp": true
}
}
}
}
Access token
user id
OK
The response is of type object
.