> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getruba.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Operate Existing Subscriptions

> Change the commercial terms, timing, and end state of a subscription that already exists.

export const RubaSocials = () => {
  if (typeof document === "undefined") {
    return null;
  }
  const inject = () => {
    const footer = document.getElementById("footer");
    if (!footer || document.getElementById("ruba-socials")) {
      return false;
    }
    const isDark = document.querySelector("html.dark") || document.querySelector('html[class*="dark"]');
    const lineColor = isDark ? "#383838" : "#e8e8ed";
    const iconColor = isDark ? "#8e8e93" : "#86868b";
    const markColor = isDark ? "#ffffff" : "#08080c";
    const hoverColor = "#0071e3";
    const div = document.createElement("div");
    div.id = "ruba-socials";
    div.style.cssText = `display:flex;align-items:center;gap:20px;padding-top:20px;margin-top:20px;border-top:1px solid ${lineColor};width:100%`;
    const logo = `<a href="https://getruba.com" style="display:inline-flex;height:24px;align-items:center;gap:8px;text-decoration:none;color:${markColor};line-height:1;"><svg width="24" height="24" viewBox="0 0 120 120" aria-hidden="true" style="display:block;flex:none;"><g transform="translate(2.5 0)"><path d="M19 25h59L65.43 47H19a4 4 0 0 1-4-4V29a4 4 0 0 1 4-4Z" fill="${markColor}"/><path d="M19 73h31.57L38 95H19a4 4 0 0 1-4-4V77a4 4 0 0 1 4-4Z" fill="${markColor}"/><path d="M85 25h25L70 95H45Z" fill="#007AFF"/></g></svg><span style="display:inline-flex;height:24px;align-items:center;font-weight:600;font-size:15px;color:${markColor};letter-spacing:-0.01em;line-height:1;">Ruba</span></a>`;
    const spacer = `<div style="flex:1"></div>`;
    const ig = `<a href="https://instagram.com/getruba" target="_blank" rel="noopener" aria-label="Instagram" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"/><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"/><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"/></svg></a>`;
    const li = `<a href="https://linkedin.com/company/getruba" target="_blank" rel="noopener" aria-label="LinkedIn" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"/><rect x="2" y="9" width="4" height="12"/><circle cx="4" cy="4" r="2"/></svg></a>`;
    const x = `<a href="https://x.com/getruba" target="_blank" rel="noopener" aria-label="X" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>`;
    const github = `<a href="https://github.com/rubadot" target="_blank" rel="noopener" aria-label="GitHub" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 .7a11.5 11.5 0 0 0-3.64 22.4c.58.1.79-.25.79-.56v-2.24c-3.22.7-3.9-1.37-3.9-1.37-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.71.08-.71 1.16.08 1.78 1.2 1.78 1.2 1.04 1.77 2.72 1.26 3.38.96.1-.75.4-1.26.74-1.55-2.57-.3-5.27-1.29-5.27-5.69 0-1.26.45-2.29 1.19-3.09-.12-.29-.52-1.47.11-3.05 0 0 .97-.31 3.16 1.18A10.96 10.96 0 0 1 12 6.09c.98 0 1.94.13 2.86.39 2.2-1.49 3.16-1.18 3.16-1.18.63 1.58.23 2.76.11 3.05.74.8 1.19 1.83 1.19 3.09 0 4.42-2.7 5.39-5.28 5.68.42.36.79 1.06.79 2.14v3.28c0 .31.21.67.8.56A11.5 11.5 0 0 0 12 .7Z"/></svg></a>`;
    div.innerHTML = logo + spacer + ig + li + x + github;
    footer.appendChild(div);
    return true;
  };
  if (!document.documentElement.dataset.rubaSocialsObserver) {
    document.documentElement.dataset.rubaSocialsObserver = "true";
    const observer = new MutationObserver(() => {
      if (!document.getElementById("ruba-socials")) {
        inject();
      }
    });
    observer.observe(document.body, {
      childList: true,
      subtree: true
    });
  }
  setTimeout(() => {
    if (!inject()) {
      const interval = setInterval(() => {
        if (inject()) {
          clearInterval(interval);
        }
      }, 500);
      setTimeout(() => clearInterval(interval), 10000);
    }
  }, 300);
  return null;
};

<link rel="stylesheet" href="/style.css" />

<RubaSocials />

Subscription operations are available under **Sales → Subscriptions** and through [Change Subscription](/api-reference/subscriptions/update). The Customer Portal exposes only the actions allowed by your [portal configuration](/features/customer-portal/settings).

## Change the plan

