Skip to main content
POST
Criar upsell
Requer o escopo upsells:write e o header HTTP Idempotency-Key. A oferta entra no funil do produto indicado em product_id, e esse funil é aberto quando o produto ainda não tem um.
Sem status no corpo, a oferta nasce published. A API antiga criava em draft, o que produzia ofertas que o funil pulava. Envie status: "draft" se você quer o comportamento antigo.accept_redirect e refuse_redirect não são aceitos e derrubam a requisição com 422. Eles continuam aparecendo na leitura da oferta; só não podem ser escritos por aqui.
Um product_id que não é da sua conta retorna 404, a mesma resposta de um produto que não existe.

Authorizations

Authorization
string
header
required

A chave de API da conta, no formato sk_{modo}_{prefixo}.{segredo}.

Headers

Idempotency-Key
string
required

Chave única da operação. Obrigatória em toda requisição que altera dados; sem ela a resposta é 422 idempotency_key_required. Um reenvio com a mesma chave e o mesmo corpo repete a resposta guardada.

Maximum string length: 255

Body

application/json

Body of POST /v2/public/upsells.

product_id is the product whose funnel the offer joins, which is what the source api meant by it (SHA 70cd772). It is not validated against the products table here: that table is Catalog's and this module may not query it. The write port checks the ownership and the controller answers 404, which also makes "not yours" and "does not exist" the same answer.

name
string
required
Maximum string length: 255
product_id
integer
required
Required range: x >= 1
status
enum<string> | null
Available options:
draft,
published,
null
Required range: x >= 1
accept_text
string | null
Maximum string length: 255
refuse_text
string | null
Maximum string length: 255
accept_page
string | null
Maximum string length: 500
refuse_page
string | null
Maximum string length: 500

Response

ApiUpsellResource

data
ApiUpsellResource · object
required