Лояльность · Изменение
Клиенты · Рефералы · Программа · Создание
customer_referral_program_create
Попробуйте три запроса
Подготовить
- Вы указываетеGroupid
- ПомощникПодготовка
- Вы получаетеПредпросмотр
Запрос в чат
Подготовь «Клиенты / Рефералы / Программа / Создание». Для изменения нужны groupId, program. Покажи объект и ожидаемый эффект до выполнения.
- groupId
- Параметр
- program
- Параметр
Применить
- Вы указываетеСогласованные значения
- ПомощникОдин вызов
- Вы получаетеОтвет операции
Запрос в чат
На учебной записи подготовь «Клиенты / Рефералы / Программа / Создание» с параметром groupId = DEMO-101. Покажи остальные обязательные значения и выполни действие, когда согласованы все поля.
- groupId
- DEMO-101
- expectedRevision
- 4
Проверить итог
- Вы указываетеИсходный ответ
- ПомощникСверка результата
- Вы получаетеПодтверждение
Запрос в чат
Проверь результат «Клиенты / Рефералы / Программа / Создание» по исходному ответу. Покажи groupId, версия записи. Объясни, чем подтвердить эффект для выбранного объекта.
- До измененияПрочитать версию
- При записиПередать выбранную версию
- После ответаПеречитать объект
Как работает действие
Этот вызов может изменить рабочие данные. Согласуйте точный объект, новые значения и ожидаемый результат. Присвойте операции стабильный requestId. При повторе той же операции используйте прежний ключ и те же значения. Прочитайте актуальную версию записи перед подготовкой запроса.
Описание разработчика
Create a referral program on an existing native customer group. Conditions include currency, minimum total, paid/completed event, locations, order types, attribution window, reward frequency, fixed bonus points or percentage rewards credited as bonus points for either recipient. Zero amounts permit attribution only. The exact revision and an atomic original request receipt are required; existing group loyalty settings are preserved.
Параметры запроса
- groupId
- Exact existing native customer group ID; this also identifies its referral program. обязательно по схеме · string
- expectedRevision
- Версия, прочитанная перед изменением. обязательно по схеме · integer · минимум 0 · максимум 9007199254740991
- program
- Complete referral conditions; existing group loyalty settings remain unchanged. обязательно по схеме · object
- requestId
- Ключ этой операции. Для повтора с теми же аргументами сохраните исходное значение. обязательно по схеме · string
Что вернёт команда
- groupId
- Exact existing native customer group ID; this also identifies its referral program. обязательно по схеме · string
- revision
- Current native referral record revision. обязательно по схеме · integer · минимум 0 · максимум 9007199254740991
- program
- Complete referral conditions; existing group loyalty settings remain unchanged. обязательно по схеме · object / null
- legacyRecommendationPoints
- Existing group recomendbonus setting, or null. It is preserved by these operations. обязательно по схеме · number / null
Поля и технические схемы

