products.offer_save
Criar ou editar oferta. Sem id cria uma oferta nova (inativa); com id altera nome, preço (priceCents, mínimo 500), preço promocional (newPriceCents, menor que o preço) e recorrência. A oferta principal mantém o preço do produto no CRM.
- Endpoint:
POST https://app.atomiks.com.br/api/v1/products.offer_save(corpo JSON) - Quem pode chamar: administrador da conta
- Escopo da chave:
crm:write - Grava dados: sim
- Pela chave de API: sim
- Ferramenta MCP:
products_offer_save - Ficha em JSON:
https://app.atomiks.com.br/api/v1/openapi.json(operationIdproducts.offer_save)
Entrada
| Campo | Tipo | Obrigatório | Nota |
|---|---|---|---|
productId | string (uuid) | sim | |
id | string (uuid) | não | |
name | string | sim | |
priceCents | integer | sim | |
newPriceCents | integer | null | não | |
recurrence | object | null | não |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"productId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"priceCents": {
"type": "integer",
"minimum": 500,
"maximum": 9007199254740991
},
"newPriceCents": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"recurrence": {
"anyOf": [
{
"type": "object",
"properties": {
"frequency": {
"type": "string",
"enum": [
"monthly",
"quarterly",
"semi-annually",
"yearly"
]
},
"intervalMonths": {
"type": "integer",
"minimum": 1,
"maximum": 12
},
"trialDays": {
"type": "integer",
"minimum": 0,
"maximum": 180
}
},
"required": [
"frequency",
"intervalMonths",
"trialDays"
]
},
{
"type": "null"
}
]
}
},
"required": [
"productId",
"name",
"priceCents"
]
}Exemplo
curl -X POST https://app.atomiks.com.br/api/v1/products.offer_save \
-H "Authorization: Bearer $ATOMIKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"productId":"00000000-0000-0000-0000-000000000000","name":"Oferta de lançamento","priceCents":29700}'CLI:
node cli/atomiks.mjs products.offer_save --json '{"productId":"00000000-0000-0000-0000-000000000000","name":"Oferta de lançamento","priceCents":29700}'MCP: ferramenta products_offer_save com a mesma entrada.
Saída
Sucesso: {"data": ...} com o formato abaixo.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"productId": {
"type": "string"
},
"name": {
"type": "string"
},
"isMain": {
"type": "boolean"
},
"status": {
"type": "string",
"enum": [
"incomplete",
"ready_to_submit",
"approved",
"archived"
]
},
"priceCents": {
"type": "number"
},
"newPriceCents": {
"type": [
"number",
"null"
]
},
"recurrence": {
"anyOf": [
{
"type": "object",
"properties": {
"frequency": {
"type": "string",
"enum": [
"monthly",
"quarterly",
"semi-annually",
"yearly"
]
},
"intervalMonths": {
"type": "integer",
"minimum": 1,
"maximum": 12
},
"trialDays": {
"type": "integer",
"minimum": 0,
"maximum": 180
}
},
"required": [
"frequency",
"intervalMonths",
"trialDays"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"incompleteReason": {
"type": "array",
"items": {
"type": "string"
}
},
"hasCoupon": {
"type": "boolean"
},
"archived": {
"type": "boolean"
}
},
"required": [
"id",
"productId",
"name",
"isMain",
"status",
"priceCents",
"newPriceCents",
"recurrence",
"incompleteReason",
"hasCoupon",
"archived"
],
"additionalProperties": false
}Erros
{"error": {"code", "message", "requestId"}}. Códigos: invalid_input (400), unauthorized (401), forbidden / account_pending / scope_missing (403), not_found (404), limit_reached (409), internal (500).