These docs are for v1.0. Click to read the latest docs for v4.1.

Comunidade

Ask a Question
Back to all

/cancel API not working for refund

Hello, I am trying to integrate with PagBanks Sandbox API. Order creation and capture seems to be working fine but I observed an issue with /cancel (https://developer.pagbank.com.br/reference/cancelar-pagamento). For unpaid charges API works great, however if a charge was already PAID then refunding returns error most of the time.

Steps to reproduce:

  1. Create an order without capture.
  2. Capture the order
  3. Try to refund captured charge

Outcome:

HTTP 400:

{
    "error_messages": [
        {
            "code": "40008",
            "message": "refund_temporarily_unavailable",
            "description": "Transaction is not found.",
            "error": "refund_temporarily_unavailable"
        }
    ]
}

Sometimes refund works right away, sometimes it works after some retries. Why is this flow so non-deterministic? Is there something on my side that I can do? Thanks in advance.

© 1996- Todos os direitos reservados.

PAGSEGURO INTERNET INSTITUIÇÃO DE PAGAMENTO S/A - CNPJ/MF 08.561.701/0001-01

Av. Brigadeiro Faria Lima, 1.384, São Paulo - SP - CEP 01451-001