Update a subscription
curl --request PATCH \
--url https://swish.app/api/2026-07/subscriptions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "cancelled",
"variantId": "456789123"
}
'import requests
url = "https://swish.app/api/2026-07/subscriptions/{id}"
payload = {
"status": "cancelled",
"variantId": "456789123"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'cancelled', variantId: '456789123'})
};
fetch('https://swish.app/api/2026-07/subscriptions/{id}', 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://swish.app/api/2026-07/subscriptions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'cancelled',
'variantId' => '456789123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://swish.app/api/2026-07/subscriptions/{id}"
payload := strings.NewReader("{\n \"status\": \"cancelled\",\n \"variantId\": \"456789123\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://swish.app/api/2026-07/subscriptions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"cancelled\",\n \"variantId\": \"456789123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://swish.app/api/2026-07/subscriptions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"cancelled\",\n \"variantId\": \"456789123\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"contact": "customer@example.com",
"productId": "123456799",
"variantId": "456789123",
"type": "back_in_stock",
"channel": "email",
"status": "active",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z",
"cancelledAt": "2025-01-01T10:00:00.000Z",
"marketContextType": "country",
"marketContextValue": "IE"
}
}{
"error": {
"message": "Validation failed",
"error": "Bad Request",
"statusCode": 400,
"requestId": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"error": {
"message": "Failed to authenticate request",
"error": "Unauthorized",
"statusCode": 401,
"requestId": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"error": {
"message": "You do not have permission to access this resource",
"error": "Forbidden",
"statusCode": 403,
"requestId": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"error": {
"message": "The requested resource was not found",
"error": "Not Found",
"statusCode": 404,
"requestId": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"error": {
"message": "An unexpected error occurred",
"error": "Internal Server Error",
"statusCode": 500,
"requestId": "123e4567-e89b-12d3-a456-426614174000"
}
}Subscriptions
Update a subscription
Updates a subscription’s status or variant
PATCH
/
subscriptions
/
{id}
Update a subscription
curl --request PATCH \
--url https://swish.app/api/2026-07/subscriptions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "cancelled",
"variantId": "456789123"
}
'import requests
url = "https://swish.app/api/2026-07/subscriptions/{id}"
payload = {
"status": "cancelled",
"variantId": "456789123"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'cancelled', variantId: '456789123'})
};
fetch('https://swish.app/api/2026-07/subscriptions/{id}', 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://swish.app/api/2026-07/subscriptions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => 'cancelled',
'variantId' => '456789123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://swish.app/api/2026-07/subscriptions/{id}"
payload := strings.NewReader("{\n \"status\": \"cancelled\",\n \"variantId\": \"456789123\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://swish.app/api/2026-07/subscriptions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"cancelled\",\n \"variantId\": \"456789123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://swish.app/api/2026-07/subscriptions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"cancelled\",\n \"variantId\": \"456789123\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"contact": "customer@example.com",
"productId": "123456799",
"variantId": "456789123",
"type": "back_in_stock",
"channel": "email",
"status": "active",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-01T10:00:00.000Z",
"cancelledAt": "2025-01-01T10:00:00.000Z",
"marketContextType": "country",
"marketContextValue": "IE"
}
}{
"error": {
"message": "Validation failed",
"error": "Bad Request",
"statusCode": 400,
"requestId": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"error": {
"message": "Failed to authenticate request",
"error": "Unauthorized",
"statusCode": 401,
"requestId": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"error": {
"message": "You do not have permission to access this resource",
"error": "Forbidden",
"statusCode": 403,
"requestId": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"error": {
"message": "The requested resource was not found",
"error": "Not Found",
"statusCode": 404,
"requestId": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"error": {
"message": "An unexpected error occurred",
"error": "Internal Server Error",
"statusCode": 500,
"requestId": "123e4567-e89b-12d3-a456-426614174000"
}
}Path Parameters
The ID of the subscription to update
Example:
"67a61d5561e4f9de302c02a1"
Body
application/json
Response
The subscription has been successfully updated.
Response data
Show child attributes
Show child attributes