Subscribe to newsletter
curl --request POST \
--url https://store.salesive.com/api/v1/newsletter/subscribe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop-id: <api-key>' \
--data '
{
"email": "jsmith@example.com",
"name": "<string>",
"source": "<string>"
}
'import requests
url = "https://store.salesive.com/api/v1/newsletter/subscribe"
payload = {
"email": "jsmith@example.com",
"name": "<string>",
"source": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'x-shop-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({email: 'jsmith@example.com', name: '<string>', source: '<string>'})
};
fetch('https://store.salesive.com/api/v1/newsletter/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://store.salesive.com/api/v1/newsletter/subscribe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'jsmith@example.com',
'name' => '<string>',
'source' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-shop-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://store.salesive.com/api/v1/newsletter/subscribe"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-shop-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://store.salesive.com/api/v1/newsletter/subscribe")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/newsletter/subscribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyNewsletter
Subscribe to newsletter
Subscribe an email to the shop’s newsletter.
POST
/
newsletter
/
subscribe
Subscribe to newsletter
curl --request POST \
--url https://store.salesive.com/api/v1/newsletter/subscribe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop-id: <api-key>' \
--data '
{
"email": "jsmith@example.com",
"name": "<string>",
"source": "<string>"
}
'import requests
url = "https://store.salesive.com/api/v1/newsletter/subscribe"
payload = {
"email": "jsmith@example.com",
"name": "<string>",
"source": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'x-shop-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({email: 'jsmith@example.com', name: '<string>', source: '<string>'})
};
fetch('https://store.salesive.com/api/v1/newsletter/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://store.salesive.com/api/v1/newsletter/subscribe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'jsmith@example.com',
'name' => '<string>',
'source' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-shop-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://store.salesive.com/api/v1/newsletter/subscribe"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-shop-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://store.salesive.com/api/v1/newsletter/subscribe")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/newsletter/subscribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyRequest
POST /newsletter/subscribe
x-shop-id: {{shopId}}
Content-Type: application/json
{
"email": "jane@example.com",
"name": "Jane Smith",
"source": "footer"
}
Headers
| Header | Type | Description |
|---|---|---|
x-shop-id | string | Identify the shop. |
Content-Type | string | Always set to application/json. |
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address to subscribe. |
name | string | No | Subscriber’s name. |
source | string | No | Source of subscription (e.g., “footer”, “popup”). |
Successful response
{
"status": 200,
"success": true,
"message": "Successfully subscribed to newsletter",
"data": {
"_id": "6a27d7ca289b87893fcbde7c",
"name": "Jane Smith",
"email": "jane@example.com",
"shop": "68b8f52575da81b332af29f1",
"isSubscribed": true,
"source": "footer",
"createdAt": "2026-06-09T09:07:22.289Z",
"updatedAt": "2026-06-09T09:07:22.289Z",
"__v": 0
}
}
Error response
{
"status": 400,
"success": false,
"message": "Email already subscribed",
"data": {}
}
Authorizations
JWT issued by the Salesive Store API for authenticated shoppers.
Optional storefront identifier sent as a header to scope responses to a specific shop. Try It requests remember this value once provided.
Headers
Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.
Response
201
Subscribed successfully
Was this page helpful?
⌘I

