Product Catalog
Create a new product swap automation
deprecated
Deprecated: this call always fails, and nothing is created. Merchants now create and manage product swap rules only in the Appstle admin, under Journeys. The error’s title mentions “Journey APIs”, but the Admin API has no Journeys endpoints.
To read the rules, use Get all product swaps for a shop or Get a specific product swap by ID.
What the call returns:
400with theerrorKeyproductSwapApiDeprecatedfor any JSON object,{}included400with thetitleBad Requestwhen the body isn’t valid JSON or a field has the wrong type403when the API key is read-only, or whenshopin the body isn’t the API key’s store401when the API key is missing or invalid
Authentication: Requires a valid X-API-Key header
POST
/
api
/
external
/
v2
/
product-swaps
Create a new product swap automation
curl --request POST \
--url https://subscription-admin.appstle.com/api/external/v2/product-swaps \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '{}'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/product-swaps"
payload = {}
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({})
};
fetch('https://subscription-admin.appstle.com/api/external/v2/product-swaps', 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/product-swaps';
const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
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/product-swaps",
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([
]),
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/product-swaps"
payload := strings.NewReader("{}")
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/product-swaps")
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 = "{}"
response = http.request(request)
puts response.read_body{
"entityName": "productSwap",
"errorKey": "productSwapApiDeprecated",
"message": "UserGeneratedError:Product Swap automation APIs are deprecated. Please create and manage Product Swap rules through Journey APIs.",
"params": "productSwap",
"status": 400,
"title": "UserGeneratedError:Product Swap automation APIs are deprecated. Please create and manage Product Swap rules through Journey APIs.",
"type": "https://appstle.com/problem/problem-with-message"
}{
"error": "Unauthorized",
"path": "/api/external/v2/product-swaps",
"status": 401,
"timestamp": "2026-11-22T01:46:17.434+00:00"
}{
"detail": "This API key is read-only and cannot perform write operations.",
"status": 403,
"title": "Forbidden"
}⌘I
Create a new product swap automation
curl --request POST \
--url https://subscription-admin.appstle.com/api/external/v2/product-swaps \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '{}'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/product-swaps"
payload = {}
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({})
};
fetch('https://subscription-admin.appstle.com/api/external/v2/product-swaps', 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/product-swaps';
const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
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/product-swaps",
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([
]),
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/product-swaps"
payload := strings.NewReader("{}")
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/product-swaps")
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 = "{}"
response = http.request(request)
puts response.read_body{
"entityName": "productSwap",
"errorKey": "productSwapApiDeprecated",
"message": "UserGeneratedError:Product Swap automation APIs are deprecated. Please create and manage Product Swap rules through Journey APIs.",
"params": "productSwap",
"status": 400,
"title": "UserGeneratedError:Product Swap automation APIs are deprecated. Please create and manage Product Swap rules through Journey APIs.",
"type": "https://appstle.com/problem/problem-with-message"
}{
"error": "Unauthorized",
"path": "/api/external/v2/product-swaps",
"status": 401,
"timestamp": "2026-11-22T01:46:17.434+00:00"
}{
"detail": "This API key is read-only and cannot perform write operations.",
"status": 403,
"title": "Forbidden"
}