Mettre à jour les préférences de communication d'un client
PUT
https://api-v2.test.eldowallet.fr/clients/:clientId/communication-preferences
Met à jour les préférences de communication d'un client, au nom d'un gestionnaire. Seuls les types de notification et les canaux envoyés sont modifiés. Renvoie les préférences à jour.
À retenir
- Mise à jour partielle malgré le
PUT: seuls les types de notification listés danscommunicationPreferenceschangent, et un canal omis garde sa valeur. Chaque changement effectif est ajouté à l'historique et envoyé enPOSTaux URL de webhook du wallet (client,changedBy,managerId,changedAt,changes).
Requête
path parameters
clientIdstring requiredIdentifiant du client (ObjectId de 24 caractères hexadécimaux).
header parameters
x-langstringLangue des messages d'erreur et des textes renvoyés : `fr` ou `en`.enum:en,frdefault:"en"
Body
application/json requiredcommunicationPreferencesobject[]notificationTypestring requiredenum:NEW_LOYALTY,UPDATE_LOYALTY,REMINDER_LOYALTY,EARNINGS_UPDATE,NEW_COMMUNICATION,EXPIRED_COMMUNICATION,NEW_EVENT,UPDATE_EVENT,NEW_COUPON,UPDATE_COUPON,WELCOME_INTERNAL_CLIENTS,WELCOME_CRM_CLIENTS,WELCOME_EXTERNAL_CLIENTS,WELCOME_COUPON,EXPIRED_COUPON,TRANSIT_TICKET,UPDATE_TRANSIT,HOTEL_RESERVATION,UPDATE_HOTEL_RESERVATION,CINEMA_TICKETsmsbooleanemailbooleannotificationboolean
pushInformativeEnabledbooleanpushCommercialEnabledboolean
Réponses
- 200
- 400
- 401
- 403
- 404
- 500
Schéma
application/jsoncommunicationPreferencesobject[] requirednotificationTypestring requiredenum:NEW_LOYALTY,UPDATE_LOYALTY,REMINDER_LOYALTY,EARNINGS_UPDATE,NEW_COMMUNICATION,EXPIRED_COMMUNICATION,NEW_EVENT,UPDATE_EVENT,NEW_COUPON,UPDATE_COUPON,WELCOME_INTERNAL_CLIENTS,WELCOME_CRM_CLIENTS,WELCOME_EXTERNAL_CLIENTS,WELCOME_COUPON,EXPIRED_COUPON,TRANSIT_TICKET,UPDATE_TRANSIT,HOTEL_RESERVATION,UPDATE_HOTEL_RESERVATION,CINEMA_TICKETsmsboolean requiredemailboolean requirednotificationboolean required
pushInformativeEnabledboolean requiredpushCommercialEnabledboolean requiredconsentLinkstringURL de la page publique de gestion des consentements (`/consent/:token`), sans connexion, sur laquelle le client gère lui-même ses préférences. Absente si le client n'a pas de carte de fidélité.
VALIDATION_ERROR · INVALID_JSON
Schéma
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
UNAUTHORIZED
Schéma
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
FORBIDDEN
Schéma
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
MODEL_NOT_FOUND
Schéma
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email
UNKNOWN_ERROR
Schéma
application/jsonmessagestring requiredexample:Promo code already existserrorCodestring requiredexample:400:PROMO_CODE_ALREADY_EXISTSpathstring requiredexample:/couponsdatestring <date-time> requireddetailsobjectvalidationErrorsobject[]fieldstringexample:emailmessagestringexample:email must be an email