Подписки · Планы · Сохранение
subscriptions_plan_save
Попробуйте три запроса
- Вы указываетеPlanid
- ПомощникПодготовка
- Вы получаетеПредпросмотр
Подготовь «Подписки / Планы / Сохранение». Для изменения нужны изменяемые поля, planId. Покажи объект и ожидаемый эффект до выполнения.
- values
- Изменяемые поля
- planId
- Параметр
- expectedLegacyRevision
- Параметр
- Вы указываетеСогласованные значения
- ПомощникОдин вызов
- Вы получаетеОтвет операции
На учебной записи подготовь «Подписки / Планы / Сохранение» с параметром values.kind = products_services. Покажи остальные обязательные значения и выполни действие, когда согласованы все поля.
- values.kind
- products_services
- values.name
- Осенняя коллекция
- values.currency
- USD
- Вы указываетеИсходный ответ
- ПомощникСверка результата
- Вы получаетеПодтверждение
Проверь результат «Подписки / Планы / Сохранение» по исходному ответу. Покажи результат. Объясни, чем подтвердить эффект для выбранного объекта.
- До измененияПрочитать версию
- При записиПередать выбранную версию
- После ответаПеречитать объект
Как работает действие
Этот вызов может изменить рабочие данные. Согласуйте точный объект, новые значения и ожидаемый результат. Присвойте операции стабильный requestId. При повторе той же операции используйте прежний ключ и те же значения. Прочитайте актуальную версию записи перед подготовкой запроса.
Описание разработчика
Create or replace a reviewed company subscription plan at expectedRevision (0 for new). For a physical variant use deliveryPricing=variant_discount, deliveryDiscountPercent, deliveryVariant, and the half-up net pack amountCents. Company app/site plans may set values.benefits={currency,productPrices:[{productId,priceMinor}],freeDelivery}. Benefits change future orders for all eligible subscribers. Omit benefits to keep them. Existing Stripe subscribers keep their recurring price. No provider charge, warmup or public storefront change.
Параметры запроса
- planId
- planId необязательно · string
- expectedRevision
- Версия, прочитанная перед изменением. обязательно по схеме · integer · минимум 0 · максимум 9007199254740991
- expectedLegacyRevision
- expectedLegacyRevision необязательно · string
- values
- Значения для записи. Состав и вложенность указаны в схеме. обязательно по схеме · object
- requestId
- Ключ этой операции. Для повтора с теми же аргументами сохраните исходное значение. обязательно по схеме · string
Что вернёт команда
- result
- Verified native company subscription result; no credentials or payment intent secrets. обязательно по схеме · object
Поля и технические схемы

Вход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"planId": {
"description": "planId",
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$"
},
"expectedRevision": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "expectedRevision"
},
"expectedLegacyRevision": {
"description": "expectedLegacyRevision",
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"values": {
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"products_services",
"company_platform"
],
"description": "kind"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"description": "name"
},
"description": {
"default": "",
"description": "description",
"type": "string",
"maxLength": 2000
},
"amountCents": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 99999999,
"description": "amountCents"
},
"currency": {
"type": "string",
"pattern": "^[A-Z]{3}$",
"description": "currency"
},
"interval": {
"type": "string",
"enum": [
"day",
"week",
"month",
"year"
],
"description": "interval"
},
"intervalCount": {
"default": 1,
"description": "intervalCount",
"type": "integer",
"minimum": 1,
"maximum": 12
},
"trialDays": {
"default": 0,
"description": "trialDays",
"type": "integer",
"minimum": 0,
"maximum": 730
},
"trialRequiresPaymentMethod": {
"default": true,
"description": "trialRequiresPaymentMethod",
"type": "boolean"
},
"allowCancel": {
"default": true,
"description": "allowCancel",
"type": "boolean"
},
"allowImmediateCancel": {
"default": false,
"description": "allowImmediateCancel",
"type": "boolean"
},
"allowResume": {
"default": true,
"description": "allowResume",
"type": "boolean"
},
"active": {
"default": true,
"description": "active",
"type": "boolean"
},
"productIds": {
"default": [],
"description": "productIds",
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "Company catalog product or service ID."
}
},
"platformKey": {
"default": null,
"description": "platformKey",
"anyOf": [
{
"type": "string",
"pattern": "^[a-z0-9][a-z0-9_.-]{0,79}$"
},
{
"type": "null"
}
]
},
"autoAttach": {
"default": true,
"description": "autoAttach",
"type": "boolean"
},
"benefits": {
"description": "benefits",
"type": "object",
"properties": {
"currency": {
"type": "string",
"pattern": "^[A-Z]{3}$",
"description": "Currency of subscriber product prices; may differ from the Stripe plan currency."
},
"productPrices": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"productId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "productId"
},
"priceMinor": {
"type": "integer",
"minimum": 0,
"maximum": 99999999,
"description": "priceMinor"
}
},
"required": [
"productId",
"priceMinor"
],
"additionalProperties": false
},
"description": "productPrices"
},
"variantPrices": {
"description": "Subscriber prices for exact catalog variants. Provide the parent product, option set, and selected variant product. An empty list clears variant prices.",
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"productId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "productId"
},
"optionSetId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "optionSetId"
},
"optionProductId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "optionProductId"
},
"priceMinor": {
"type": "integer",
"minimum": 0,
"maximum": 99999999,
"description": "priceMinor"
}
},
"required": [
"productId",
"optionSetId",
"optionProductId",
"priceMinor"
],
"additionalProperties": false
}
},
"freeDelivery": {
"type": "boolean",
"description": "freeDelivery"
}
},
"required": [
"currency",
"productPrices",
"freeDelivery"
],
"additionalProperties": false
},
"recurringDelivery": {
"description": "recurringDelivery",
"type": "boolean"
},
"deliveryPricing": {
"description": "catalog uses regular catalog lines; plan_base replaces only the parent price and adds options. variant_discount discounts the parent plus one required pack together, before shipping and tax. Requires deliveryVariant and deliveryDiscountPercent.",
"type": "string",
"enum": [
"catalog",
"plan_base",
"variant_discount"
]
},
"deliveryDiscountPercent": {
"description": "Whole percent off the combined catalog price of the parent and one selected pack. Set amountCents to the net unit price rounded half up to cents. The server checks it on enrollment and retains the agreed price for renewals.",
"type": "integer",
"minimum": 1,
"maximum": 99
},
"deliveryVariant": {
"description": "Required exact native option for a physical delivery plan. Null clears the selection.",
"anyOf": [
{
"type": "object",
"properties": {
"productId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "productId"
},
"optionSetId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "optionSetId"
},
"optionProductId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "optionProductId"
}
},
"required": [
"productId",
"optionSetId",
"optionProductId"
],
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"required": [
"kind",
"name",
"description",
"amountCents",
"currency",
"interval",
"intervalCount",
"trialDays",
"trialRequiresPaymentMethod",
"allowCancel",
"allowImmediateCancel",
"allowResume",
"active",
"productIds",
"platformKey",
"autoAttach"
],
"additionalProperties": false,
"description": "values"
},
"requestId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{8,128}$",
"description": "requestId"
}
},
"required": [
"expectedRevision",
"values",
"requestId"
],
"additionalProperties": false
}Выход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"result": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"$ref": "#/$defs/__schema0"
},
"description": "Verified native company subscription result; no credentials or payment intent secrets."
}
},
"required": [
"result"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/__schema0"
}
},
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"$ref": "#/$defs/__schema0"
}
}
]
}
}
}