curl --request POST \
--url https://api.beta.suby.fi/v3/subscriptions/{id}/change-plan \
--header 'Content-Type: application/json' \
--header 'X-Suby-Api-Key: <api-key>' \
--data '
{
"productId": "pro_9m2k1x8s7d6f",
"quantity": 3,
"effective": "auto",
"proration": "delta",
"useCustomerPaymentMethod": true,
"card": {
"tokenizedInstrument": "<string>"
},
"successUrl": "<string>",
"cancelUrl": "<string>"
}
'import requests
url = "https://api.beta.suby.fi/v3/subscriptions/{id}/change-plan"
payload = {
"productId": "pro_9m2k1x8s7d6f",
"quantity": 3,
"effective": "auto",
"proration": "delta",
"useCustomerPaymentMethod": True,
"card": { "tokenizedInstrument": "<string>" },
"successUrl": "<string>",
"cancelUrl": "<string>"
}
headers = {
"X-Suby-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Suby-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
productId: 'pro_9m2k1x8s7d6f',
quantity: 3,
effective: 'auto',
proration: 'delta',
useCustomerPaymentMethod: true,
card: {tokenizedInstrument: '<string>'},
successUrl: '<string>',
cancelUrl: '<string>'
})
};
fetch('https://api.beta.suby.fi/v3/subscriptions/{id}/change-plan', 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://api.beta.suby.fi/v3/subscriptions/{id}/change-plan",
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([
'productId' => 'pro_9m2k1x8s7d6f',
'quantity' => 3,
'effective' => 'auto',
'proration' => 'delta',
'useCustomerPaymentMethod' => true,
'card' => [
'tokenizedInstrument' => '<string>'
],
'successUrl' => '<string>',
'cancelUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Suby-Api-Key: <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://api.beta.suby.fi/v3/subscriptions/{id}/change-plan"
payload := strings.NewReader("{\n \"productId\": \"pro_9m2k1x8s7d6f\",\n \"quantity\": 3,\n \"effective\": \"auto\",\n \"proration\": \"delta\",\n \"useCustomerPaymentMethod\": true,\n \"card\": {\n \"tokenizedInstrument\": \"<string>\"\n },\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Suby-Api-Key", "<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))
}HttpResponse<String> response = Unirest.post("https://api.beta.suby.fi/v3/subscriptions/{id}/change-plan")
.header("X-Suby-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"pro_9m2k1x8s7d6f\",\n \"quantity\": 3,\n \"effective\": \"auto\",\n \"proration\": \"delta\",\n \"useCustomerPaymentMethod\": true,\n \"card\": {\n \"tokenizedInstrument\": \"<string>\"\n },\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beta.suby.fi/v3/subscriptions/{id}/change-plan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Suby-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"pro_9m2k1x8s7d6f\",\n \"quantity\": 3,\n \"effective\": \"auto\",\n \"proration\": \"delta\",\n \"useCustomerPaymentMethod\": true,\n \"card\": {\n \"tokenizedInstrument\": \"<string>\"\n },\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"subscription": {
"id": "sub_abc123",
"organizationId": "<string>",
"customerId": "<string>",
"productId": "<string>",
"status": "INCOMPLETE",
"currentCycle": 123,
"totalCycles": 123,
"trialEndAt": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true,
"currentCycleDueAt": "2023-11-07T05:31:56Z",
"renewalAttempt": 123,
"nextRenewalAttemptAt": "2023-11-07T05:31:56Z",
"lastDeclineCategory": "SOFT",
"priceCents": "1999",
"currency": "EUR",
"quantity": 3,
"taxInclusive": true,
"purchaseAsBusiness": true,
"externalRef": "<string>",
"endedAt": "2023-11-07T05:31:56Z",
"endReason": "CANCELED_BY_CUSTOMER",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"product": {
"id": "pro_abc123",
"name": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"status": "ACTIVE",
"priceCents": "<string>",
"currency": "<string>",
"recurringInterval": "DAY",
"recurringIntervalCount": 123,
"recurringCycleCount": 123,
"trialDurationCount": 123,
"trialDurationUnit": "DAY",
"adjustableQuantity": true,
"adjustableMin": 123,
"adjustableMax": 123
},
"customer": {
"id": "cus_abc123",
"email": "jsmith@example.com"
}
},
"scheduledChange": {
"id": "ssc_abc123",
"type": "UPGRADE",
"targetPriceId": "pro_9m2k1x8s7d6f",
"targetQuantity": 123,
"targetProduct": {
"id": "pro_abc123",
"name": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"status": "ACTIVE",
"priceCents": "<string>",
"currency": "<string>",
"recurringInterval": "DAY",
"recurringIntervalCount": 123,
"recurringCycleCount": 123,
"trialDurationCount": 123,
"trialDurationUnit": "DAY",
"adjustableQuantity": true,
"adjustableMin": 123,
"adjustableMax": 123
},
"scheduledFor": "2023-11-07T05:31:56Z",
"appliedAt": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z"
},
"applied": true,
"payment": {
"rail": "card",
"id": "pay_abc123",
"organizationId": "<string>",
"customerId": "<string>",
"productId": "<string>",
"subscriptionId": "<string>",
"status": "PENDING",
"paymentMethodCategory": "CARD",
"declineCode": "<string>",
"declineCategory": "SOFT",
"declineAdvice": "TRY_AGAIN_LATER",
"declineNetworkCode": "<string>",
"threeDSecureResult": "AUTHENTICATED",
"displayName": "<string>",
"displayDescription": "<string>",
"displayImageUrl": "<string>",
"priceCents": "<string>",
"currency": "<string>",
"tokenAmount": "<string>",
"tokenFeeAmount": "<string>",
"quoteFiatAmountCents": 123,
"quoteFiatCurrency": "<string>",
"grossAmountCents": 123,
"platformFeeCents": 123,
"merchantNetCents": 123,
"vatAmountCents": 123,
"vatRateBps": 123,
"taxInclusive": true,
"fxSurchargeCents": 123,
"internationalCardSurchargeCents": 123,
"rollingReserveCents": 123,
"refundedAmountCents": 123,
"refundedAt": "2023-11-07T05:31:56Z",
"cryptoSettlementMode": "<string>",
"settlementChainId": 123,
"settlementAsset": "<string>",
"settlementRecipient": "<string>",
"depositAddress": "<string>",
"settlementTxHash": "<string>",
"lifiTxHash": "<string>",
"lifiSubstatus": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"externalRef": "<string>",
"paymentReceivedAt": "2023-11-07T05:31:56Z",
"paymentSettledAt": "2023-11-07T05:31:56Z",
"paymentConfirmedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"statusTimeline": [
{
"status": "PENDING",
"at": "2023-11-07T05:31:56Z"
}
],
"items": [
{
"productId": "<string>",
"name": "<string>",
"quantity": 123,
"unitPriceCents": 123
}
],
"asset": {
"chainId": 123,
"chainName": "<string>",
"chainLogoUrl": "<string>",
"symbol": "<string>",
"decimals": 123,
"address": "<string>",
"logoUrl": "<string>"
},
"settlementChain": {
"chainId": 123,
"name": "<string>",
"logoUrl": "<string>"
},
"deposit": {
"expected": "<string>",
"received": "<string>",
"remaining": "<string>",
"confirmations": {
"observed": 123,
"required": 123,
"detectedAt": "2023-11-07T05:31:56Z"
},
"warnings": [
{
"code": "INSUFFICIENT_DEPOSIT_AMOUNT",
"message": "<string>",
"data": {}
}
]
}
},
"actionUrl": "<string>"
},
"message": "<string>"
}{
"success": false,
"error": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found",
"data": "<unknown>"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found",
"data": "<unknown>"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found",
"data": "<unknown>"
}Change the plan or the quantity
Change the plan, the quantity (seats, licences), or both.
Increase → charged now on the subscription’s card (prorated; full new price if the cadence changes) and applied once paid · 202, applied: false. Under 1.00 the difference is waived.
Decrease → applied at the period end, no charge.
A quantity-only change keeps the subscriber’s unit price. Licence activation limits follow the quantity.
actionUrl → returned when the customer must act (3-D Secure, card to re-enter, crypto deposit). Suby-hosted page, full page, popup or iframe: it posts { source: "suby", type: "payment_action.completed", paymentId, status } to its opener, or redirects to successUrl / cancelUrl.
subscription.updated fires once applied. Price it first with change-plan/preview.
curl --request POST \
--url https://api.beta.suby.fi/v3/subscriptions/{id}/change-plan \
--header 'Content-Type: application/json' \
--header 'X-Suby-Api-Key: <api-key>' \
--data '
{
"productId": "pro_9m2k1x8s7d6f",
"quantity": 3,
"effective": "auto",
"proration": "delta",
"useCustomerPaymentMethod": true,
"card": {
"tokenizedInstrument": "<string>"
},
"successUrl": "<string>",
"cancelUrl": "<string>"
}
'import requests
url = "https://api.beta.suby.fi/v3/subscriptions/{id}/change-plan"
payload = {
"productId": "pro_9m2k1x8s7d6f",
"quantity": 3,
"effective": "auto",
"proration": "delta",
"useCustomerPaymentMethod": True,
"card": { "tokenizedInstrument": "<string>" },
"successUrl": "<string>",
"cancelUrl": "<string>"
}
headers = {
"X-Suby-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Suby-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
productId: 'pro_9m2k1x8s7d6f',
quantity: 3,
effective: 'auto',
proration: 'delta',
useCustomerPaymentMethod: true,
card: {tokenizedInstrument: '<string>'},
successUrl: '<string>',
cancelUrl: '<string>'
})
};
fetch('https://api.beta.suby.fi/v3/subscriptions/{id}/change-plan', 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://api.beta.suby.fi/v3/subscriptions/{id}/change-plan",
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([
'productId' => 'pro_9m2k1x8s7d6f',
'quantity' => 3,
'effective' => 'auto',
'proration' => 'delta',
'useCustomerPaymentMethod' => true,
'card' => [
'tokenizedInstrument' => '<string>'
],
'successUrl' => '<string>',
'cancelUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Suby-Api-Key: <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://api.beta.suby.fi/v3/subscriptions/{id}/change-plan"
payload := strings.NewReader("{\n \"productId\": \"pro_9m2k1x8s7d6f\",\n \"quantity\": 3,\n \"effective\": \"auto\",\n \"proration\": \"delta\",\n \"useCustomerPaymentMethod\": true,\n \"card\": {\n \"tokenizedInstrument\": \"<string>\"\n },\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Suby-Api-Key", "<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))
}HttpResponse<String> response = Unirest.post("https://api.beta.suby.fi/v3/subscriptions/{id}/change-plan")
.header("X-Suby-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"pro_9m2k1x8s7d6f\",\n \"quantity\": 3,\n \"effective\": \"auto\",\n \"proration\": \"delta\",\n \"useCustomerPaymentMethod\": true,\n \"card\": {\n \"tokenizedInstrument\": \"<string>\"\n },\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beta.suby.fi/v3/subscriptions/{id}/change-plan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Suby-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"pro_9m2k1x8s7d6f\",\n \"quantity\": 3,\n \"effective\": \"auto\",\n \"proration\": \"delta\",\n \"useCustomerPaymentMethod\": true,\n \"card\": {\n \"tokenizedInstrument\": \"<string>\"\n },\n \"successUrl\": \"<string>\",\n \"cancelUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"subscription": {
"id": "sub_abc123",
"organizationId": "<string>",
"customerId": "<string>",
"productId": "<string>",
"status": "INCOMPLETE",
"currentCycle": 123,
"totalCycles": 123,
"trialEndAt": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true,
"currentCycleDueAt": "2023-11-07T05:31:56Z",
"renewalAttempt": 123,
"nextRenewalAttemptAt": "2023-11-07T05:31:56Z",
"lastDeclineCategory": "SOFT",
"priceCents": "1999",
"currency": "EUR",
"quantity": 3,
"taxInclusive": true,
"purchaseAsBusiness": true,
"externalRef": "<string>",
"endedAt": "2023-11-07T05:31:56Z",
"endReason": "CANCELED_BY_CUSTOMER",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"product": {
"id": "pro_abc123",
"name": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"status": "ACTIVE",
"priceCents": "<string>",
"currency": "<string>",
"recurringInterval": "DAY",
"recurringIntervalCount": 123,
"recurringCycleCount": 123,
"trialDurationCount": 123,
"trialDurationUnit": "DAY",
"adjustableQuantity": true,
"adjustableMin": 123,
"adjustableMax": 123
},
"customer": {
"id": "cus_abc123",
"email": "jsmith@example.com"
}
},
"scheduledChange": {
"id": "ssc_abc123",
"type": "UPGRADE",
"targetPriceId": "pro_9m2k1x8s7d6f",
"targetQuantity": 123,
"targetProduct": {
"id": "pro_abc123",
"name": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"status": "ACTIVE",
"priceCents": "<string>",
"currency": "<string>",
"recurringInterval": "DAY",
"recurringIntervalCount": 123,
"recurringCycleCount": 123,
"trialDurationCount": 123,
"trialDurationUnit": "DAY",
"adjustableQuantity": true,
"adjustableMin": 123,
"adjustableMax": 123
},
"scheduledFor": "2023-11-07T05:31:56Z",
"appliedAt": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z"
},
"applied": true,
"payment": {
"rail": "card",
"id": "pay_abc123",
"organizationId": "<string>",
"customerId": "<string>",
"productId": "<string>",
"subscriptionId": "<string>",
"status": "PENDING",
"paymentMethodCategory": "CARD",
"declineCode": "<string>",
"declineCategory": "SOFT",
"declineAdvice": "TRY_AGAIN_LATER",
"declineNetworkCode": "<string>",
"threeDSecureResult": "AUTHENTICATED",
"displayName": "<string>",
"displayDescription": "<string>",
"displayImageUrl": "<string>",
"priceCents": "<string>",
"currency": "<string>",
"tokenAmount": "<string>",
"tokenFeeAmount": "<string>",
"quoteFiatAmountCents": 123,
"quoteFiatCurrency": "<string>",
"grossAmountCents": 123,
"platformFeeCents": 123,
"merchantNetCents": 123,
"vatAmountCents": 123,
"vatRateBps": 123,
"taxInclusive": true,
"fxSurchargeCents": 123,
"internationalCardSurchargeCents": 123,
"rollingReserveCents": 123,
"refundedAmountCents": 123,
"refundedAt": "2023-11-07T05:31:56Z",
"cryptoSettlementMode": "<string>",
"settlementChainId": 123,
"settlementAsset": "<string>",
"settlementRecipient": "<string>",
"depositAddress": "<string>",
"settlementTxHash": "<string>",
"lifiTxHash": "<string>",
"lifiSubstatus": "<string>",
"successUrl": "<string>",
"cancelUrl": "<string>",
"externalRef": "<string>",
"paymentReceivedAt": "2023-11-07T05:31:56Z",
"paymentSettledAt": "2023-11-07T05:31:56Z",
"paymentConfirmedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"statusTimeline": [
{
"status": "PENDING",
"at": "2023-11-07T05:31:56Z"
}
],
"items": [
{
"productId": "<string>",
"name": "<string>",
"quantity": 123,
"unitPriceCents": 123
}
],
"asset": {
"chainId": 123,
"chainName": "<string>",
"chainLogoUrl": "<string>",
"symbol": "<string>",
"decimals": 123,
"address": "<string>",
"logoUrl": "<string>"
},
"settlementChain": {
"chainId": 123,
"name": "<string>",
"logoUrl": "<string>"
},
"deposit": {
"expected": "<string>",
"received": "<string>",
"remaining": "<string>",
"confirmations": {
"observed": 123,
"required": 123,
"detectedAt": "2023-11-07T05:31:56Z"
},
"warnings": [
{
"code": "INSUFFICIENT_DEPOSIT_AMOUNT",
"message": "<string>",
"data": {}
}
]
}
},
"actionUrl": "<string>"
},
"message": "<string>"
}{
"success": false,
"error": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found",
"data": "<unknown>"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found",
"data": "<unknown>"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found",
"data": "<unknown>"
}Authorizations
Secret API key. sk_live_… (production) or sk_sandbox_… (sandbox).
Headers
Optional key (≤255 chars, e.g. a UUID v4) making this POST safe to retry · the response is cached 24h and a retry with the SAME key replays it instead of re-executing. The same key with a different body → 422 IDEMPOTENCY_KEY_CONFLICT; a retry while the first is in flight → 409.
255"5f3b9c2e-1a4d-4f2b-9c31-7e2a1b6d8c04"
Path Parameters
"sub_abc123"
Body
productId, quantity, or both.
Target plan. Omitted = current plan.
"pro_9m2k1x8s7d6f"
Units to hold afterwards (absolute, not a delta).
1 <= x <= 9993
auto: increase now, decrease at period end.
auto, now, period_end delta charges the prorated difference; none charges nothing.
delta, none Charge the subscription's saved card. false, or a method + card, uses a fresh card.
Fresh card only.
CARD, APPLE_PAY, GOOGLE_PAY Show child attributes
Show child attributes
Redirect after actionUrl succeeds (full page). Omitted: a confirmation page.
Redirect after actionUrl fails.
Was this page helpful?

