Skip to content

Subscribe to Newsletter

Subscribe the authenticated customer to the store newsletter for the current channel.

Endpoint

POST /api/shop/newsletters

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesCustomer Bearer token (Bearer <accessToken>)

Request Body

json
{
  "customerEmail": "[email protected]"
}
FieldTypeRequiredDescription
customerEmailstringYesEmail address to subscribe. Must be a valid email and unique in the subscribers list.

Response Fields (200 OK)

FieldTypeDescription
successbooleantrue when the subscription was created successfully.
messagestringHuman-readable confirmation or error message.

Validation

  • customerEmail is required and must be a valid email format.
  • The email must not already exist in the subscribers list for the channel.
  • A valid customer Bearer token is required.

Use Cases

  • Newsletter opt-in from the storefront footer or account page
  • Re-subscribe a customer who previously unsubscribed
  • Capture marketing consent at checkout or registration

Notes

  • The subscription is scoped to the current channel (resolved from the storefront key).
  • Field names are camelCase (customerEmail).

Released under the MIT License.