---
agentTools:
  projectIndex: https://mk-bank.readme.io/llms.txt
---

# Refund a Pix Cash In

The Refund a Pix Cash In endpoint allows you to initiate a refund for a previous Pix cash in transaction. You need to provide the end_to_end_id of the cash in transaction that you want to refund and the amount to be refunded. The amount must be equal to or lower than the received amount of the original transaction. Optionally, you can include a correlation_id to associate the refund with a specific identifier.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "MK Bank Account API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://core-h.mkbank.com.br/api"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/pix/refund": {
      "post": {
        "summary": "Refund a Pix Cash In",
        "description": "The Refund a Pix Cash In endpoint allows you to initiate a refund for a previous Pix cash in transaction. You need to provide the end_to_end_id of the cash in transaction that you want to refund and the amount to be refunded. The amount must be equal to or lower than the received amount of the original transaction. Optionally, you can include a correlation_id to associate the refund with a specific identifier.",
        "operationId": "refund-a-pix-cash-in",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "end_to_end_id",
                  "amount"
                ],
                "properties": {
                  "end_to_end_id": {
                    "type": "string",
                    "description": "Pix cash in EndToEndId"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount to refund. Must be lower or equal than received amount.",
                    "format": "float"
                  },
                  "correlation_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"authentication_code\": \"b2cd7b43-56e3-40ab-b396-805551245b7d\",\n    \"account_id\": 1060,\n    \"type\": \"CASH_OUT\",\n    \"amount\": -5,\n    \"description\": \"Devolução PIX\",\n    \"complement\": \"MK DIGITAL \",\n    \"scheduling_date\": \"2023-07-31\",\n    \"performed_at\": null,\n    \"performed_at_timestamp\": null,\n    \"status\": \"CREATED\",\n    \"initiator\": \"API\",\n    \"owner_id\": 77,\n    \"owner_type\": \"App\\\\Models\\\\PixRefund\",\n    \"updated_at\": \"2023-07-31T13:17:31.000000Z\",\n    \"created_at\": \"2023-07-31T13:17:31.000000Z\",\n    \"id\": 99229,\n    \"owner\": {\n        \"id\": 77,\n        \"authentication_code\": \"bc47eb67-d1c7-4b03-af21-05eb97b3fb3d\",\n        \"end_to_end_id\": \"D35624319202307311317hcbUWfaLrlJ\",\n        \"receivement_end_to_end_id\": \"E3562431920230731131446119304649\",\n        \"account_id\": 1060,\n        \"pix_payment_receivement_id\": 14426,\n        \"amount\": 5,\n        \"notes\": \"\",\n        \"scheduling_date\": \"2023-07-31T13:17:31.000000Z\",\n        \"performed_at\": null,\n        \"performed_at_timestamp\": null,\n        \"status\": \"CREATED\",\n        \"reason\": null,\n        \"devolution_code\": \"MD06\",\n        \"sender_account_bank_code\": null,\n        \"sender_account_bank_ispb\": \"35624319\",\n        \"sender_account_bank_name\": \"MK Digital Bank S.A.\",\n        \"recipient_account_bank_code\": null,\n        \"recipient_account_bank_ispb\": \"35624319\",\n        \"recipient_account_bank_name\": \"MK DIGITAL \",\n        \"created_at\": \"2023-07-31T13:17:31.000000Z\",\n        \"updated_at\": \"2023-07-31T13:17:31.000000Z\",\n        \"correlation_id\": null\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "authentication_code": {
                      "type": "string",
                      "example": "b2cd7b43-56e3-40ab-b396-805551245b7d"
                    },
                    "account_id": {
                      "type": "integer",
                      "example": 1060,
                      "default": 0
                    },
                    "type": {
                      "type": "string",
                      "example": "CASH_OUT"
                    },
                    "amount": {
                      "type": "integer",
                      "example": -5,
                      "default": 0
                    },
                    "description": {
                      "type": "string",
                      "example": "Devolução PIX"
                    },
                    "complement": {
                      "type": "string",
                      "example": "MK DIGITAL "
                    },
                    "scheduling_date": {
                      "type": "string",
                      "example": "2023-07-31"
                    },
                    "performed_at": {},
                    "performed_at_timestamp": {},
                    "status": {
                      "type": "string",
                      "example": "CREATED"
                    },
                    "initiator": {
                      "type": "string",
                      "example": "API"
                    },
                    "owner_id": {
                      "type": "integer",
                      "example": 77,
                      "default": 0
                    },
                    "owner_type": {
                      "type": "string",
                      "example": "App\\Models\\PixRefund"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2023-07-31T13:17:31.000000Z"
                    },
                    "created_at": {
                      "type": "string",
                      "example": "2023-07-31T13:17:31.000000Z"
                    },
                    "id": {
                      "type": "integer",
                      "example": 99229,
                      "default": 0
                    },
                    "owner": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "example": 77,
                          "default": 0
                        },
                        "authentication_code": {
                          "type": "string",
                          "example": "bc47eb67-d1c7-4b03-af21-05eb97b3fb3d"
                        },
                        "end_to_end_id": {
                          "type": "string",
                          "example": "D35624319202307311317hcbUWfaLrlJ"
                        },
                        "receivement_end_to_end_id": {
                          "type": "string",
                          "example": "E3562431920230731131446119304649"
                        },
                        "account_id": {
                          "type": "integer",
                          "example": 1060,
                          "default": 0
                        },
                        "pix_payment_receivement_id": {
                          "type": "integer",
                          "example": 14426,
                          "default": 0
                        },
                        "amount": {
                          "type": "integer",
                          "example": 5,
                          "default": 0
                        },
                        "notes": {
                          "type": "string",
                          "example": ""
                        },
                        "scheduling_date": {
                          "type": "string",
                          "example": "2023-07-31T13:17:31.000000Z"
                        },
                        "performed_at": {},
                        "performed_at_timestamp": {},
                        "status": {
                          "type": "string",
                          "example": "CREATED"
                        },
                        "reason": {},
                        "devolution_code": {
                          "type": "string",
                          "example": "MD06"
                        },
                        "sender_account_bank_code": {},
                        "sender_account_bank_ispb": {
                          "type": "string",
                          "example": "35624319"
                        },
                        "sender_account_bank_name": {
                          "type": "string",
                          "example": "MK Digital Bank S.A."
                        },
                        "recipient_account_bank_code": {},
                        "recipient_account_bank_ispb": {
                          "type": "string",
                          "example": "35624319"
                        },
                        "recipient_account_bank_name": {
                          "type": "string",
                          "example": "MK DIGITAL "
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2023-07-31T13:17:31.000000Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2023-07-31T13:17:31.000000Z"
                        },
                        "correlation_id": {}
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"message\": \"Uma devolução já foi realizada\",\n    \"code\": \"A_REFUND_WAS_ALREADY_PERFORMED\",\n    \"data\": []\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Uma devolução já foi realizada"
                    },
                    "code": {
                      "type": "string",
                      "example": "A_REFUND_WAS_ALREADY_PERFORMED"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6297b52a229a9b00142bff3c:63cac775e2bd5f020153d178"
}
```