Subscribe a customer to a newsletter and manage the subscription
- Subscriptions
- Customer account
- 3 routes
This scenario describes the journey for subscribing a customer to one or more Club Med newsletters. It covers the initial subscription creation, retrieving the current state through the identifier returned by the API, and updating the subscription to add another newsletter or trigger an unsubscribe operation.
The entry point is POST/v1/subscriptions, which returns a subscription id and a customer_id. This identifier is then used by GET/v0/subscriptions/{subscription_id} to read the current subscription state, and by PATCH/v1/subscriptions/{subscription_id} to execute either a subscribe or an unsubscribe operation.
Overview
This journey lets you manage a customer newsletter subscription using a technical subscription identifier.
The subscription is created with POST/v1/subscriptions. Its state is read with GET/v0/subscriptions/{subscription_id}. It is updated with PATCH/v1/subscriptions/{subscription_id}.
The most credible functional sequence is the following:
Prerequisites
- Have the
x-api-keyheader - Provide the
accept-languageheader with a valid locale, for examplefr-FR - For read and update operations, have a
subscription_idobtained from thePOSTcall - For an additional subscribe operation through
PATCH, know a validnewsletter_subscriptionsvalue - The full request body schema for
POST/v1/subscriptionsis not verifiable with the available sources - The description of
POST/v1/subscriptionsindicates that personal information is expected, that the target newsletters must be specified, that the contact channel must be provided, and that eitherGenderorCivilityis mandatory
Important
POST/v1/subscriptions can fail if opt-ins and provided fields are inconsistent, if a subscription already exists for the customer, or if optin is not set to true.
Preparing newsletter IDs
The GET/v0/newsletters route exists and lets you retrieve the list of subscribable newsletters, for example CLUBMED. It is useful before starting the main journey.