Subscribe to marketing email
Signs an address up for the store's marketing email — the newsletter popup, the footer capture bar, an exit-intent modal.
This does NOT grant consent. It creates the contact and mails a confirmation link, and the address stays unmailable until the recipient clicks it, so a forged or mistyped submission costs one email and nothing more. Do not tell the shopper they are subscribed; tell them to check their inbox.
The response is identical whatever the address's history — already subscribed, already a customer, entirely unknown — so the endpoint cannot be used to probe who shops at this store. A per-address cooldown suppresses repeat confirmation mail to the same victim.
No authentication. Include the honeypot field as a hidden, empty input. Rate limited to 3 requests per minute.
For /api/vc/{connectionId}/* routes the connectionId (vc_*) is in the URL path — not a header. Live-mode requests must also send a matching Origin header.
In: header
Path Parameters
Sales channel ID (vc_*), the canonical salesChannelId. connectionId is the deprecated name of the same value and is still the literal path segment.
Header Parameters
Origin of the storefront page making the call, for example https://shop.example.com. Required: a request with no Origin header is refused with 403. On a LIVE channel its host must equal the channel's registered domain (or one of its subdomains) or match an allowed origin. A TEST channel with no domain accepts any origin; once a domain is set it is matched as on LIVE.
Version of the calling SDK (the Brainerce SDK sends it automatically). Informational: it is recorded on the channel and never changes the response.
Address to subscribe. Lowercased and trimmed server-side. A confirmation email is sent to it; consent is granted only when that link is clicked.
length <= 254Given name, when the form collects one. Greets the recipient in the confirmation email and is stored on the customer record.
1 <= length <= 100Family name, when the form collects one.
1 <= length <= 100Storefront locale at submission time (e.g. "he"). Picks the language of the confirmation email and is saved as the preferred locale on a newly created customer. Falls back to the store language.
length <= 10Where on the storefront the signup came from, such as "popup", "footer", or "exit-intent". Free-form; stored for your own reporting, never interpreted.
length <= 60Free-form JSON object of your own choosing: referrer, UTM parameters, the page the popup fired on. Stored as JSON on a newly created customer record and never interpreted.
Anti-bot honeypot. Render it hidden and leave it empty; a filled value rejects the request. Bots complete every text input, humans never see this one.
curl -X POST "https://api.brainerce.com/api/vc/string/marketing/subscribe" \ -H "origin: string" \ -H "X-SDK-Version: string" \ -H "Content-Type: application/json" \ -d '{ "email": "[email protected]" }'{
"ok": true
}{
"statusCode": 400,
"code": "VALIDATION_FAILED",
"message": "name should not be empty, price must be a positive number",
"timestamp": "2026-08-23T10:15:00.000Z",
"path": "/api/vc/{connectionId}/marketing/subscribe"
}{
"statusCode": 403,
"code": "INSUFFICIENT_SCOPE",
"message": "API key does not have the required scope: products:write",
"timestamp": "2026-08-23T10:15:00.000Z",
"path": "/api/vc/{connectionId}/marketing/subscribe"
}{
"statusCode": 404,
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found",
"timestamp": "2026-08-23T10:15:00.000Z",
"path": "/api/vc/{connectionId}/marketing/subscribe"
}{
"statusCode": 429,
"code": "RATE_LIMITED",
"message": "Too many requests",
"details": {
"retryAfterSeconds": 12
},
"timestamp": "2026-08-23T10:15:00.000Z",
"path": "/api/vc/{connectionId}/marketing/subscribe"
}