POST
/
auth
/
user
/
{id}
/
notification-preferences
Create user notification preferences
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
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Access token

Path Parameters

id
string
required

user id

Body

application/json
notification_preferences
object
required

An object containing the user's notification preferences.

Response

OK

message
string
required

A descriptive message confirming the success or failure of the operation.

success
boolean
required

Indicates whether the request was successful or failure (true for success, false for failure).

content
object
required

An object containing the response content.