curl --request PATCH \
--url https://api.stage.localpayment.com/api/payin/{externalId}/refund \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"comment": "Pix refund",
"beneficiary": {
"type": "INDIVIDUAL",
"name": "John",
"lastname": "Doe",
"document": {
"type": "DocumentType",
"id": "DocumentId"
},
"bank": {
"name": "BankName",
"code": "Code",
"account": {
"type": "BankAccountType",
"number": "AccountNumber"
}
}
}
}
'
{
"externalId": "e36ef929-c2d4-fcf0-b30c-99dc51798f4b",
"internalId": "c09095fb-6a0e-47af-9f43-3d9452b0f290",
"status": {
"code": "902",
"description": "REFUNDED",
"detail": "The payin was refunded"
}
}{
"status": {
"code": "400",
"description": "ERROR",
"detail": "Invalid operation"
}
}{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}{
"status": {
"code": "404",
"description": "ERROR",
"detail": "Payin not found"
}
}PAYINS
Refund a Payin
PATCH
/
api
/
payin
/
{externalId}
/
refund
curl --request PATCH \
--url https://api.stage.localpayment.com/api/payin/{externalId}/refund \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"comment": "Pix refund",
"beneficiary": {
"type": "INDIVIDUAL",
"name": "John",
"lastname": "Doe",
"document": {
"type": "DocumentType",
"id": "DocumentId"
},
"bank": {
"name": "BankName",
"code": "Code",
"account": {
"type": "BankAccountType",
"number": "AccountNumber"
}
}
}
}
'
{
"externalId": "e36ef929-c2d4-fcf0-b30c-99dc51798f4b",
"internalId": "c09095fb-6a0e-47af-9f43-3d9452b0f290",
"status": {
"code": "902",
"description": "REFUNDED",
"detail": "The payin was refunded"
}
}{
"status": {
"code": "400",
"description": "ERROR",
"detail": "Invalid operation"
}
}{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}{
"status": {
"code": "404",
"description": "ERROR",
"detail": "Payin not found"
}
}This endpoint allows you to fully refund a previously authorized Payin transaction.
Refund Requirements:
- The refund amount must match the original Payin amount.
- The refund must be sent to the same beneficiary and account used for the original Payin.
Authorizations
Headers
Bearer access token for authentication. This token is obtained from the Get Access Token or Refresh Access Token endpoints.
Path Parameters
Body
application/json
Last modified on November 10, 2026

