# Confirm or cancel a subscription change

Operation / SDK: `update` · `Update`

Confirm or cancel a quoted subscription change.

Last updated: 2026-11-06

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

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

## Request

- **Credential**: Server Key (with `customerId`) or Customer Token, scope `billing:write`.
- **SDK**: JavaScript `createLongplayServer().update` · JavaScript `createLongplay().update` · Python `update` · Go `Update`
- **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/update" \
  -H "Authorization: Bearer $LONGPLAY_SERVER_KEY" \
  -H "X-Indiana-Protocol: 0.10" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "a8b14e0c-6576-49a4-812c-7a1587e55255",
  "customerId": "8b258f8b-4228-40fa-8d24-5b16428e686d"
}'
```

**TypeScript: update.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 update() {
  return longplay.update({
    operationId: "a8b14e0c-6576-49a4-812c-7a1587e55255",
    customerId: "8b258f8b-4228-40fa-8d24-5b16428e686d",
  });
}
```

**Request body: request.json**

```json
{
  "operationId": "a8b14e0c-6576-49a4-812c-7a1587e55255",
  "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"
  },
  "operation": {
    "operationId": "a8b14e0c-6576-49a4-812c-7a1587e55255",
    "membershipId": "5c22044b-a5dd-49fe-83bf-c52eff327451",
    "productVersionId": "8c489a1a-5542-44fe-8e80-da2f6a319d01",
    "status": "prepared",
    "timing": "immediate",
    "effectiveAt": "2026-10-03T12:00:00.000Z",
    "checkoutUrl": null,
    "executor": "indiana",
    "execution": null
  }
}
```

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

## Body parameters

**application/json**

- `operationId` (uuid, required): Business operation UUID. Subscription execution references operationId from previewAttach; balance refunds reference the original consumption.
- `customerId` (uuid, optional): The Customer's UUID.
- `intent` (enum, optional): Intent; see the allowed values. Values: `"confirm"`, `"cancel"`.
- `merchantConfirmation` (object, optional): What the caller accepts of frozen merchant terms; required when the terms need consent.
- `merchantConfirmation.quoteTermsDigest` (string, required): Digest of the terms the Customer saw; it must equal the frozen terms. pattern: ^[a-f0-9]{64}$
- `merchantConfirmation.consents` (array, required): Every consent the Customer accepted; it must exactly match the terms. maxItems: 20
- `merchantConfirmation.consents.reference` (string, required): Stable reference of this consent. minLength: 1 · maxLength: 200
- `merchantConfirmation.consents.version` (string, required): Version number. minLength: 1 · maxLength: 200

