For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
      • Overview
      • Carts
      • Checkouts
      • Consent
      • Customers
      • Subscriptions
          • POSTCreate Subscription
      • Form Fields
      • Orders
      • Pickup Options
  • GraphQL
    • Overview
  • MCP
    • Overview
Dev Portal
LogoLogo
RESTStorefrontSubscriptions

Create Subscription

POST
https://your_store.example.com/api/storefront/subscriptions
POST
/api/storefront/subscriptions
$curl -X POST https://your_store.example.com/api/storefront/subscriptions \
> -H "Content-Type: application/json" \
> -d '{}'
200Successful
1{
2 "id": 1024,
3 "email": "jane.doe@example.com",
4 "firstName": "Jane",
5 "lastName": "Doe",
6 "source": "storefront",
7 "orderId": 98765,
8 "consents": [
9 "marketing_newsletter",
10 "abandoned_cart_emails"
11 ]
12}
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.
Was this page helpful?
Previous

Storefront Subscriptions

Next

Storefront Form Fields

Built with

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.