A plan change points the subscription at another recurring catalog item. Before sending it, check four boundaries:

1. **Currency must match.** The destination item must support the currency already locked to the subscription.
2. **Cancellation must be cleared.** A canceled or pending-cancellation subscription cannot change plan until it is uncanceled.
3. **Custom prices are excluded.** Pay-what-you-want items cannot be selected as the destination.
4. **Seat conversion is one-way.** A non-seat subscription may become seat-based; a seat-based subscription cannot become non-seat. The billing customer becomes a `team` customer and claims a seat during that conversion.

The selected [proration behavior](/features/subscriptions/proration) decides timing. `invoice` and `prorate` change the product now; `next_period` schedules it for renewal. A non-seat to seat conversion must happen immediately.

If the subscription is trialing, the trial start remains anchored to its original date while the end is recalculated from the destination item. A destination with no usable trial ends the trial and opens a paid billing period immediately.

```bash Change product theme={"system"}
curl --request PATCH \
  --url https://api.getruba.com/v1/subscriptions/{subscription_id} \
  --header 'Authorization: Bearer <TOKEN>' \
  --header 'Content-Type: application/json' \
  --data '{
    "product_id": "<new_product_id>",
    "proration_behavior": "prorate"
  }'
```

## Change the number of seats

For a [member-priced subscription](/features/seat-based-pricing), send the quantity the customer should pay for. `invoice` and `prorate` apply it immediately; `next_period` leaves the current quantity in place until renewal.

```bash Change seat quantity theme={"system"}
curl --request PATCH \
  --url https://api.getruba.com/v1/subscriptions/{subscription_id} \
  --header 'Authorization: Bearer <TOKEN>' \
  --header 'Content-Type: application/json' \
  --data '{ "seats": 25, "proration_behavior": "invoice" }'
```

## Apply or change a discount

Set `discount_id` to attach another [discount](/features/discounts), or send `null` to remove the current one. The new discount state begins with the next billing cycle; Ruba does not recalculate the period already underway.

```json Subscription update theme={"system"}
{ "discount_id": "<discount_id>" }
```

## Manage the trial

The `trial_end` field controls both extension and conversion:

* Send a future timestamp to add or extend trialing access. An active subscription moves to `trialing`, and its next payment waits for that timestamp.
* Send `"now"` to close the trial. The subscription becomes active and begins a new paid billing period immediately.

```json Trial update theme={"system"}
{ "trial_end": "2026-06-01T00:00:00Z" }
```

## Reschedule the next renewal

Set `current_billing_period_end` to a future timestamp when the current paid period should run longer or renew on another date. Canceled subscriptions cannot be rescheduled.

```json Billing-period update theme={"system"}
{ "current_billing_period_end": "2026-07-15T00:00:00Z" }
```

## Cancel or revoke

Ruba separates stopping the next renewal from stopping access now.

### Keep access through the paid term

Set `cancel_at_period_end` to `true`. Ruba records the pending cancellation, generates no order after the current period, and leaves benefits active until `current_period_end`.

```json Period-end cancellation theme={"system"}
{
  "cancel_at_period_end": true,
  "customer_cancellation_reason": "too_expensive"
}
```

You may also store a customer-provided comment. The accepted reason values are `too_expensive`, `missing_features`, `switched_service`, `unused`, `customer_service`, `low_quality`, `too_complex`, and `other`.

<Note>
  A cancellation comment is visible in the customer’s purchase history. Store
  only words the customer actually supplied, never internal support notes.
</Note>

### Remove access immediately

Delete the subscription to revoke it. Ruba changes its state to `canceled`, records `ended_at`, and revokes benefits immediately. Revocation does not issue a refund; use the [refund flow](/features/refunds) separately when money should also be returned.

```bash Immediate revocation theme={"system"}
curl --request DELETE \
  --url https://api.getruba.com/v1/subscriptions/{subscription_id} \
  --header 'Authorization: Bearer <TOKEN>'
```

This action cannot be undone.

### Resume a pending cancellation

Before the paid term ends, send `cancel_at_period_end: false`. Ruba clears the cancellation timestamps and returns the subscription to normal renewal. An already-ended subscription cannot be resumed.

## What customers can do

| Portal action                      | Availability                                                |
| ---------------------------------- | ----------------------------------------------------------- |
| Cancel at period end               | Always available.                                           |
| Replace the default payment method | Always available.                                           |
| Change plan                        | Available when plan changes are enabled in portal settings. |
| Change seat quantity               | Available when seat management is enabled.                  |

Immediate revocation, discount changes, trial editing, and renewal rescheduling remain merchant-only operations.
