Quote an offer: payment methods, instalments and totals
GET /v1/offers/{id}/checkout
Quote an offer: payment methods, instalments and totals
GET/v1/offers/{id}/checkout
Autenticação
- Chave públicapk_…, pode ir para o navegador
- Chave secretask_…, só no seu servidor
Envie a chave no cabeçalho Authorization: Bearer <chave>.
Parâmetros
idstring · path (uuid)obrigatóriocouponstring · queryorder_bump_idsstring · queryComma-separated order bump ids.
Resposta
200OK
objectstringobrigatórioValores:
offer_checkoutoffer_idstring (uuid)obrigatóriocurrencystringobrigatórioValores:
BRLsubtotalintegerobrigatórioInteger cents.
couponobjectpode ser nullobrigatórioPresent when `coupon` was sent.
Mostrar campos de
couponcodestringobrigatóriostatusstringobrigatórioValores:
appliedinvalid
order_bumpsarray of objectobrigatórioMostrar campos de
order_bumpsidstring (uuid)obrigatóriotitlestringpode ser nullobrigatóriodescriptionstringpode ser nullobrigatórioimage_urlstringpode ser nullobrigatóriopriceintegerobrigatórioInteger cents.
original_priceintegerobrigatórioInteger cents.
selectedbooleanobrigatório
payment_methodsarray of objectobrigatórioWhat the first payment costs. A subscription offer is never paid by boleto nor with a free first payment.
Mostrar campos de
payment_methodsmethodstringobrigatórioValores:
cardpixboletodefault_installmentsintegerThe instalment count the checkout opens selected, by the offer's own rule: the smallest, the largest, or the largest up to the offer's interest-free count. Always one of `installments[].count`.
installmentsarray of objectMostrar campos de
installmentscountintegerobrigatóriototalintegerobrigatórioInteger cents.
installment_amountintegerobrigatórioInteger cents, rounded for display; `total` is what is charged.
interestintegerobrigatórioInteger cents.
totalintegerInteger cents.
subscriptionobjectpode ser nullobrigatórioOnly for `offer_type: subscription`. Each renewal is charged with the method of the first payment: a card is charged automatically, a pix renewal must be paid by the buyer. After the purchase, `GET /v1/subscriptions/{id}` answers the period and the next charge.
Mostrar campos de
subscriptioncyclesintegerobrigatórioRenewals after the first payment: the plan has `cycles + 1` payments, this charge and `cycles` renewals. Renewals are monthly, the first about a month after the purchase.
amountintegerobrigatórioInteger cents charged per renewal, with no coupon, method discount, interest or order bump.
customerobjectobrigatórioMostrar campos de
customerfieldsarray of stringobrigatóriodocument_typesarray of stringobrigatório`cpf` is always accepted.
custom_fieldsarray of objectobrigatórioMostrar campos de
custom_fieldsnamestringobrigatóriolabelstringobrigatóriotypestringobrigatóriorequiredbooleanobrigatóriooptionsarray of objectpode ser nullobrigatórioMostrar campos de
optionslabelstringobrigatóriovaluestringobrigatóriodefaultboolean
Erros
| 400 | The request path could not be decoded (`malformed_path`). |
| 401 | Missing or invalid key. |
| 404 | Not found, not yours, or not a well-formed id. |
| 422 | A query parameter is invalid (`invalid_param`), or the offer cannot be sold (`offer_unavailable`): a broken split rule, or a subscription offer with no valid cycles or renewal amount. |
| 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.