PaystationdocsPaystation

Refund a charge in full; a charge already refunding or refunded is answered as it is ​

POST /v1/charges/{id}/refund

Refund a charge in full; a charge already refunding or refunded is answered as it is

POST/v1/charges/{id}/refund

Autenticação

  • Chave secretask_…, só no seu servidor

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

Parâmetros

  • idstring · path (uuid)obrigatório

Resposta

200OK

  • idstring (uuid)obrigatório
  • objectstringobrigatório

    Valores: charge

  • statusstringobrigatório

    Valores: processingpendingpaidrefund_pendingrefundedchargedbackdeclined

  • amountintegerpode ser nullobrigatório

    Integer cents.

  • payment_methodstringobrigatório

    Valores: cardpixboleto

  • acquirerstringpode ser nullobrigatório
  • paymentobjectobrigatório

    Pix: `qr_code`, `expiration_at`. Boleto: `boleto_url`, `boleto_barcode`, `expiration_date`. Card: empty.

    Mostrar campos de payment
    • qr_codestring
    • expiration_atstring
    • boleto_urlstring
    • boleto_barcodestring
    • expiration_datestring
  • created_atstringpode ser nullobrigatório
  • customerobjectpode ser nullobrigatório

    Masked unless the key is secret; always masked on creation.

    Mostrar campos de customer
    • namestringpode ser nullobrigatório
    • emailstringpode ser nullobrigatório
    • documentstringpode ser nullobrigatório
    • document_typestringpode ser nullobrigatório

      Valores: cpfcnpjpassport

    • phonestringpode ser nullobrigatório
  • subscriptionstringpode ser null

    The subscription this purchase opened (`sub_…`), or `null`. Answered on creation and on `GET /v1/charges/{id}` only.

  • metadataobjectpode ser null

    The `metadata` sent on creation, or `null`. Answered on creation and to the secret key; left out of a public key's reads.

Erros

400The request path could not be decoded (`malformed_path`).
401Missing or invalid key, or a public key (`secret_key_required`).
404No such charge (`charge_not_found`).
409Not paid (`charge_not_refundable`), charged back (`charge_disputed`), a refund already in progress (`refund_in_progress`), or it opened a subscription still being created (`subscription_processing`) or still active (`subscription_active`).
422A body was sent (`unknown_parameter`), a boleto (`payment_method_not_refundable`), past the refund window (`refund_window_expired`), or declined by the acquirer (`refund_declined`).
429Rate limited.
500Unexpected error, or `api_unavailable`.
502The refund may or may not have been made (`refund_outcome_unknown`). If it was, a later notice from the acquirer moves the charge to `refund_pending` or `refunded`, which can take hours.
503The API is not available (`api_unavailable`); retry.

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.