Update one of your offers; only the fields sent change
POST /v1/offers/{id}
Update one of your offers; only the fields sent change
POST/v1/offers/{id}
Autenticação
- Chave secretask_…, só no seu servidor
Envie a chave no cabeçalho Authorization: Bearer <chave>.
Parâmetros
idstring · path (uuid)obrigatório
Corpo da requisição
offer_idstringoffer_typestringValores:
defaultsubscriptiontitlestringdescriptionstringpode ser nullpriceintegerpayment_methodsarray of stringValores:
cardpixboletoinstallmentsintegerstatusstringValores:
publishedarchivedsubscriptionobjectMostrar campos de
subscriptioncyclesintegeramountintegerpode ser null
Resposta
200OK
idstring (uuid)obrigatóriooffer_idstringpode ser nullobrigatóriotitlestringpode ser nullobrigatóriodescriptionstringpode ser nullobrigatóriooffer_typestringobrigatóriopriceintegerpode ser nullobrigatórioInteger cents: R$ 99,90 is `9990`.
payment_methodsarray of stringobrigatórioValores:
cardpixboletodocument_typesarray of stringobrigatório`cpf` is always accepted.
subscriptionobjectpode ser nullobrigatórioOnly for `offer_type: subscription`. `GET /v1/offers/{id}/checkout` answers what the charge uses.
Mostrar campos de
subscriptioncyclesintegerpode ser nullobrigatórioRenewals after the first payment: the plan has `cycles + 1` payments. `null` or below 1: the offer cannot be sold.
amountintegerpode ser nullobrigatórioInteger cents charged per renewal.
statusstringpode ser nullobrigatório`published` is sellable. A secret key also reads its offers in other statuses (`archived`, `draft`); a public key only `published` ones.
Erros
| 400 | The request path could not be decoded (`malformed_path`). |
| 401 | Missing or invalid key, or a public key (`secret_key_required`). |
| 404 | Not found, not yours, or not a well-formed id. |
| 422 | The body is invalid (`invalid_param`, `unknown_parameter`), the offer it leaves could not be sold (`invalid_param`, naming the field), its price would fall under an order bump that sells it (`invalid_param` on `price`; `resource_id` names that bump's main offer), or this account serves its offers from its own webhook (`unsupported_integration`). |
| 429 | Rate limited. |
| 500 | Unexpected error, or `api_unavailable`. |
Todo erro vem no mesmo envelope: error.type, error.code, error.message e error.request_id, também devolvido no cabeçalho X-Request-Id.