Skip to main content

Refunding Payments

About this guide#

In this guide, we will describe the step-by-step process for you to request refunds for payments generated by our logged-in payment solution.

Before Starting#

Before processing online payments by our PicPay 1-Click solution, you must have a valid, non-expired access_token. You can check how to generate your tokens in this article.

How It works#

Authentication#

In addition to the access_token, generated dynamically, the payment end-point needs an Api-Key that will be informed with your client_id and client_secret.

about the Api-Key

The Api-Key must not be shared in any way and must be stored securely on their servers.

Requesting a refund of a charge to the user's wallet#

The refund request must be generated with the transaction_id or reference_id by the end-point v1/payments/refund, indicating the amount to be refunded in the body of the request. In the example below, we are requesting a refund of BRL 3.00 in the user's wallet.

Information

The transaction_id is generated when creating the payment.

curl --location 'https://api.picpay.com/v1/payments/refund' \
--header 'Api-Key: {{api_key}}' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'x-Idempotency-Key: {{idempotency_key}}' \
--header 'Content-Type: application/json' \
--data '{
"value": 3,
"transaction_id": "daef8a44-b408-4df1-b726-c579723f1116",
"reference_id": "f997bbef-8e17-4e59-b1a9-de1fe1dedd51"
}'

If the request is successfully processed, it will return an HTTP code 200

How will the refund be made?#

The balance will be returned to the same place where the funds originated:

  • If the transaction was made by credit card, it will be reversed on the card;
  • If the transaction was made in the balance, the balance will return to the customer's wallet;
  • If the transaction is mixed (Balance + Card), part will return as balance in the wallet and part will be reversed on the card;

Error messages#

We do not report error codes in the chargeback process. We only inform if the transaction was reversed or not. Example:

{
"message": "Transaction could not be refund"
}

Next Steps#

Getting help#

We hope this article has helped! If you have any questions, you can consult our FAQ or contact us by email: relacionamento-negocios@picpay.com.