Вход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"groupId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "Exact existing native customer group ID; this also identifies its referral program."
},
"expectedRevision": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Exact current revision returned by the corresponding read action."
},
"program": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"description": "Owner-visible program name."
},
"enabled": {
"type": "boolean",
"description": "Permit new links and new Order attribution. Existing committed conditions retain their history."
},
"attributionDays": {
"default": 30,
"description": "Days from first captured visit during which an Order can bind this referral.",
"type": "integer",
"minimum": 1,
"maximum": 90
},
"startsAt": {
"default": null,
"description": "Optional UTC Unix milliseconds when new attribution begins; null has no lower bound.",
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"endsAt": {
"default": null,
"description": "Optional UTC Unix milliseconds when new attribution ends; null has no upper bound.",
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"rewardEvent": {
"default": "paid",
"description": "Require full native payment, or both full payment and a completed native status.",
"type": "string",
"enum": [
"paid",
"completed"
]
},
"frequency": {
"default": "oncePerCustomer",
"description": "Reward only the first qualifying Order for a customer/program pair, or explicitly reward each attributed Order.",
"type": "string",
"enum": [
"oncePerCustomer",
"eachOrder"
]
},
"minimumOrderAmount": {
"default": 0,
"description": "Minimum native Order total in the exact configured currency; no currency conversion.",
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"currency": {
"type": "string",
"minLength": 1,
"maxLength": 12,
"description": "Exact native Order currency marker, for example USD or $. Must match the Order."
},
"orderTypes": {
"minItems": 1,
"maxItems": 4,
"type": "array",
"items": {
"type": "string",
"enum": [
"pickup",
"delivery",
"atplace",
"catering"
]
},
"description": "Eligible native fulfillment types."
},
"locationIds": {
"default": [],
"description": "Eligible company establishment IDs; empty means all company establishments.",
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "Exact native company-owned record identifier."
}
},
"referrerPoints": {
"default": 0,
"description": "Bonus points for the inviting customer after conditions qualify. Zero disables this side’s reward.",
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"referredPoints": {
"default": 0,
"description": "Bonus points for the referred customer. Both rewards may be zero for attribution only.",
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"referrerRewardType": {
"description": "Inviter reward: fixed bonus points (legacy default) or a percentage of the fully paid native Order total, credited as bonus points.",
"type": "string",
"enum": [
"fixed",
"percent"
]
},
"referrerPercent": {
"description": "Inviter percentage from 0 to 100, up to two decimals. Used only with referrerRewardType percent. Excludes tips; no money payout or currency conversion.",
"type": "number",
"minimum": 0,
"maximum": 100
},
"referredRewardType": {
"description": "Buyer reward: fixed bonus points (legacy default) or a percentage of the fully paid native Order total, credited as bonus points.",
"type": "string",
"enum": [
"fixed",
"percent"
]
},
"referredPercent": {
"description": "Buyer percentage from 0 to 100, up to two decimals. Used only with referredRewardType percent.",
"type": "number",
"minimum": 0,
"maximum": 100
}
},
"required": [
"name",
"enabled",
"attributionDays",
"startsAt",
"endsAt",
"rewardEvent",
"frequency",
"minimumOrderAmount",
"currency",
"orderTypes",
"locationIds",
"referrerPoints",
"referredPoints"
],
"additionalProperties": false,
"description": "Complete referral conditions; existing group loyalty settings remain unchanged."
},
"requestId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{8,128}$",
"description": "Stable identifier for this exact request; retry or recover unchanged after uncertainty."
}
},
"required": [
"groupId",
"expectedRevision",
"program",
"requestId"
],
"additionalProperties": false
}Выход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"groupId": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "Exact existing native customer group ID; this also identifies its referral program."
},
"revision": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Current native referral record revision."
},
"program": {
"anyOf": [
{
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"description": "Owner-visible program name."
},
"enabled": {
"type": "boolean",
"description": "Permit new links and new Order attribution. Existing committed conditions retain their history."
},
"attributionDays": {
"default": 30,
"description": "Days from first captured visit during which an Order can bind this referral.",
"type": "integer",
"minimum": 1,
"maximum": 90
},
"startsAt": {
"default": null,
"description": "Optional UTC Unix milliseconds when new attribution begins; null has no lower bound.",
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"endsAt": {
"default": null,
"description": "Optional UTC Unix milliseconds when new attribution ends; null has no upper bound.",
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"rewardEvent": {
"default": "paid",
"description": "Require full native payment, or both full payment and a completed native status.",
"type": "string",
"enum": [
"paid",
"completed"
]
},
"frequency": {
"default": "oncePerCustomer",
"description": "Reward only the first qualifying Order for a customer/program pair, or explicitly reward each attributed Order.",
"type": "string",
"enum": [
"oncePerCustomer",
"eachOrder"
]
},
"minimumOrderAmount": {
"default": 0,
"description": "Minimum native Order total in the exact configured currency; no currency conversion.",
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"currency": {
"type": "string",
"minLength": 1,
"maxLength": 12,
"description": "Exact native Order currency marker, for example USD or $. Must match the Order."
},
"orderTypes": {
"minItems": 1,
"maxItems": 4,
"type": "array",
"items": {
"type": "string",
"enum": [
"pickup",
"delivery",
"atplace",
"catering"
]
},
"description": "Eligible native fulfillment types."
},
"locationIds": {
"default": [],
"description": "Eligible company establishment IDs; empty means all company establishments.",
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "Exact native company-owned record identifier."
}
},
"referrerPoints": {
"default": 0,
"description": "Bonus points for the inviting customer after conditions qualify. Zero disables this side’s reward.",
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"referredPoints": {
"default": 0,
"description": "Bonus points for the referred customer. Both rewards may be zero for attribution only.",
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"referrerRewardType": {
"description": "Inviter reward: fixed bonus points (legacy default) or a percentage of the fully paid native Order total, credited as bonus points.",
"type": "string",
"enum": [
"fixed",
"percent"
]
},
"referrerPercent": {
"description": "Inviter percentage from 0 to 100, up to two decimals. Used only with referrerRewardType percent. Excludes tips; no money payout or currency conversion.",
"type": "number",
"minimum": 0,
"maximum": 100
},
"referredRewardType": {
"description": "Buyer reward: fixed bonus points (legacy default) or a percentage of the fully paid native Order total, credited as bonus points.",
"type": "string",
"enum": [
"fixed",
"percent"
]
},
"referredPercent": {
"description": "Buyer percentage from 0 to 100, up to two decimals. Used only with referredRewardType percent.",
"type": "number",
"minimum": 0,
"maximum": 100
}
},
"required": [
"name",
"enabled",
"attributionDays",
"startsAt",
"endsAt",
"rewardEvent",
"frequency",
"minimumOrderAmount",
"currency",
"orderTypes",
"locationIds",
"referrerPoints",
"referredPoints"
],
"additionalProperties": false
},
{
"type": "null"
}
],
"description": "Complete referral conditions; existing group loyalty settings remain unchanged."
},
"legacyRecommendationPoints": {
"description": "Existing group recomendbonus setting, or null. It is preserved by these operations.",
"type": [
"number",
"null"
]
}
},
"required": [
"groupId",
"revision",
"program",
"legacyRecommendationPoints"
],
"additionalProperties": false
}