---
# @generated by sylphx-gen. Do not edit.
title: "Preview plan change on a customer subscription"
description: "`money.customer_subscriptions.preview_plan_change` (POST /v1/{name}:previewPlanChange): Quote a plan change without modifying the subscription."
type: reference
product: payments
summary: "Quote a plan change without modifying the subscription."
nav: false
---

Quote a plan change without modifying the subscription.

- **Path** `POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/customer_subscriptions/customer-subscription:previewPlanChange`
- **Scope** `billing:read`
- **Effect** `read` — nothing is written.
- **Collection** [customer_subscriptions](/docs/api/customer_subscriptions)

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The subscription to quote. Required. |
| `product` | `string` | The target catalog product key. Required. |
| `price` | `string` | The target recurring price key; optional if there is only one. |
| `proration_behavior` | `ProrationBehavior` | How the immediate change is billed. One of `create_prorations`, `none`, `always_invoice`. |
| `effective` | `PlanChangeEffective` | Apply now (default) or at the end of the current billing period. One of `immediate`, `period_end`. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `currency_code` | `string` | Upper-case ISO 4217 currency code. |
| `credit_minor` | `int64` | Credit from proration lines, as a nonnegative minor-unit amount. |
| `charge_minor` | `int64` | Charge from proration lines, or catalog unit price times quantity for a scheduled change (before processor discounts and tax). |
| `amount_due_now_minor` | `int64` | Amount payable now, in minor units. |
| `next_renewal_time` | `timestamp` | The quoted renewal time. |
| `effective` | `PlanChangeEffective` | When the plan change takes effect. One of `immediate`, `period_end`. |
| `effective_time` | `timestamp` | The quoted effective time. |
| `quote_token` | `string` | Pass unchanged to ChangePlan to require the same amount, currency and subscription state. Available for immediate always_invoice changes with no attached schedule. Short-lived; re-preview if the quote no longer matches. |

## Errors

- [`UNAUTHENTICATED`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`RESOURCE_NOT_FOUND`](/docs/api/errors/RESOURCE_NOT_FOUND) — The named Resource does not exist or is not visible.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`INVALID_STATE`](/docs/api/errors/INVALID_STATE) — The Resource is in a state that forbids the call.
- [`FAILED_PRECONDITION`](/docs/api/errors/FAILED_PRECONDITION) — A released manifest owns a requested resource field. Change the declaration in the named file and key path, then release.
- [`UNAVAILABLE`](/docs/api/errors/UNAVAILABLE) — The Resource store, the owning service's backend, or the key verifier's snapshot is unavailable; retry after Retry-After.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/customer_subscriptions/customer-subscription:previewPlanChange" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product":"…"}'
```

**TypeScript**

```ts
const response = await sylphx.money.customerSubscriptions.previewPlanChange({ name: 'orgs/acme/projects/shop/envs/production/customer_subscriptions/customer-subscription', product: '…' })
```

**Rust**

```rust
let mut req = sylphx::money::PreviewCustomerSubscriptionPlanChangeRequest::default();
req.name = "orgs/acme/projects/shop/envs/production/customer_subscriptions/customer-subscription".to_string();
req.product = "…".to_string();
let response = sx.money().customer_subscriptions().preview_plan_change(req).await?;
```

**CLI**

```bash
sylphx money customer-subscriptions preview-plan-change orgs/acme/projects/shop/envs/production/customer_subscriptions/customer-subscription
```

**MCP**

```json
{ "method_id": "money.customer_subscriptions.preview_plan_change", "args": {"name":"orgs/acme/projects/shop/envs/production/customer_subscriptions/customer-subscription","product":"…"} }
```
