Product Catalog
Get a specific product swap by ID
Retrieves detailed information about a specific product swap automation configuration. This endpoint returns complete details about the source products, destination products, swap triggers, and all associated settings.
Response Details:
- Complete swap configuration
- Source product variants with images and quantities
- Destination product variants with images and quantities
- Billing cycle triggers and conditions
- Discount carry-forward settings
- Email notification preferences
- Swap status and history
Source and Destination Variants: Both source and destination variants are returned as JSON strings containing:
- Variant ID
- Display name/title
- Product image URL
- Quantity to swap
- Product metadata
Swap Timing:
- forBillingCycle: If set, swap occurs at this specific cycle number
- checkForEveryRecurringOrder: If true, swap happens on every order
- updatedFirstOrder: If true, can affect the initial subscription order
Discount Handling:
- NONE: No discount carried forward
- PERCENTAGE: Percentage discount is maintained
- FIXED_AMOUNT: Fixed amount discount is maintained
- PRICE: Specific price point is maintained
Authentication: Requires valid X-API-Key header
GET
/
api
/
external
/
v2
/
product-swaps
/
{id}
Get a specific product swap by ID
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/product-swaps/{id}import requests
url = "https://subscription-admin.appstle.com/api/external/v2/product-swaps/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://subscription-admin.appstle.com/api/external/v2/product-swaps/{id}', 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/{id}';
const options = {method: 'GET'};
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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/{id}"
req, _ := http.NewRequest("GET", url, nil)
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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"active": true,
"carryDiscountForward": true,
"checkForEveryRecurringOrder": false,
"contractsAffected": 145,
"createdAt": "2024-01-15T10:30:00Z",
"description": "Automatically swap to seasonal blend at cycle 4",
"destinationVariants": "[{\"id\":67890,\"displayName\":\"Fall Blend Coffee - 12oz\",\"imageSrc\":\"https://cdn.shopify.com/files/1/0000/0000/products/fall-blend.jpg\",\"quantity\":2,\"price\":\"29.99\"}]",
"discountCarryForward": "PERCENTAGE",
"forBillingCycle": 4,
"id": 10782,
"name": "Seasonal Coffee Rotation",
"shop": "example-shop.myshopify.com",
"sourceVariants": "[{\"id\":12345,\"displayName\":\"Summer Blend Coffee - 12oz\",\"imageSrc\":\"https://cdn.shopify.com/files/1/0000/0000/products/summer-blend.jpg\",\"quantity\":2,\"price\":\"29.99\"}]",
"stopSwapEmails": false,
"updatedAt": "2024-01-15T10:30:00Z",
"updatedFirstOrder": false
}{
"detail": "Product swap does not belong to this shop",
"status": 400,
"title": "Invalid id",
"type": "https://example.com/errors/bad-request"
}{
"detail": "Valid X-API-Key header is required",
"status": 401,
"title": "Authentication required",
"type": "https://example.com/errors/unauthorized"
}{
"detail": "API key does not have permission to view product swaps",
"status": 403,
"title": "Insufficient permissions",
"type": "https://example.com/errors/forbidden"
}{
"detail": "Product swap with ID 10782 not found",
"status": 404,
"title": "Resource not found",
"type": "https://example.com/errors/not-found"
}Headers
Path Parameters
Response
Product swap successfully retrieved
Available options:
NONE, EXISTING_PLAN, PRODUCT_PLAN, PRODUCT_THEN_EXISTING ⌘I
Get a specific product swap by ID
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/product-swaps/{id}import requests
url = "https://subscription-admin.appstle.com/api/external/v2/product-swaps/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://subscription-admin.appstle.com/api/external/v2/product-swaps/{id}', 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/{id}';
const options = {method: 'GET'};
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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/{id}"
req, _ := http.NewRequest("GET", url, nil)
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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"active": true,
"carryDiscountForward": true,
"checkForEveryRecurringOrder": false,
"contractsAffected": 145,
"createdAt": "2024-01-15T10:30:00Z",
"description": "Automatically swap to seasonal blend at cycle 4",
"destinationVariants": "[{\"id\":67890,\"displayName\":\"Fall Blend Coffee - 12oz\",\"imageSrc\":\"https://cdn.shopify.com/files/1/0000/0000/products/fall-blend.jpg\",\"quantity\":2,\"price\":\"29.99\"}]",
"discountCarryForward": "PERCENTAGE",
"forBillingCycle": 4,
"id": 10782,
"name": "Seasonal Coffee Rotation",
"shop": "example-shop.myshopify.com",
"sourceVariants": "[{\"id\":12345,\"displayName\":\"Summer Blend Coffee - 12oz\",\"imageSrc\":\"https://cdn.shopify.com/files/1/0000/0000/products/summer-blend.jpg\",\"quantity\":2,\"price\":\"29.99\"}]",
"stopSwapEmails": false,
"updatedAt": "2024-01-15T10:30:00Z",
"updatedFirstOrder": false
}{
"detail": "Product swap does not belong to this shop",
"status": 400,
"title": "Invalid id",
"type": "https://example.com/errors/bad-request"
}{
"detail": "Valid X-API-Key header is required",
"status": 401,
"title": "Authentication required",
"type": "https://example.com/errors/unauthorized"
}{
"detail": "API key does not have permission to view product swaps",
"status": 403,
"title": "Insufficient permissions",
"type": "https://example.com/errors/forbidden"
}{
"detail": "Product swap with ID 10782 not found",
"status": 404,
"title": "Resource not found",
"type": "https://example.com/errors/not-found"
}