PaystationdocsPaystation

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ório
  • couponstring · query
  • order_bump_idsstring · query

    Comma-separated order bump ids.

Resposta

200OK

  • objectstringobrigatório

    Valores: offer_checkout

  • offer_idstring (uuid)obrigatório
  • currencystringobrigatório

    Valores: BRL

  • subtotalintegerobrigatório

    Integer cents.

  • couponobjectpode ser nullobrigatório

    Present when `coupon` was sent.

    Mostrar campos de coupon
    • codestringobrigatório
    • statusstringobrigatório

      Valores: appliedinvalid

  • order_bumpsarray of objectobrigatório
    Mostrar campos de order_bumps
    • idstring (uuid)obrigatório
    • titlestringpode ser nullobrigatório
    • descriptionstringpode ser nullobrigatório
    • image_urlstringpode ser nullobrigatório
    • priceintegerobrigatório

      Integer cents.

    • original_priceintegerobrigatório

      Integer cents.

    • selectedbooleanobrigatório
  • payment_methodsarray of objectobrigatório

    What the first payment costs. A subscription offer is never paid by boleto nor with a free first payment.

    Mostrar campos de payment_methods
    • methodstringobrigatório

      Valores: cardpixboleto

    • default_installmentsinteger

      The 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 object
      Mostrar campos de installments
      • countintegerobrigatório
      • totalintegerobrigatório

        Integer cents.

      • installment_amountintegerobrigatório

        Integer cents, rounded for display; `total` is what is charged.

      • interestintegerobrigatório

        Integer cents.

    • totalinteger

      Integer cents.

  • subscriptionobjectpode ser nullobrigatório

    Only 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 subscription
    • cyclesintegerobrigatório

      Renewals 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ório

      Integer cents charged per renewal, with no coupon, method discount, interest or order bump.

  • customerobjectobrigatório
    Mostrar campos de customer
    • fieldsarray of stringobrigatório
    • document_typesarray of stringobrigatório

      `cpf` is always accepted.

    • custom_fieldsarray of objectobrigatório
      Mostrar campos de custom_fields
      • namestringobrigatório
      • labelstringobrigatório
      • typestringobrigatório
      • requiredbooleanobrigatório
      • optionsarray of objectpode ser nullobrigatório
        Mostrar campos de options
        • labelstringobrigatório
        • valuestringobrigatório
        • defaultboolean

Erros

400The request path could not be decoded (`malformed_path`).
401Missing or invalid key.
404Not found, not yours, or not a well-formed id.
422A 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.
429Rate limited.
500Unexpected 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.