Add products or variants to an existing subscription group (async)
Same JSON body as the v2 bulk-add-products endpoint, but returns immediately with a 202 and processes the update in the background via an AWS Step Function worker instead of within the HTTP request. Use this for large batches (hundreds to thousands of IDs) that would otherwise risk hitting request/gateway timeouts. Poll GET /api/external/v2/subscription-groups/v3//add-products/status to check progress.
Only one such job may run per shop at a time; a second request while one is in progress is rejected with a 400.
Authentication: Requires valid X-API-Key header
curl --request POST \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"productIds": [
123
],
"variantIds": [
123
]
}
'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products"
payload = {
"productIds": [123],
"variantIds": [123]
}
headers = {
"X-API-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({productIds: [123], variantIds: [123]})
};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products';
const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({productIds: [123], variantIds: [123]})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products",
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([
'productIds' => [
123
],
'variantIds' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-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://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products"
payload := strings.NewReader("{\n \"productIds\": [\n 123\n ],\n \"variantIds\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<x-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))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productIds\": [\n 123\n ],\n \"variantIds\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{}{}{}{}Headers
API Key for authentication
Path Parameters
Subscription group ID (numeric ID)
Query Parameters
API Key (Deprecated - Use X-API-Key header instead)
Body
Product and variant IDs to add to the subscription group
Response
Job accepted and started in the background
The response is of type object.
curl --request POST \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"productIds": [
123
],
"variantIds": [
123
]
}
'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products"
payload = {
"productIds": [123],
"variantIds": [123]
}
headers = {
"X-API-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({productIds: [123], variantIds: [123]})
};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products';
const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({productIds: [123], variantIds: [123]})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products",
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([
'productIds' => [
123
],
'variantIds' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-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://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products"
payload := strings.NewReader("{\n \"productIds\": [\n 123\n ],\n \"variantIds\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<x-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))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-groups/v3/{id}/add-products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productIds\": [\n 123\n ],\n \"variantIds\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{}{}{}{}