PaystationdocsPaystation

Create an offer ​

POST /v1/offers

Create an offer

POST/v1/offers

Autenticação

  • Chave secretask_…, só no seu servidor

Envie a chave no cabeçalho Authorization: Bearer <chave>.

Corpo da requisição

  • offer_idstringobrigatório
  • titlestringobrigatório
  • descriptionstringpode ser null
  • priceintegerobrigatório
  • payment_methodsarray of stringobrigatório

    Valores: cardpixboleto

  • installmentsinteger
  • offer_typestring

    Valores: defaultsubscription

  • subscriptionobject
    Mostrar campos de subscription
    • cyclesintegerobrigatório
    • amountinteger

Resposta

200The same offer was already created with this `offer_id`; nothing was written.

  • idstring (uuid)obrigatório
  • offer_idstringpode ser nullobrigatório
  • titlestringpode ser nullobrigatório
  • descriptionstringpode ser nullobrigatório
  • offer_typestringobrigatório
  • priceintegerpode ser nullobrigatório

    Integer cents: R$ 99,90 is `9990`.

  • payment_methodsarray of stringobrigatório

    Valores: cardpixboleto

  • document_typesarray of stringobrigatório

    `cpf` is always accepted.

  • subscriptionobjectpode ser nullobrigatório

    Only for `offer_type: subscription`. `GET /v1/offers/{id}/checkout` answers what the charge uses.

    Mostrar campos de subscription
    • cyclesintegerpode ser nullobrigatório

      Renewals after the first payment: the plan has `cycles + 1` payments. `null` or below 1: the offer cannot be sold.

    • amountintegerpode ser nullobrigatório

      Integer 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.

201OK

  • idstring (uuid)obrigatório
  • offer_idstringpode ser nullobrigatório
  • titlestringpode ser nullobrigatório
  • descriptionstringpode ser nullobrigatório
  • offer_typestringobrigatório
  • priceintegerpode ser nullobrigatório

    Integer cents: R$ 99,90 is `9990`.

  • payment_methodsarray of stringobrigatório

    Valores: cardpixboleto

  • document_typesarray of stringobrigatório

    `cpf` is always accepted.

  • subscriptionobjectpode ser nullobrigatório

    Only for `offer_type: subscription`. `GET /v1/offers/{id}/checkout` answers what the charge uses.

    Mostrar campos de subscription
    • cyclesintegerpode ser nullobrigatório

      Renewals after the first payment: the plan has `cycles + 1` payments. `null` or below 1: the offer cannot be sold.

    • amountintegerpode ser nullobrigatório

      Integer 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

401Missing or invalid key, or a public key (`secret_key_required`).
409An offer with this `offer_id` exists with other values or archived (`offer_exists`; `resource_id` is its id: update it instead), or more than one does (`offer_ambiguous`).
422The body is invalid (`invalid_param`, `unknown_parameter`), or this account serves its offers from its own webhook (`unsupported_integration`).
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.