# Preview a subscription change quote

Operation / SDK: `previewUpdate` · `preview_update` · `PreviewUpdate`

Quote an upgrade, downgrade or cancellation effective immediately, at renewal or through the store.

Last updated: 2026-11-06

[Web version](https://www.longplayai.com/docs/api/preview-update)

<a id="request"></a>

## Request

- **Credential**: Server Key (with `customerId`) or Customer Token, scope `billing:read`.
- **SDK**: JavaScript `createLongplayServer().previewUpdate` · JavaScript `createLongplay().previewUpdate` · Python `preview_update` · Go `PreviewUpdate`
- **Success**: HTTP 200

> In `record_only` mode, the merchant must support the merchant bridge v4 `operation.prepare` command before Longplay can freeze a quote and produce `merchantTerms`. Submit the matching `merchantConfirmation` when confirming the quote.

- [Merchant-prepared quotes](https://www.longplayai.com/docs/guides/merchant-execution.md#prepared-terms)

The response shows example data.

**cURL: request.sh**

```bash
curl -X POST "$LONGPLAY_API_URL/api/v1/subscriptions/preview-update" \
  -H "Authorization: Bearer $LONGPLAY_SERVER_KEY" \
  -H "X-Indiana-Protocol: 0.10" \
  -H "Content-Type: application/json" \
  -d '{
  "requestId": "0f58d1f8-069f-4288-8ec1-4ed10af55b45",
  "membershipId": "5c22044b-a5dd-49fe-83bf-c52eff327451",
  "timing": "immediate",
  "change": {
    "type": "plan",
    "productVersionId": "8c489a1a-5542-44fe-8e80-da2f6a319d01"
  },
  "customerId": "8b258f8b-4228-40fa-8d24-5b16428e686d"
}'
```

**TypeScript: previewUpdate.ts**

```ts
import { createLongplayServer } from "@tinkerlandai/longplay-sdk/server";

const longplay = createLongplayServer({
  baseUrl: process.env.LONGPLAY_API_URL!,
  apiKey: process.env.LONGPLAY_SERVER_KEY!,
  scope: { projectId: process.env.LONGPLAY_PROJECT_ID!, environment: "sandbox" },
});

export async function previewUpdate() {
  return longplay.previewUpdate({
    requestId: "0f58d1f8-069f-4288-8ec1-4ed10af55b45",
    membershipId: "5c22044b-a5dd-49fe-83bf-c52eff327451",
    timing: "immediate",
    change: {
      type: "plan",
      productVersionId: "8c489a1a-5542-44fe-8e80-da2f6a319d01",
    },
    customerId: "8b258f8b-4228-40fa-8d24-5b16428e686d",
  });
}
```

**Request body: request.json**

```json
{
  "requestId": "0f58d1f8-069f-4288-8ec1-4ed10af55b45",
  "membershipId": "5c22044b-a5dd-49fe-83bf-c52eff327451",
  "timing": "immediate",
  "change": {
    "type": "plan",
    "productVersionId": "8c489a1a-5542-44fe-8e80-da2f6a319d01"
  },
  "customerId": "8b258f8b-4228-40fa-8d24-5b16428e686d"
}
```

**Response: response.json**

```json
{
  "requestId": "44f5fcb8-6ed8-41b8-818f-7571941c5fd5",
  "scope": {
    "projectId": "df5426d6-b335-403c-8f3e-b0f73d2e3511",
    "environment": "sandbox"
  },
  "quote": {
    "operationId": "a8b14e0c-6576-49a4-812c-7a1587e55255",
    "membershipId": "5c22044b-a5dd-49fe-83bf-c52eff327451",
    "productVersionId": "8c489a1a-5542-44fe-8e80-da2f6a319d01",
    "timing": "immediate",
    "effectiveAt": "2026-10-03T12:00:00.000Z",
    "expiresAt": "2099-01-01T00:00:00.000Z",
    "currency": "USD",
    "creditMinor": 0,
    "debitMinor": 0,
    "discountMinor": 0,
    "taxMinor": 0,
    "totalMinor": 0,
    "retainedProductVersionIds": [
      "f47a4552-a9ec-41f2-8426-0bff4d67ff51"
    ],
    "execution": {
      "provider": "stripe",
      "executor": "indiana",
      "accountId": "acct_1Example",
      "subscriptionId": "sub_1Example",
      "action": "cancel",
      "update": null,
      "cancel": {
        "prorate": false,
        "invoiceNow": false
      },
      "schedule": null,
      "release": null,
      "expiresAt": "2099-01-01T00:00:00.000Z"
    }
  }
}
```

<a id="parameters"></a>

## Body parameters

**application/json**

- `requestId` (uuid, required): Business request UUID. Reuse for retries of one operation; generate a new value for a new operation.
- `offerId` (uuid, optional): ID of an offer the Customer has claimed, for new purchases; existing subscriptions use setBillingCoupons.
- `invoiceMode` (object, optional): Invoicing settings (optional).
- `invoiceMode.enabled` (boolean, required): Whether it is enabled.
- `invoiceMode.enable_plan_immediately` (boolean, optional): Whether to enable the Product immediately. default: false
- `invoiceMode.finalize` (boolean, optional): Whether to finalize immediately. default: true
- `invoiceMode.invoice_template_id` (string, optional): invoice template ID.
- `invoiceMode.net_terms_days` (integer, optional): Payment terms in days. max: 9007199254740991
- `membershipId` (uuid, required): membership ID.
- `carryOverBalances` (object, optional): Whether balances carry over on change.
- `carryOverBalances.enabled` (true, required): Whether it is enabled.
- `carryOverBalances.featureIds` (array, optional): Feature IDs. minItems: 1 · maxItems: 100
- `carryOverUsages` (object, optional): Whether usage carries over on change.
- `carryOverUsages.enabled` (true, required): Whether it is enabled.
- `carryOverUsages.featureIds` (array, optional): Feature IDs. minItems: 1 · maxItems: 100
- `membershipIds` (array, optional): membership IDs. minItems: 1 · maxItems: 20
- `prorationBehavior` (enum, optional): Proration behavior; see the allowed values. Values: `"prorate_immediately"`, `"none"`, `"bill_difference"`.
- `timing` (enum, required): Immediate or end-of-cycle timing, only for supported plan-change actions. Values: `"immediate"`, `"renewal"`, `"store"`.
- `change` (object | object | object | object | object | object, required): The target of the change.
- `change.type` ("plan" | "seats" | "quantity" | "cancel" | "uncancel" | "billing_cycle", required): What to change: `plan` switches to `productVersionId`, `seats` sets the seat total of one license, `quantity` sets the prepaid pack count of one Feature, `cancel` ends the membership at renewal or immediately, `uncancel` undoes a pending cancellation or scheduled change, and `billing_cycle` moves the billing cycle anchor.
- `change.productVersionId` (uuid, optional): Product Version ID.
- `change.featureQuantities` (object, optional): Prepaid Feature quantities by internal Feature ID.
- `change.licenseKey` (string, optional): Key of the seat license in this membership to resize (`seats.key` from the purchase quote); `quantity` is the new seat total, including the included seats. minLength: 1 · maxLength: 64 · pattern: ^[a-z][a-z0-9_]*$
- `change.quantity` (integer | integer, optional): Quantity (integer).
- `change.internal_feature_id` (uuid, optional): Feature ID.
- `change.billingCycleAnchor` ("now" | integer, optional): `now` restarts the billing cycle immediately (with `timing: "immediate"`); a future Unix time in milliseconds starts the new cycle at that moment (with `timing: "renewal"`).
- `customerId` (uuid, optional): The Customer's UUID.

<a id="response"></a>

## Response fields

Every successful response includes `requestId` (this request's ID, for support) and `scope` (App and environment).

**HTTP 200 · application/json**

- `requestId` (uuid, required): UUID the server generated for this HTTP request; include it when reporting a problem. It is not your business requestId.
- `scope` (object, required): The App and environment of this response. Headers only verify scope; they cannot switch key scope.
- `scope.projectId` (string, required): App ID bound to the credential. minLength: 1
- `scope.environment` (enum, required): Separate data scope: sandbox or live. Values: `"sandbox"`, `"live"`.
- `quote` (object | object, required): Quote.
- `quote.merchantTerms` (object, optional): Terms the merchant prepared; when present they decide the money and recurring commitment.
- `quote.merchantTerms.request` (object | object | object, required): Original preparation request, proving which selection these terms answer.
- `quote.merchantTerms.request.subject` (object | object | object, required): App, environment and Customer bound to the original preparation request.
- `quote.merchantTerms.request.operationId` (uuid | uuid | uuid, required): Business operation UUID. Subscription execution references operationId from previewAttach; balance refunds reference the original consumption.
- `quote.merchantTerms.request.configurationRevision` (integer | integer | integer, required): Configuration revision bound to the original preparation request.
- `quote.merchantTerms.request.connectionRevision` (integer | integer | integer, required): Merchant connection revision at preparation; a changed connection requires new preparation.
- `quote.merchantTerms.request.expiresAt` (date-time | date-time | date-time, required): Expiry time (ISO 8601, UTC).
- `quote.merchantTerms.request.action` ("purchase" | "subscription_change" | "refund", required): Business action. Target fields and quantity requirements vary by action; see the request structure and example.
- `quote.merchantTerms.request.mode` (enum | enum, optional): Mode; see the allowed values.
- `quote.merchantTerms.request.currency` (string | string | string, required): Currency code supported by the published price.
- `quote.merchantTerms.request.items` (array, optional): List items. minItems: 1 · maxItems: 100
- `quote.merchantTerms.request.offerRefs` (array | array, optional): Merchant offer references included in this selection.
- `quote.merchantTerms.request.merchantSubscriptionId` (string, optional): Merchant subscription reference being changed. minLength: 1 · maxLength: 200
- `quote.merchantTerms.request.change` (object | object | object | object | object | object, optional): The target of the change.
- `quote.merchantTerms.request.timing` (enum, optional): Immediate or end-of-cycle timing, only for supported plan-change actions. Values: `"immediate"`, `"renewal"`.
- `quote.merchantTerms.request.proration` (enum, optional): Proration behavior selected for this plan change. Values: `"none"`, `"create_prorations"`, `"always_invoice"`.
- `quote.merchantTerms.request.merchantInvoiceId` (string, optional): Merchant Invoice reference being refunded. minLength: 1 · maxLength: 200
- `quote.merchantTerms.request.amountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. max: 200000000
- `quote.merchantTerms.request.entitlementAction` (enum, optional): Keep (`retain`) or revoke (`revoke`) access after the refund. Values: `"retain"`, `"revoke"`.
- `quote.merchantTerms.requestDigest` (string, required): Canonical digest of the original preparation request. pattern: ^[a-f0-9]{64}$
- `quote.merchantTerms.merchantQuoteId` (string, required): Merchant reference of this quote. minLength: 1 · maxLength: 200
- `quote.merchantTerms.quoteTermsDigest` (string, required): Canonical digest of these terms; confirmation binds it and later terms cannot replace it. pattern: ^[a-f0-9]{64}$
- `quote.merchantTerms.termsVersion` (string, required): Merchant terms version. minLength: 1 · maxLength: 200
- `quote.merchantTerms.sourceRevisions` (array, required): Catalog or subscription revisions this quote is based on. maxItems: 100
- `quote.merchantTerms.sourceRevisions.reference` (string, required): Reference of the data source behind the quote. minLength: 1 · maxLength: 200
- `quote.merchantTerms.sourceRevisions.revision` (string, required): Revision of the specific versioned resource; Customer profile updates have no revision. minLength: 1 · maxLength: 200
- `quote.merchantTerms.observedAt` (date-time, required): Timestamp (ISO 8601).
- `quote.merchantTerms.expiresAt` (date-time, required): Expiry time (ISO 8601, UTC).
- `quote.merchantTerms.currency` (string, required): Currency code supported by the published price. pattern: ^[A-Z]{3}$
- `quote.merchantTerms.automaticTax` (boolean, required): Whether the merchant calculates tax automatically; unknown tax is never treated as zero.
- `quote.merchantTerms.lines` (array, required): Line items. maxItems: 100
- `quote.merchantTerms.lines.merchantLineId` (string, required): Stable merchant-native invoice line reference, unique within the invoice. minLength: 1 · maxLength: 200
- `quote.merchantTerms.lines.merchantPriceId` (string | null, required): Merchant price reference of this line; null when none applies.
- `quote.merchantTerms.lines.quantity` (string, required): Quantity as a decimal string, avoiding floating-point error. pattern: ^(0|[1-9]\d{0,11})(\.\d{1,6})?$
- `quote.merchantTerms.lines.subtotalMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: -200000000 · max: 200000000
- `quote.merchantTerms.lines.discountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 200000000
- `quote.merchantTerms.lines.taxMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `quote.merchantTerms.lines.totalMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `quote.merchantTerms.subscriptionTerms` (object | null, required): Recurring commitment after this charge; null when not a subscription.
- `quote.merchantTerms.subscriptionTerms.items` (array, required): List items. minItems: 1 · maxItems: 100
- `quote.merchantTerms.subscriptionTerms.trial` (object | null, required): Trial.
- `quote.merchantTerms.subscriptionTerms.discount` (object | null, optional): Discount.
- `quote.merchantTerms.subscriptionTerms.discountExpiresAt` (date-time | null, optional): Timestamp (ISO 8601).
- `quote.merchantTerms.subscriptionTerms.initialAmountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.merchantTerms.subtotalMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: -200000000 · max: 200000000
- `quote.merchantTerms.discountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 200000000
- `quote.merchantTerms.nativeDiscountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 200000000
- `quote.merchantTerms.discount` (object | null, optional): Discount.
- `quote.merchantTerms.discount.grantId` (uuid, required): grant ID.
- `quote.merchantTerms.discount.couponId` (uuid, required): Coupon UUID in the current App and environment.
- `quote.merchantTerms.discount.amountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.merchantTerms.discount.applicationPolicy` (enum, optional): How this offer combines with native price discounts: replace the native discount, or stack this offer with it. Values: `"replace"`, `"stack_native"`.
- `quote.merchantTerms.discount.applicableProductIds` (array, optional): Merchant-native Product identifiers eligible for this offer in the current App and environment. minItems: 1 · maxItems: 100
- `quote.merchantTerms.discount.terms` (object | object, required): Terms.
- `quote.merchantTerms.discount.duration` (object | object | object, required): Duration.
- `quote.merchantTerms.taxMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `quote.merchantTerms.totalMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `quote.merchantTerms.effectiveAt` (date-time | null, required): Timestamp (ISO 8601).
- `quote.merchantTerms.expectedEffects` (array, required): Native effects the merchant promises, shown for confirmation; not a platform balance. maxItems: 100
- `quote.merchantTerms.expectedEffects.reference` (string, required): Stable reference of this expected effect. minLength: 1 · maxLength: 200
- `quote.merchantTerms.expectedEffects.kind` (enum, required): Kind; see the allowed values. Values: `"grant"`, `"revoke"`, `"change"`.
- `quote.merchantTerms.expectedEffects.description` (string, required): Description. minLength: 1 · maxLength: 1000
- `quote.merchantTerms.expectedEffects.quantity` (string | null, required): Quantity as a decimal string, avoiding floating-point error.
- `quote.merchantTerms.expectedEffects.unit` (string | null, required): Merchant unit of the quantity; null when no quantity applies.
- `quote.merchantTerms.requiredConsents` (array, required): Merchant terms the user must accept before confirmation. maxItems: 20
- `quote.merchantTerms.requiredConsents.reference` (string, required): Stable reference of this required consent. minLength: 1 · maxLength: 200
- `quote.merchantTerms.requiredConsents.version` (string, required): Version number. minLength: 1 · maxLength: 200
- `quote.merchantTerms.requiredConsents.summary` (string, required): Summary of the consent shown to the user. minLength: 1 · maxLength: 1000
- `quote.carryOverBalances` (object, optional): Whether balances carry over on change.
- `quote.carryOverBalances.enabled` (true, required): Whether it is enabled.
- `quote.carryOverBalances.featureIds` (array, optional): Feature IDs. minItems: 1 · maxItems: 100
- `quote.carryOverUsages` (object, optional): Whether usage carries over on change.
- `quote.carryOverUsages.enabled` (true, required): Whether it is enabled.
- `quote.carryOverUsages.featureIds` (array, optional): Feature IDs. minItems: 1 · maxItems: 100
- `quote.operationId` (uuid | uuid, required): Business operation UUID. Subscription execution references operationId from previewAttach; balance refunds reference the original consumption.
- `quote.membershipId` (uuid | uuid, required): membership ID.
- `quote.productVersionId` (uuid | uuid, required): Product Version ID.
- `quote.featureQuantities` (object, optional): Prepaid Feature quantities by internal Feature ID.
- `quote.timing` (enum | "store", required): Immediate or end-of-cycle timing, only for supported plan-change actions.
- `quote.effectiveAt` (date-time | null, required): Timestamp (ISO 8601).
- `quote.expiresAt` (date-time | date-time, required): Expiry time (ISO 8601, UTC).
- `quote.currency` (enum | enum, required): Currency code supported by the published price.
- `quote.creditMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `quote.debitMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `quote.discountMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `quote.taxMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `quote.totalMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `quote.retainedProductVersionIds` (array | array, required): retained Product Version IDs.
- `quote.execution` (object | object, optional): Execution details.
- `quote.execution.provider` ("stripe" | "merchant", required): Payment provider; see the allowed values.
- `quote.execution.invoiceMode` (object, optional): Invoicing settings (optional).
- `quote.execution.invoiceMode.enabled` (boolean, required): Whether it is enabled.
- `quote.execution.invoiceMode.enable_plan_immediately` (boolean, optional): Whether to enable the Product immediately. default: false
- `quote.execution.invoiceMode.finalize` (boolean, optional): Whether to finalize immediately. default: true
- `quote.execution.invoiceMode.invoice_template_id` (string, optional): invoice template ID.
- `quote.execution.invoiceMode.net_terms_days` (integer, optional): Payment terms in days. max: 9007199254740991
- `quote.execution.executor` (enum | "merchant", required): Executor; see the allowed values.
- `quote.execution.accountId` (string, optional): Stripe account ID (`acct_…`). pattern: ^acct_[A-Za-z0-9]+$
- `quote.execution.subscriptionId` (string | uuid, required): Stripe subscription ID (`sub_…`).
- `quote.execution.action` (enum, optional): Business action. Target fields and quantity requirements vary by action; see the request structure and example. Values: `"update"`, `"cancel"`, `"schedule"`, `"release"`.
- `quote.execution.update` (object | null, optional): Parameters for Stripe `subscriptions.update` on `subscriptionId` when `action` is `update`; otherwise `null`.
- `quote.execution.update.items` (array, required): List items. maxItems: 20
- `quote.execution.update.remove` (array, required): Items to remove. maxItems: 20
- `quote.execution.update.restoreItems` (array, optional): Items to restore. minItems: 1 · maxItems: 20
- `quote.execution.update.prorationBehavior` (enum, optional): Proration behavior; see the allowed values. Values: `"always_invoice"`, `"create_prorations"`, `"none"`.
- `quote.execution.update.prorationDate` (integer, optional): Unix time in seconds to send as Stripe `proration_date`, the moment Stripe calculates proration from; absent when the change is not prorated. max: 9007199254740991
- `quote.execution.update.paymentBehavior` ("error_if_incomplete", optional): Payment behavior; see the allowed values.
- `quote.execution.update.cancelAtPeriodEnd` (boolean, optional): Whether it cancels at the end of the current period.
- `quote.execution.update.clearCancelAt` (true, optional): Timestamp (ISO 8601).
- `quote.execution.update.billingCycleAnchorNow` (true, optional): Whether to start a new billing cycle now.
- `quote.execution.update.metadata` (object, required): Custom key-value data.
- `quote.execution.cancel` (object | null, optional): When `action` is `cancel`: cancel the Stripe subscription immediately with `prorate: false` and `invoice_now: false`; otherwise `null`.
- `quote.execution.cancel.prorate` (false, required): Whether to prorate.
- `quote.execution.cancel.invoiceNow` (false, required): Whether to invoice now.
- `quote.execution.schedule` (object | null, optional): Schedule.
- `quote.execution.schedule.currentItems` (array, required): Current items. maxItems: 20
- `quote.execution.schedule.nextItems` (array, required): Items after the change. minItems: 1 · maxItems: 20
- `quote.execution.schedule.switchAt` (integer, required): Timestamp (ISO 8601). max: 9007199254740991
- `quote.execution.schedule.interval` (enum, required): Interval; see the allowed values. Values: `"week"`, `"month"`, `"year"`.
- `quote.execution.schedule.intervalCount` (integer, required): Stripe Price billing interval count, at most 52. min: 1 · max: 52
- `quote.execution.schedule.resetBillingCycleAnchor` (true, optional): Whether to reset the billing cycle anchor.
- `quote.execution.schedule.metadata` (object, required): Custom key-value data.
- `quote.execution.release` (object | null, optional): When `action` is `release`: release the Stripe subscription schedule in `schedule` (`sub_sched_…`) that holds the pending change; otherwise `null`.
- `quote.execution.release.schedule` (string, required): Stripe subscription ID (`sub_…`). pattern: ^sub_sched_[A-Za-z0-9]+$
- `quote.execution.expiresAt` (date-time | date-time, required): Expiry time (ISO 8601, UTC).
- `quote.execution.operationId` (uuid, optional): Business operation UUID. Subscription execution references operationId from previewAttach; balance refunds reference the original consumption.
- `quote.execution.customerId` (uuid, optional): The Customer's UUID.
- `quote.execution.configurationRevision` (integer, optional): Scan configuration revision. min: 0 · max: 9007199254740991
- `quote.execution.connectionRevision` (integer, optional): Merchant connection revision frozen with this instruction, used to check that the original operation still uses the same connection configuration. min: 0 · max: 9007199254740991
- `quote.execution.currency` (string, optional): Currency code supported by the published price. pattern: ^[A-Z]{3}$
- `quote.execution.type` ("subscription_change", optional): Kind of original merchant instruction: purchase, subscription change or refund. It selects the frozen commercial parameters.
- `quote.execution.merchantSubscriptionId` (string, optional): Stable merchant-native subscription reference for this change. minLength: 1 · maxLength: 200
- `quote.execution.membershipId` (uuid, optional): membership ID.
- `quote.execution.subscriptionAction` (enum, optional): Action on the original subscription: update, cancel, schedule a future change or release an existing schedule. Values: `"update"`, `"cancel"`, `"schedule"`, `"release"`.
- `quote.execution.supersedesOperationId` (uuid | null, optional): UUID of the original subscription-change operation superseded by this action; `null` when no operation is superseded.
- `quote.execution.change` (object | object | object | object | object | object, optional): The target of the change.
- `quote.execution.change.type` ("cancel" | "uncancel" | "plan" | "seats" | "quantity" | "billing_cycle", required): What to change: `plan` switches to `productVersionId`, `seats` sets the seat total of one license, `quantity` sets the prepaid pack count of one Feature, `cancel` ends the membership at renewal or immediately, `uncancel` undoes a pending cancellation or scheduled change, and `billing_cycle` moves the billing cycle anchor.
- `quote.execution.change.productVersionId` (uuid, optional): Product Version ID.
- `quote.execution.change.featureQuantities` (object, optional): Prepaid Feature quantities by internal Feature ID.
- `quote.execution.change.licenseKey` (string, optional): Key of the seat license in this membership to resize (`seats.key` from the purchase quote); `quantity` is the new seat total, including the included seats. minLength: 1 · maxLength: 200
- `quote.execution.change.quantity` (integer | integer, optional): Quantity (integer).
- `quote.execution.change.internal_feature_id` (uuid, optional): Feature ID.
- `quote.execution.change.billingCycleAnchor` ("now" | integer, optional): `now` restarts the billing cycle immediately (with `timing: "immediate"`); a future Unix time in milliseconds starts the new cycle at that moment (with `timing: "renewal"`).
- `quote.execution.timing` (enum, optional): Immediate or end-of-cycle timing, only for supported plan-change actions. Values: `"immediate"`, `"renewal"`.
- `quote.execution.effectiveAt` (date-time, optional): Timestamp (ISO 8601).
- `quote.execution.creditMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.execution.debitMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.execution.totalMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.execution.discountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.execution.discount` (object | null, optional): Discount.
- `quote.execution.discount.grantId` (uuid, required): grant ID.
- `quote.execution.discount.couponId` (uuid, required): Coupon UUID in the current App and environment.
- `quote.execution.discount.amountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.execution.discount.applicationPolicy` (enum, optional): How this offer combines with native price discounts: replace the native discount, or stack this offer with it. Values: `"replace"`, `"stack_native"`.
- `quote.execution.discount.applicableProductIds` (array, optional): Merchant-native Product identifiers eligible for this offer in the current App and environment. minItems: 1 · maxItems: 100
- `quote.execution.discount.terms` (object | object, required): Terms.
- `quote.execution.discount.duration` (object | object | object, required): Duration.
- `quote.execution.taxMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.execution.proration` (enum, optional): Proration policy frozen for the original subscription change: none, create prorations or invoice immediately. The merchant executes that instruction. Values: `"none"`, `"create_prorations"`, `"always_invoice"`.
- `quote.execution.lineItems` (array, optional): Line items. maxItems: 100
- `quote.execution.lineItems.priceId` (uuid, required): UUID of the catalog Price this line item bills; `price` is the Stripe Price bound to it.
- `quote.execution.lineItems.productVersionId` (uuid, required): Product Version ID.
- `quote.execution.lineItems.productId` (string, required): Product ID. minLength: 1 · maxLength: 200
- `quote.execution.lineItems.quantity` (integer, required): Quantity (integer). min: 0 · max: 1000000
- `quote.execution.lineItems.unitAmountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.execution.lineItems.totalMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.execution.lineItems.interval` (enum, required): Interval; see the allowed values. Values: `"week"`, `"month"`, `"year"`, `"one_off"`.
- `quote.execution.lineItems.intervalCount` (integer, required): Stripe Price billing interval count, at most 52. min: 1 · max: 52
- `quote.execution.lineItems.kind` (enum, required): Kind; see the allowed values. Values: `"fixed"`, `"prepaid"`, `"seat"`.
- `quote.execution.lineItems.tiers` (object | null, required): Price tiers.
- `quote.execution.removePriceIds` (array, optional): Longplay Price UUIDs to remove as part of the original subscription change. maxItems: 100
- `quote.execution.sourceLineItems` (array, optional): Frozen native subscription prices from before the change. Older quotes may omit them. minItems: 1 · maxItems: 100
- `quote.execution.sourceLineItems.priceId` (uuid, required): Longplay Price ID on the subscription before the change.
- `quote.execution.sourceLineItems.productVersionId` (uuid, required): Product Version ID.
- `quote.execution.sourceLineItems.productId` (string, required): Product ID. minLength: 1 · maxLength: 200
- `quote.execution.sourceLineItems.quantity` (integer, required): Quantity (integer). min: 1 · max: 1000000
- `quote.execution.sourceLineItems.unitAmountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.execution.sourceLineItems.totalMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.execution.sourceLineItems.interval` (enum, required): Interval; see the allowed values. Values: `"week"`, `"month"`, `"year"`, `"one_off"`.
- `quote.execution.sourceLineItems.intervalCount` (integer, required): Stripe Price billing interval count, at most 52. min: 1 · max: 52
- `quote.execution.sourceLineItems.kind` (enum, required): Kind; see the allowed values. Values: `"fixed"`, `"prepaid"`, `"seat"`.
- `quote.execution.sourceLineItems.tiers` (object | null, required): Price tiers.
- `quote.store` (object, optional): Store terms of an App Store or Google Play Product change (`timing: "store"`): the provider, the new store product, its catalog price and the replacement policy; the store's payment sheet shows the amount due.
- `quote.store.provider` (enum, required): Payment provider; see the allowed values. Values: `"apple"`, `"google"`.
- `quote.store.productId` (string, required): Product ID. minLength: 1 · maxLength: 255
- `quote.store.catalogAmountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `quote.store.policy` (enum, required): Policy. Values: `"apple_store"`, `"google_full_price"`.

<a id="errors"></a>

## Errors

Failures return an error object; handle them by `error.code` and `error.recovery`. The table lists the errors that follow from this operation's credential, scope and idempotency fields; depending on the request it can also return `NOT_FOUND` (a referenced resource doesn't exist), `NOT_CONFIGURED` (a required integration isn't connected) or `PAYLOAD_TOO_LARGE`. Some refusals, such as insufficient balance, are not errors but a `reason` in a successful response.

**Possible errors**

| code | HTTP | When | recovery |
| --- | --- | --- | --- |
| `INVALID_REQUEST` | 400 | The request doesn't match this page's parameters. A missing or malformed protocol header returns `UNSUPPORTED_PROTOCOL_VERSION` or `INVALID_PROTOCOL_VERSION` instead. | `fix_request` |
| `UNAUTHENTICATED` | 401 | The credential is missing, invalid, expired or revoked. | `authenticate` |
| `FORBIDDEN` | 403 | The credential lacks `billing:read`. | `check_permissions` |
| `SCOPE_MISMATCH` | 403 | `X-Indiana-Project` or `X-Indiana-Environment` doesn't match the credential's App and environment. | `check_scope` |
| `CONFLICT` | 409 | The same `requestId` was sent with different input (`reason: IDEMPOTENCY_CONFLICT`). | `resolve_conflict` |
| `RATE_LIMITED` | 429 | Too many requests; wait for `Retry-After` and retry the same request. | `retry_same_request` |
| `SERVICE_UNAVAILABLE` | 503 | The service is temporarily unavailable; retry the same request. | `retry_same_request` |
| `INTERNAL_ERROR` | 500 | The outcome is unknown; read the original operation or replay the original ID and input. | `recover_operation` |

- [Error codes and recovery](https://www.longplayai.com/docs/api/errors.md)
- [Request conventions](https://www.longplayai.com/docs/api.md)
- [All operations](https://www.longplayai.com/docs/api/operations.md#commerce)