<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"`.
- `operation` (object | object, required): The operation: status, result and recovery details.
- `operation.operationId` (uuid | uuid, required): Business operation UUID. Subscription execution references operationId from previewAttach; balance refunds reference the original consumption.
- `operation.invoiceMode` (boolean, optional): Invoicing settings (optional).
- `operation.membershipId` (uuid | uuid, required): membership ID.
- `operation.productVersionId` (uuid | uuid, required): Product Version ID.
- `operation.featureQuantities` (object, optional): Prepaid Feature quantities by internal Feature ID.
- `operation.status` (enum | enum, required): Status; see the allowed values.
- `operation.timing` (enum | "store", required): Immediate or end-of-cycle timing, only for supported plan-change actions.
- `operation.effectiveAt` (date-time | date-time | null, required): Timestamp (ISO 8601).
- `operation.checkoutUrl` (uri | null | null, required): Payment page URL; empty when no redirect is needed.
- `operation.executor` (enum, optional): Executor; see the allowed values. Values: `"indiana"`, `"merchant"`.
- `operation.execution` (object | object | null, optional): Execution details.
- `operation.execution.provider` ("stripe" | "merchant", required): Payment provider; see the allowed values.
- `operation.execution.invoiceMode` (object, optional): Invoicing settings (optional).
- `operation.execution.invoiceMode.enabled` (boolean, required): Whether it is enabled.
- `operation.execution.invoiceMode.enable_plan_immediately` (boolean, optional): Whether to enable the Product immediately. default: false
- `operation.execution.invoiceMode.finalize` (boolean, optional): Whether to finalize immediately. default: true
- `operation.execution.invoiceMode.invoice_template_id` (string, optional): invoice template ID.
- `operation.execution.invoiceMode.net_terms_days` (integer, optional): Payment terms in days. max: 9007199254740991
- `operation.execution.executor` (enum | "merchant", required): Executor; see the allowed values.
- `operation.execution.accountId` (string, optional): Stripe account ID (`acct_…`). pattern: ^acct_[A-Za-z0-9]+$
- `operation.execution.subscriptionId` (string | uuid, required): Stripe subscription ID (`sub_…`).
- `operation.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"`.
- `operation.execution.update` (object | null, optional): Parameters for Stripe `subscriptions.update` on `subscriptionId` when `action` is `update`; otherwise `null`.
- `operation.execution.update.items` (array, required): List items. maxItems: 20
- `operation.execution.update.remove` (array, required): Items to remove. maxItems: 20
- `operation.execution.update.restoreItems` (array, optional): Items to restore. minItems: 1 · maxItems: 20
- `operation.execution.update.prorationBehavior` (enum, optional): Proration behavior; see the allowed values. Values: `"always_invoice"`, `"create_prorations"`, `"none"`.
- `operation.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
- `operation.execution.update.paymentBehavior` ("error_if_incomplete", optional): Payment behavior; see the allowed values.
- `operation.execution.update.cancelAtPeriodEnd` (boolean, optional): Whether it cancels at the end of the current period.
- `operation.execution.update.clearCancelAt` (true, optional): Timestamp (ISO 8601).
- `operation.execution.update.billingCycleAnchorNow` (true, optional): Whether to start a new billing cycle now.
- `operation.execution.update.metadata` (object, required): Custom key-value data.
- `operation.execution.cancel` (object | null, optional): When `action` is `cancel`: cancel the Stripe subscription immediately with `prorate: false` and `invoice_now: false`; otherwise `null`.
- `operation.execution.cancel.prorate` (false, required): Whether to prorate.
- `operation.execution.cancel.invoiceNow` (false, required): Whether to invoice now.
- `operation.execution.schedule` (object | null, optional): Schedule.
- `operation.execution.schedule.currentItems` (array, required): Current items. maxItems: 20
- `operation.execution.schedule.nextItems` (array, required): Items after the change. minItems: 1 · maxItems: 20
- `operation.execution.schedule.switchAt` (integer, required): Timestamp (ISO 8601). max: 9007199254740991
- `operation.execution.schedule.interval` (enum, required): Interval; see the allowed values. Values: `"week"`, `"month"`, `"year"`.
- `operation.execution.schedule.intervalCount` (integer, required): Stripe Price billing interval count, at most 52. min: 1 · max: 52
- `operation.execution.schedule.resetBillingCycleAnchor` (true, optional): Whether to reset the billing cycle anchor.
- `operation.execution.schedule.metadata` (object, required): Custom key-value data.
- `operation.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`.
- `operation.execution.release.schedule` (string, required): Stripe subscription ID (`sub_…`). pattern: ^sub_sched_[A-Za-z0-9]+$
- `operation.execution.expiresAt` (date-time | date-time, required): Expiry time (ISO 8601, UTC).
- `operation.execution.operationId` (uuid, optional): Business operation UUID. Subscription execution references operationId from previewAttach; balance refunds reference the original consumption.
- `operation.execution.customerId` (uuid, optional): The Customer's UUID.
- `operation.execution.configurationRevision` (integer, optional): Scan configuration revision. min: 0 · max: 9007199254740991
- `operation.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
- `operation.execution.currency` (string, optional): Currency code supported by the published price. pattern: ^[A-Z]{3}$
- `operation.execution.type` ("subscription_change", optional): Kind of original merchant instruction: purchase, subscription change or refund. It selects the frozen commercial parameters.
- `operation.execution.merchantSubscriptionId` (string, optional): Stable merchant-native subscription reference for this change. minLength: 1 · maxLength: 200
- `operation.execution.membershipId` (uuid, optional): membership ID.
- `operation.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"`.
- `operation.execution.supersedesOperationId` (uuid | null, optional): UUID of the original subscription-change operation superseded by this action; `null` when no operation is superseded.
- `operation.execution.change` (object | object | object | object | object | object, optional): The target of the change.
- `operation.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.
- `operation.execution.change.productVersionId` (uuid, optional): Product Version ID.
- `operation.execution.change.featureQuantities` (object, optional): Prepaid Feature quantities by internal Feature ID.
- `operation.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
- `operation.execution.change.quantity` (integer | integer, optional): Quantity (integer).
- `operation.execution.change.internal_feature_id` (uuid, optional): Feature ID.
- `operation.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"`).
- `operation.execution.timing` (enum, optional): Immediate or end-of-cycle timing, only for supported plan-change actions. Values: `"immediate"`, `"renewal"`.
- `operation.execution.effectiveAt` (date-time, optional): Timestamp (ISO 8601).
- `operation.execution.creditMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.execution.debitMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.execution.totalMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.execution.discountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.execution.discount` (object | null, optional): Discount.
- `operation.execution.discount.grantId` (uuid, required): grant ID.
- `operation.execution.discount.couponId` (uuid, required): Coupon UUID in the current App and environment.
- `operation.execution.discount.amountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.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"`.
- `operation.execution.discount.applicableProductIds` (array, optional): Merchant-native Product identifiers eligible for this offer in the current App and environment. minItems: 1 · maxItems: 100
- `operation.execution.discount.terms` (object | object, required): Terms.
- `operation.execution.discount.duration` (object | object | object, required): Duration.
- `operation.execution.taxMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.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"`.
- `operation.execution.lineItems` (array, optional): Line items. maxItems: 100
- `operation.execution.lineItems.priceId` (uuid, required): UUID of the catalog Price this line item bills; `price` is the Stripe Price bound to it.
- `operation.execution.lineItems.productVersionId` (uuid, required): Product Version ID.
- `operation.execution.lineItems.productId` (string, required): Product ID. minLength: 1 · maxLength: 200
- `operation.execution.lineItems.quantity` (integer, required): Quantity (integer). min: 0 · max: 1000000
- `operation.execution.lineItems.unitAmountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.execution.lineItems.totalMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.execution.lineItems.interval` (enum, required): Interval; see the allowed values. Values: `"week"`, `"month"`, `"year"`, `"one_off"`.
- `operation.execution.lineItems.intervalCount` (integer, required): Stripe Price billing interval count, at most 52. min: 1 · max: 52
- `operation.execution.lineItems.kind` (enum, required): Kind; see the allowed values. Values: `"fixed"`, `"prepaid"`, `"seat"`.
- `operation.execution.lineItems.tiers` (object | null, required): Price tiers.
- `operation.execution.removePriceIds` (array, optional): Longplay Price UUIDs to remove as part of the original subscription change. maxItems: 100
- `operation.execution.sourceLineItems` (array, optional): Frozen native subscription prices from before the change. Older quotes may omit them. minItems: 1 · maxItems: 100
- `operation.execution.sourceLineItems.priceId` (uuid, required): Longplay Price ID on the subscription before the change.
- `operation.execution.sourceLineItems.productVersionId` (uuid, required): Product Version ID.
- `operation.execution.sourceLineItems.productId` (string, required): Product ID. minLength: 1 · maxLength: 200
- `operation.execution.sourceLineItems.quantity` (integer, required): Quantity (integer). min: 1 · max: 1000000
- `operation.execution.sourceLineItems.unitAmountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.execution.sourceLineItems.totalMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.execution.sourceLineItems.interval` (enum, required): Interval; see the allowed values. Values: `"week"`, `"month"`, `"year"`, `"one_off"`.
- `operation.execution.sourceLineItems.intervalCount` (integer, required): Stripe Price billing interval count, at most 52. min: 1 · max: 52
- `operation.execution.sourceLineItems.kind` (enum, required): Kind; see the allowed values. Values: `"fixed"`, `"prepaid"`, `"seat"`.
- `operation.execution.sourceLineItems.tiers` (object | null, required): Price tiers.
- `operation.confirmedAt` (date-time | null, optional): Timestamp (ISO 8601).
- `operation.merchantExecution` (object | object | object | null, optional): Snapshot of the merchant's original execution, with separate payment, fulfillment and Longplay recording states.
- `operation.merchantExecution.operationId` (uuid | uuid | uuid, required): Business operation UUID. Subscription execution references operationId from previewAttach; balance refunds reference the original consumption.
- `operation.merchantExecution.customerId` (uuid | uuid | uuid, required): The Customer UUID.
- `operation.merchantExecution.merchantExecutionId` (string | string | string, required): Stable execution reference retained by the merchant for the original operation and reused when reading or recovering it.
- `operation.merchantExecution.fulfillmentStatus` (enum | enum | enum, required): Progress or outcome of native merchant fulfillment: not started, pending, applied, failed or not applicable.
- `operation.merchantExecution.recordingStatus` (enum | enum | enum, required): Progress of recording the execution result in Longplay. Payment and native fulfillment outcomes remain separate states.
- `operation.merchantExecution.updatedAt` (date-time | date-time | date-time, required): ISO 8601 UTC time of the last record update.
- `operation.merchantExecution.problem` (object | null | object | null | object | null, required): Problem recorded in this execution snapshot, including its phase, error code and recovery advice for the original operation; `null` when absent.
- `operation.merchantExecution.problem.phase` (enum | enum | enum, required): Phase affected by the problem: execution, payment, fulfillment or recording in Longplay.
- `operation.merchantExecution.problem.code` (enum | enum | enum, required): Structured API error code for this problem, interpreted with its phase and recovery advice for the original operation.
- `operation.merchantExecution.problem.reason` (enum | enum | enum, optional): Specific reason for this error. `RESULT_UNKNOWN` means the financial outcome is unconfirmed and requires recovery of the original operation.
- `operation.merchantExecution.problem.recovery` (enum | enum | enum, required): Next recovery action for the original operation. Follow `recover_operation` when the financial outcome is unconfirmed.
- `operation.merchantExecution.problem.retryable` (boolean | boolean | boolean, required): Whether the failed request can be retried under the supplied recovery action. It is `false` for `RESULT_UNKNOWN`; retain and recover the original operation.
- `operation.merchantExecution.pollAfterMs` (integer | null | integer | null | integer | null, required): Suggested delay in milliseconds before reading the same original operation again; `null` when no polling interval is supplied.
- `operation.merchantExecution.type` ("purchase" | "subscription_change" | "refund", required): Original operation represented by this execution snapshot: purchase, subscription change or refund.
- `operation.merchantExecution.merchantOrderId` (string | null, optional): Stable merchant order reference for the original purchase; `null` until the reference is available.
- `operation.merchantExecution.paymentStatus` (enum, optional): Payment progress or observed outcome of the original purchase. Fulfillment and Longplay recording have their own states. Values: `"not_started"`, `"pending"`, `"succeeded"`, `"not_required"`, `"failed"`, `"expired"`, `"unknown"`.
- `operation.merchantExecution.checkoutUrl` (uri | null, optional): Payment page URL; empty when no redirect is needed.
- `operation.merchantExecution.checkoutExpiresAt` (date-time | null, optional): Timestamp (ISO 8601).
- `operation.merchantExecution.status` (enum | enum, optional): Status; see the allowed values.
- `operation.merchantExecution.merchantSubscriptionId` (string, optional): Stable merchant-native subscription reference represented by this change snapshot. minLength: 1 · maxLength: 200
- `operation.merchantExecution.scheduledFor` (date-time | null, optional): ISO 8601 effective time of the scheduled original subscription change; `null` when its status is not scheduled.
- `operation.merchantExecution.nextAction` (object, optional): Optional payment handoff for the original subscription change, including the merchant-provided HTTPS payment page and its expiry. Reads and recovery keep it tied to the same original operation.
- `operation.merchantExecution.nextAction.type` ("redirect", required): Payment handoff type, always `redirect`: open the merchant-provided payment page for the original operation.
- `operation.merchantExecution.nextAction.url` (string, required): HTTPS address of the merchant's original payment page, used to complete payment or authentication for the original operation. Read the same original operation for the outcome. pattern: ^https:\/\/.*
- `operation.merchantExecution.nextAction.expiresAt` (date-time, required): Expiry time (ISO 8601, UTC).
- `operation.merchantExecution.merchantRefundId` (string | null, optional): Stable merchant reference for the original refund; `null` until available and required for a successful refund.
- `operation.problem` (object | null, optional): Structured problem blocking the original merchant operation, including its phase, error code and recovery advice; `null` when absent.
- `operation.problem.phase` (enum, required): Phase affected by the problem: execution, payment, fulfillment or recording in Longplay. Values: `"execution"`, `"payment"`, `"fulfillment"`, `"recording"`.
- `operation.problem.code` (enum, required): Structured API error code for this problem, interpreted with its phase and recovery advice for the original operation. Values: `"INVALID_PROTOCOL_VERSION"`, `"UNSUPPORTED_PROTOCOL_VERSION"`, `"PROTOCOL_RETIRED"`, `"UNAUTHENTICATED"`, `"FORBIDDEN"`, `"SCOPE_MISMATCH"`, `"INVALID_REQUEST"`, `"NOT_FOUND"`, `"CONFLICT"`, `"PAYLOAD_TOO_LARGE"`, `"RATE_LIMITED"`, `"SERVICE_UNAVAILABLE"`, `"NOT_CONFIGURED"`, `"CAPABILITY_UNAVAILABLE"`, `"INTERNAL_ERROR"`.
- `operation.problem.reason` (enum, optional): Specific reason for this error. `RESULT_UNKNOWN` means the financial outcome is unconfirmed and requires recovery of the original operation. Values: `"CAPABILITY_NOT_ENABLED"`, `"INTEGRATION_MISSING"`, `"PROVIDER_CREDENTIAL_REJECTED"`, `"PRICE_BINDING_REQUIRED"`, `"IDEMPOTENCY_CONFLICT"`, `"RESULT_UNKNOWN"`, `"STATE_CHANGED"`, `"IDENTITY_CONTEXT_CHANGED"`, `"CUSTOMER_BINDING_CONFLICT"`, `"RUN_CONTRACT_MISMATCH"`, `"OPERATION_IN_PROGRESS"`, `"FUNNEL_VERSION_RETIRED"`, `"FUNNEL_PAUSED"`.
- `operation.problem.recovery` (enum, required): Next recovery action for the original operation. Follow `recover_operation` when the financial outcome is unconfirmed. Values: `"fix_request"`, `"authenticate"`, `"check_permissions"`, `"check_scope"`, `"resolve_conflict"`, `"reload_state"`, `"retry_same_request"`, `"configure_integration"`, `"check_availability"`, `"upgrade_sdk"`, `"recover_operation"`, `"contact_support"`.
- `operation.problem.retryable` (boolean, required): Whether the failed request can be retried under the supplied recovery action. It is `false` for `RESULT_UNKNOWN`; retain and recover the original operation.
- `operation.quote` (object, optional): Quote.
- `operation.quote.merchantTerms` (object, optional): Terms the merchant prepared; when present they decide the money and recurring commitment.
- `operation.quote.merchantTerms.request` (object | object | object, required): Original preparation request, proving which selection these terms answer.
- `operation.quote.merchantTerms.requestDigest` (string, required): Canonical digest of the original preparation request. pattern: ^[a-f0-9]{64}$
- `operation.quote.merchantTerms.merchantQuoteId` (string, required): Merchant reference of this quote. minLength: 1 · maxLength: 200
- `operation.quote.merchantTerms.quoteTermsDigest` (string, required): Canonical digest of these terms; confirmation binds it and later terms cannot replace it. pattern: ^[a-f0-9]{64}$
- `operation.quote.merchantTerms.termsVersion` (string, required): Merchant terms version. minLength: 1 · maxLength: 200
- `operation.quote.merchantTerms.sourceRevisions` (array, required): Catalog or subscription revisions this quote is based on. maxItems: 100
- `operation.quote.merchantTerms.observedAt` (date-time, required): Timestamp (ISO 8601).
- `operation.quote.merchantTerms.expiresAt` (date-time, required): Expiry time (ISO 8601, UTC).
- `operation.quote.merchantTerms.currency` (string, required): Currency code supported by the published price. pattern: ^[A-Z]{3}$
- `operation.quote.merchantTerms.automaticTax` (boolean, required): Whether the merchant calculates tax automatically; unknown tax is never treated as zero.
- `operation.quote.merchantTerms.lines` (array, required): Line items. maxItems: 100
- `operation.quote.merchantTerms.subscriptionTerms` (object | null, required): Recurring commitment after this charge; null when not a subscription.
- `operation.quote.merchantTerms.subtotalMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: -200000000 · max: 200000000
- `operation.quote.merchantTerms.discountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 200000000
- `operation.quote.merchantTerms.nativeDiscountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 200000000
- `operation.quote.merchantTerms.discount` (object | null, optional): Discount.
- `operation.quote.merchantTerms.taxMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `operation.quote.merchantTerms.totalMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `operation.quote.merchantTerms.effectiveAt` (date-time | null, required): Timestamp (ISO 8601).
- `operation.quote.merchantTerms.expectedEffects` (array, required): Native effects the merchant promises, shown for confirmation; not a platform balance. maxItems: 100
- `operation.quote.merchantTerms.requiredConsents` (array, required): Merchant terms the user must accept before confirmation. maxItems: 20
- `operation.quote.carryOverBalances` (object, optional): Whether balances carry over on change.
- `operation.quote.carryOverBalances.enabled` (true, required): Whether it is enabled.
- `operation.quote.carryOverBalances.featureIds` (array, optional): Feature IDs. minItems: 1 · maxItems: 100
- `operation.quote.carryOverUsages` (object, optional): Whether usage carries over on change.
- `operation.quote.carryOverUsages.enabled` (true, required): Whether it is enabled.
- `operation.quote.carryOverUsages.featureIds` (array, optional): Feature IDs. minItems: 1 · maxItems: 100
- `operation.quote.operationId` (uuid, required): Business operation UUID. Subscription execution references operationId from previewAttach; balance refunds reference the original consumption.
- `operation.quote.membershipId` (uuid, required): membership ID.
- `operation.quote.productVersionId` (uuid, required): Product Version ID.
- `operation.quote.featureQuantities` (object, optional): Prepaid Feature quantities by internal Feature ID.
- `operation.quote.timing` (enum, required): Immediate or end-of-cycle timing, only for supported plan-change actions. Values: `"immediate"`, `"renewal"`.
- `operation.quote.effectiveAt` (date-time, required): Timestamp (ISO 8601).
- `operation.quote.expiresAt` (date-time, required): Expiry time (ISO 8601, UTC).
- `operation.quote.currency` (enum, required): Currency code supported by the published price. Values: `"USD"`, `"EUR"`, `"CNY"`, `"GBP"`, `"JPY"`, `"CAD"`, `"AUD"`, `"NZD"`, `"CHF"`, `"HKD"`, `"SGD"`, `"KRW"`, `"INR"`, `"BRL"`, `"MXN"`, `"TWD"`, `"THB"`, `"IDR"`, `"MYR"`, `"PHP"`, `"VND"`, `"ZAR"`, `"AED"`, `"SAR"`, `"SEK"`, `"NOK"`, `"DKK"`, `"PLN"`, `"CZK"`, `"HUF"`, `"ILS"`, `"TRY"`, `"RON"`.
- `operation.quote.creditMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.quote.debitMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.quote.discountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.quote.taxMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.quote.totalMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.quote.retainedProductVersionIds` (array, required): retained Product Version IDs. maxItems: 19
- `operation.quote.execution` (object | object, required): Execution details.
- `operation.quote.execution.provider` ("stripe" | "merchant", required): Payment provider; see the allowed values.
- `operation.quote.execution.invoiceMode` (object, optional): Invoicing settings (optional).
- `operation.quote.execution.executor` (enum | "merchant", required): Executor; see the allowed values.
- `operation.quote.execution.accountId` (string, optional): Stripe account ID (`acct_…`). pattern: ^acct_[A-Za-z0-9]+$
- `operation.quote.execution.subscriptionId` (string | uuid, required): Stripe subscription ID (`sub_…`).
- `operation.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"`.
- `operation.quote.execution.update` (object | null, optional): Parameters for Stripe `subscriptions.update` on `subscriptionId` when `action` is `update`; otherwise `null`.
- `operation.quote.execution.cancel` (object | null, optional): When `action` is `cancel`: cancel the Stripe subscription immediately with `prorate: false` and `invoice_now: false`; otherwise `null`.
- `operation.quote.execution.schedule` (object | null, optional): Schedule.
- `operation.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`.
- `operation.quote.execution.expiresAt` (date-time | date-time, required): Expiry time (ISO 8601, UTC).
- `operation.quote.execution.operationId` (uuid, optional): Business operation UUID. Subscription execution references operationId from previewAttach; balance refunds reference the original consumption.
- `operation.quote.execution.customerId` (uuid, optional): The Customer's UUID.
- `operation.quote.execution.configurationRevision` (integer, optional): Scan configuration revision. min: 0 · max: 9007199254740991
- `operation.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
- `operation.quote.execution.currency` (string, optional): Currency code supported by the published price. pattern: ^[A-Z]{3}$
- `operation.quote.execution.type` ("subscription_change", optional): Kind of original merchant instruction: purchase, subscription change or refund. It selects the frozen commercial parameters.
- `operation.quote.execution.merchantSubscriptionId` (string, optional): Stable merchant-native subscription reference for this change. minLength: 1 · maxLength: 200
- `operation.quote.execution.membershipId` (uuid, optional): membership ID.
- `operation.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"`.
- `operation.quote.execution.supersedesOperationId` (uuid | null, optional): UUID of the original subscription-change operation superseded by this action; `null` when no operation is superseded.
- `operation.quote.execution.change` (object | object | object | object | object | object, optional): The target of the change.
- `operation.quote.execution.timing` (enum, optional): Immediate or end-of-cycle timing, only for supported plan-change actions. Values: `"immediate"`, `"renewal"`.
- `operation.quote.execution.effectiveAt` (date-time, optional): Timestamp (ISO 8601).
- `operation.quote.execution.creditMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.quote.execution.debitMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.quote.execution.totalMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.quote.execution.discountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.quote.execution.discount` (object | null, optional): Discount.
- `operation.quote.execution.taxMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.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"`.
- `operation.quote.execution.lineItems` (array, optional): Line items. maxItems: 100
- `operation.quote.execution.removePriceIds` (array, optional): Longplay Price UUIDs to remove as part of the original subscription change. maxItems: 100
- `operation.quote.execution.sourceLineItems` (array, optional): Frozen native subscription prices from before the change. Older quotes may omit them. minItems: 1 · maxItems: 100
- `operation.authority` (object, optional): Execution authority for the original merchant operation, including App/environment, Customer, confirmation facts and the frozen commercial instruction.
- `operation.authority.scope` (object, required): The App and environment of this response. Headers only verify scope; they cannot switch key scope.
- `operation.authority.scope.projectId` (uuid, required): App ID bound to the credential.
- `operation.authority.scope.environmentId` (uuid, required): environment ID.
- `operation.authority.scope.environment` (enum, required): Separate data scope: sandbox or live. Values: `"sandbox"`, `"live"`.
- `operation.authority.operationId` (uuid, required): Business operation UUID. Subscription execution references operationId from previewAttach; balance refunds reference the original consumption.
- `operation.authority.customerId` (uuid, required): The Customer's UUID.
- `operation.authority.confirmedAt` (date-time | null, required): Timestamp (ISO 8601).
- `operation.authority.initialExecutionAllowed` (boolean, required): Whether current authority permits an initial dispatch of the original commercial instruction. When `false`, follow the original operation's state and recovery requirements.
- `operation.authority.instruction` (object | object | object, required): Original purchase, subscription-change or refund instruction bound to this authority. Retain its operationId, Customer and frozen commercial parameters.
- `operation.authority.instruction.provider` ("merchant" | "merchant" | "merchant", required): Payment provider; see the allowed values.
- `operation.authority.instruction.executor` ("merchant" | "merchant" | "merchant", required): Executor; see the allowed values.
- `operation.authority.instruction.operationId` (uuid | uuid | uuid, required): Business operation UUID. Subscription execution references operationId from previewAttach; balance refunds reference the original consumption.
- `operation.authority.instruction.customerId` (uuid | uuid | uuid, required): The Customer UUID.
- `operation.authority.instruction.configurationRevision` (integer | integer | integer, required): Scan configuration revision.
- `operation.authority.instruction.connectionRevision` (integer | integer | integer, required): Merchant connection revision bound to the original instruction. Execution must use the connection configuration authorized for that operation.
- `operation.authority.instruction.currency` (string | string | string, required): Currency code supported by the published price.
- `operation.authority.instruction.expiresAt` (date-time | date-time | date-time, required): Expiry time (ISO 8601, UTC).
- `operation.authority.instruction.type` ("purchase" | "subscription_change" | "refund", required): Kind of original merchant instruction bound to this authority: purchase, subscription change or refund.
- `operation.authority.instruction.mode` (enum | enum, optional): Mode; see the allowed values.
- `operation.authority.instruction.lineItems` (array | array, optional): Line items.
- `operation.authority.instruction.catalogAmountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.authority.instruction.nativeDiscountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.authority.instruction.discount` (object | null | object | null, optional): Discount.
- `operation.authority.instruction.trialPeriodDays` (integer | null, optional): Number of days.
- `operation.authority.instruction.automaticTax` (boolean, optional): Automatic-tax requirement frozen in this authorized purchase instruction, executed by the merchant's native payment flow.
- `operation.authority.instruction.subscriptionId` (uuid, optional): subscription ID.
- `operation.authority.instruction.merchantSubscriptionId` (string, optional): Stable merchant-native subscription reference bound to the original change instruction. minLength: 1 · maxLength: 200
- `operation.authority.instruction.membershipId` (uuid, optional): membership ID.
- `operation.authority.instruction.subscriptionAction` (enum, optional): Authorized action on the original subscription: update, cancel, schedule a future change or release an existing schedule. Values: `"update"`, `"cancel"`, `"schedule"`, `"release"`.
- `operation.authority.instruction.supersedesOperationId` (uuid | null, optional): UUID of the subscription-change operation explicitly superseded by this instruction; `null` when there is no supersession.
- `operation.authority.instruction.change` (object | object | object | object | object | object, optional): The target of the change.
- `operation.authority.instruction.timing` (enum, optional): Immediate or end-of-cycle timing, only for supported plan-change actions. Values: `"immediate"`, `"renewal"`.
- `operation.authority.instruction.effectiveAt` (date-time, optional): Timestamp (ISO 8601).
- `operation.authority.instruction.creditMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.authority.instruction.debitMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.authority.instruction.totalMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.authority.instruction.discountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.authority.instruction.taxMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.authority.instruction.proration` (enum, optional): Authorized proration policy: none, create prorations or invoice immediately. Values: `"none"`, `"create_prorations"`, `"always_invoice"`.
- `operation.authority.instruction.removePriceIds` (array, optional): Longplay Price UUIDs that this authorized subscription instruction removes. maxItems: 100
- `operation.authority.instruction.sourceLineItems` (array, optional): Frozen pre-change prices in the original subscription instruction. Older instructions may omit them. minItems: 1 · maxItems: 100
- `operation.authority.instruction.invoiceId` (uuid, optional): invoice ID.
- `operation.authority.instruction.merchantInvoiceId` (string, optional): Stable merchant-native Invoice reference bound to the original refund instruction. minLength: 1 · maxLength: 200
- `operation.authority.instruction.amountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.authority.instruction.entitlementAction` (enum, optional): Keep (`retain`) or revoke (`revoke`) access after the refund. Values: `"retain"`, `"revoke"`.
- `operation.authority.instruction.cancelSubscriptions` (array, optional): Subscriptions to cancel. maxItems: 100
- `operation.authority.merchantTerms` (object, optional): Merchant terms accepted for the original operation; execution uses these, never browser input.
- `operation.authority.merchantTerms.request` (object | object | object, required): Original preparation request, proving which selection these terms answer.
- `operation.authority.merchantTerms.requestDigest` (string, required): Canonical digest of the original preparation request. pattern: ^[a-f0-9]{64}$
- `operation.authority.merchantTerms.merchantQuoteId` (string, required): Merchant reference of this quote. minLength: 1 · maxLength: 200
- `operation.authority.merchantTerms.quoteTermsDigest` (string, required): Canonical digest of these terms; confirmation binds it and later terms cannot replace it. pattern: ^[a-f0-9]{64}$
- `operation.authority.merchantTerms.termsVersion` (string, required): Merchant terms version. minLength: 1 · maxLength: 200
- `operation.authority.merchantTerms.sourceRevisions` (array, required): Catalog or subscription revisions this quote is based on. maxItems: 100
- `operation.authority.merchantTerms.observedAt` (date-time, required): Timestamp (ISO 8601).
- `operation.authority.merchantTerms.expiresAt` (date-time, required): Expiry time (ISO 8601, UTC).
- `operation.authority.merchantTerms.currency` (string, required): Currency code supported by the published price. pattern: ^[A-Z]{3}$
- `operation.authority.merchantTerms.automaticTax` (boolean, required): Whether the merchant calculates tax automatically; unknown tax is never treated as zero.
- `operation.authority.merchantTerms.lines` (array, required): Line items. maxItems: 100
- `operation.authority.merchantTerms.subscriptionTerms` (object | null, required): Recurring commitment after this charge; null when not a subscription.
- `operation.authority.merchantTerms.subtotalMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: -200000000 · max: 200000000
- `operation.authority.merchantTerms.discountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 200000000
- `operation.authority.merchantTerms.nativeDiscountMinor` (integer, optional): Amount in the currency's minor unit, such as cents. min: 0 · max: 200000000
- `operation.authority.merchantTerms.discount` (object | null, optional): Discount.
- `operation.authority.merchantTerms.taxMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `operation.authority.merchantTerms.totalMinor` (integer | null, required): Amount in the currency's minor unit, such as cents.
- `operation.authority.merchantTerms.effectiveAt` (date-time | null, required): Timestamp (ISO 8601).
- `operation.authority.merchantTerms.expectedEffects` (array, required): Native effects the merchant promises, shown for confirmation; not a platform balance. maxItems: 100
- `operation.authority.merchantTerms.requiredConsents` (array, required): Merchant terms the user must accept before confirmation. maxItems: 20
- `operation.nativePurchase` (object | null, optional): Native purchase details.
- `operation.nativePurchase.type` ("native_purchase", required): Always `native_purchase`: complete the purchase in the App Store or Google Play using these terms.
- `operation.nativePurchase.receiptId` (uuid, required): receipt ID.
- `operation.nativePurchase.orderId` (uuid, required): order ID.
- `operation.nativePurchase.productVersionId` (uuid, required): Product Version ID.
- `operation.nativePurchase.provider` (enum, required): Payment provider; see the allowed values. Values: `"apple"`, `"google"`.
- `operation.nativePurchase.productId` (string, required): Product ID. minLength: 1 · maxLength: 255
- `operation.nativePurchase.productKind` (enum, required): Product kind; see the allowed values. Values: `"membership"`, `"credit_pack"`, `"lifetime"`.
- `operation.nativePurchase.replacement` (object | null, required): Replacement details.
- `operation.nativePurchase.replacement.sourceOrderId` (uuid, required): Order ID of the store purchase that this Product change replaces.
- `operation.nativePurchase.replacement.sourceProductId` (string, required): App Store or Google Play product ID of the subscription being replaced. minLength: 1 · maxLength: 255
- `operation.nativePurchase.replacement.policy` (enum, required): Policy. Values: `"apple_store"`, `"google_full_price"`.
- `operation.nativePurchase.replacement.sourceAccountTokens` (array, required): Source account tokens. maxItems: 50
- `operation.nativePurchase.appAccountToken` (uuid, optional): Apple `appAccountToken`.
- `operation.nativePurchase.obfuscatedAccountId` (string, optional): Google Play only: pass it as `obfuscatedAccountId` in the billing flow. It is a stable digest that identifies this Customer in this App and environment. minLength: 1 · maxLength: 64
- `operation.nativePurchase.obfuscatedProfileId` (uuid, optional): Google Play only: pass it as `obfuscatedProfileId` in the billing flow. It equals `orderId`, so the store purchase can be matched to this order.
- `operation.nativePurchase.basePlanId` (string, optional): Google Play base plan ID of the subscription to buy; present only for Google Play memberships. minLength: 1 · maxLength: 255
- `operation.nativePurchase.offerId` (string, optional): ID of an offer the Customer has claimed, for new purchases; existing subscriptions use setBillingCoupons. minLength: 1 · maxLength: 255
- `operation.nativePurchase.offerKind` (enum, required): Offer kind; see the allowed values. Values: `"none"`, `"introductory"`, `"promotional"`.
- `operation.nativePurchase.currency` (enum, required): Currency code supported by the published price. Values: `"USD"`, `"EUR"`, `"CNY"`, `"GBP"`, `"JPY"`, `"CAD"`, `"AUD"`, `"NZD"`, `"CHF"`, `"HKD"`, `"SGD"`, `"KRW"`, `"INR"`, `"BRL"`, `"MXN"`, `"TWD"`, `"THB"`, `"IDR"`, `"MYR"`, `"PHP"`, `"VND"`, `"ZAR"`, `"AED"`, `"SAR"`, `"SEK"`, `"NOK"`, `"DKK"`, `"PLN"`, `"CZK"`, `"HUF"`, `"ILS"`, `"TRY"`, `"RON"`.
- `operation.nativePurchase.catalogAmountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.nativePurchase.discountMinor` (integer, required): Amount in the currency's minor unit, such as cents. min: 0 · max: 100000000
- `operation.nativePurchase.trialDays` (integer | null, required): Trial days.
- `operation.nativePurchase.seatBundle` (array, required): Seat bundle. maxItems: 20
- `operation.nativePurchase.seatBundle.key` (string, required): Key of a seat license whose seats this store purchase includes; `quantity` is the number of seats. pattern: ^[a-z][a-z0-9_]{0,63}$
- `operation.nativePurchase.seatBundle.quantity` (integer, required): Quantity (integer). min: 1 · max: 10000
- `operation.nativePurchase.applePromotionalOffer` (object | null, required): Signed Apple promotional offer.
- `operation.nativePurchase.applePromotionalOffer.offerId` (string, required): ID of an offer the Customer has claimed, for new purchases; existing subscriptions use setBillingCoupons. minLength: 1 · maxLength: 255
- `operation.nativePurchase.applePromotionalOffer.keyId` (string, required): ID of the App Store Connect subscription key that signed this offer; pass it to StoreKit as `keyID` with `nonce`, `signature` and `timestamp`. minLength: 1 · maxLength: 255
- `operation.nativePurchase.applePromotionalOffer.nonce` (uuid, required): Nonce used for signing.
- `operation.nativePurchase.applePromotionalOffer.signature` (string, required): Signature. minLength: 1 · maxLength: 1024
- `operation.nativePurchase.applePromotionalOffer.timestamp` (integer, required): Timestamp. min: 0 · max: 9007199254740991

<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:write`. | `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 `operationId` 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)
