Create Subscription

Creates or updates an email subscription. By default, customers receive abandoned cart emails as soon as they provide their email address in the checkout flow. They can opt out using this endpoint. However, if **Store Settings > Miscellaneous > Require Consent** is enabled, Abandoned Cart Emails are not sent by default, and the customer should opt-in. > #### Note > * Substitute your storefront domain for `yourstore.example.com`. > * The Send a Test Request feature is not currently supported for this endpoint.

Request

This endpoint expects an object.
emailstringOptional
Email of subscriber
acceptsMarketingNewsletterbooleanOptional
Describes whether subscriber has consented to receive Marketing emails.
acceptsAbandonedCartEmailsbooleanOptional
Describes whether subscriber has consented to receive Abandoned Cart emails.

Response

idinteger

The unique numeric ID of the subscriber; increments sequentially.

emailstring
The email of the subscriber. Must be unique.
firstNamestring0-255 characters
The first name of the subscriber.
lastNamestring0-255 characters
The last name of the subscriber.
sourcestring0-255 characters

The source of the subscriber. Values are: storefront, order, or custom.

orderIdinteger or null1-2147483647
The ID of the source order, if source was an order.
consentslist of any
The collection of consents the shopper is subscribing to.