APIReferênciaCupons e promoções
Criar cupom ou promoção
Cria um desconto em porcentagem ou valor, com prazo, limite de usos, gasto mínimo e produtos.
Permissão da chave: Catálogo › escrever.
bearerheader
AuthorizationBearer <chave de API>Chave de API da loja (Painel › Integrações › Chaves de API)
Idempotency-Key?stringChave única por operação (ex.: o id do pedido no seu sistema). Repetir a chamada com a mesma chave devolve a mesma resposta, sem duplicar.
Padrão (regex)
^[A-Za-z0-9._:-]+$Tamanho
8 <= length <= 255application/json- body
method*stringValor em
"AUTOMATIC""CODE"code?stringPadrão (regex)
^[A-Z0-9_-]{3,32}$name*stringTamanho
1 <= length <= 60kind*stringValor em
"PERCENT""FIXED"value*numberIntervalo
1 <= value <= 2147483647scope?stringValor em
"ALL""CATEGORIES""PRODUCTS"categoryIds?array<string>Itens
items <= 100productIds?array<string>Itens
items <= 500startsAt?stringendsAt?stringmaxUses?numberIntervalo
1 <= value <= 2147483647maxUsesPerCustomer?numberIntervalo
1 <= value <= 2147483647minSubtotal?customerId?stringrequiredProductIds?array<string>Itens
items <= 50startCommands?array<>Itens
items <= 5endCommands?array<>Itens
items <= 5active?booleancurl -X POST "https://api.rivoo.gg/v1/discounts" \ -H "Authorization: Bearer $RIVOO_API_KEY" \ -H "Idempotency-Key: pedido_123" \ -H "Content-Type: application/json" \ -d '{"method":"AUTOMATIC","name":"string","kind":"PERCENT","value":1}'Exemplo de resposta
Vazio