Get all product swaps for a shop
Returns the store’s product swap rules. A product swap rule replaces products in a subscriber’s orders. Merchants create and manage the rules in the Appstle admin, under Journeys. The create, update and delete calls are deprecated and never change anything.
Which rules you get: one rule for each Swap product step of an active Journey whose trigger is After order and whose other steps are all Swap product. A Journey that isn’t active, has any other kind of step, or repeats every few orders isn’t returned. A Journey with several Swap product steps returns several rules with the same id. A rule’s name is its Journey’s name.
Filters (all optional, combined with AND):
ruleName: keep rules whose name starts with this text (case-sensitive)sourceVariants: comma-separated numeric variant IDs, not GIDs; keep rules whose source variants include every one of themdestinationVariants: the same for the destination variants
Good to know:
sourceVariantsanddestinationVariantsin each rule are JSON strings, not nested arrays: parse them- The list is sorted by
ruleSequence, then byid; rules without aruleSequencecome last - A store with no rules gets
200and an empty list
Authentication: Requires a valid X-API-Key header
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/product-swaps \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/product-swaps"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
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: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/product-swaps"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
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::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body[
{
"carryDiscountForward": null,
"changeNextOrderDateBy": null,
"checkForEveryRecurringOrder": false,
"destinationVariants": "[{\"id\":68185384059184,\"productId\":15386745078064,\"displayName\":\"Colombia Coffee\",\"imageSrc\":\"https://cdn.shopify.com/s/files/1/0000/0000/files/colombia.png\",\"productHandle\":\"colombia-coffee\",\"quantity\":null}]",
"discountCarryForward": "EXISTING_PLAN",
"forBillingCycle": 2,
"id": 209333,
"name": "Swap House Blend Coffee for Colombia Coffee",
"ruleSequence": null,
"shop": "your-store.myshopify.com",
"sourceVariants": "[{\"id\":68185032163632,\"productId\":15386633601328,\"displayName\":\"House Blend Coffee\",\"imageSrc\":\"https://cdn.shopify.com/s/files/1/0000/0000/files/house-blend.png\",\"productHandle\":\"house-blend-coffee\",\"quantity\":1}]",
"stopSwapEmails": false,
"updatedFirstOrder": null
}
]{
"error": "Unauthorized",
"path": "/api/external/v2/product-swaps",
"status": 401,
"timestamp": "2026-11-22T01:46:17.434+00:00"
}Response
The product swap rules that match the filters
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/product-swaps \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/product-swaps"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
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: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/product-swaps"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
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::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body[
{
"carryDiscountForward": null,
"changeNextOrderDateBy": null,
"checkForEveryRecurringOrder": false,
"destinationVariants": "[{\"id\":68185384059184,\"productId\":15386745078064,\"displayName\":\"Colombia Coffee\",\"imageSrc\":\"https://cdn.shopify.com/s/files/1/0000/0000/files/colombia.png\",\"productHandle\":\"colombia-coffee\",\"quantity\":null}]",
"discountCarryForward": "EXISTING_PLAN",
"forBillingCycle": 2,
"id": 209333,
"name": "Swap House Blend Coffee for Colombia Coffee",
"ruleSequence": null,
"shop": "your-store.myshopify.com",
"sourceVariants": "[{\"id\":68185032163632,\"productId\":15386633601328,\"displayName\":\"House Blend Coffee\",\"imageSrc\":\"https://cdn.shopify.com/s/files/1/0000/0000/files/house-blend.png\",\"productHandle\":\"house-blend-coffee\",\"quantity\":1}]",
"stopSwapEmails": false,
"updatedFirstOrder": null
}
]{
"error": "Unauthorized",
"path": "/api/external/v2/product-swaps",
"status": 401,
"timestamp": "2026-11-22T01:46:17.434+00:00"
}