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

# Perform PIX payment by validation code

The Perform Pix Payment endpoint allows you to initiate a payment using a validation code (by searching a pix key before). By providing the validation code obtained from a Pix key search and specifying the payment amount and additional notes, you can process a payment transaction.

The correlation\_id is an identifier that allows you to establish a correlation with your system. It is used to ensure secure payment processing without the risk of duplicate payments. In the event of system instabilities on both your end and ours, if you make a request and do not receive a response from the API for any reason, you can use the correlation\_id to reconcile the payment.

The correlation\_id is sent along with the payment payload via webhook. Here is an example of a webhook response that includes a correlation\_id:

```json
{  
  "httpVerb": "post",  
  "webhookUrl": "<https://api.dev.hkdintl.com/api/third/callback/payment/10>",  
  "payload": {  
    "id": 98418,  
    "account_id": 1116,  
    "authentication_code": "c016ccc1-ed6b-4459-967d-aae50ffae5e8",  
    "amount": -280,  
    "status": "DONE",  
    "owner_type": "App\\Models\\PixPayment",  
    "type": "CASH_OUT",  
    "created_at": "2023-07-03T09:02:55.000000Z",  
    "performed_at": "2023-07-03T09:02:58.000000Z",  
    "performed_at_timestamp": 1688374978997,  
    "owner": {  
      "id": 82955,  
      "authentication_code": "14488c9c-327f-4212-b556-d4a3c64914cb",  
      "status": "DONE",  
      "amount": 280,  
      "end_to_end_id": "E3562431920230703090255340935da9",  
      "notes": "202307031denBiG00000000000",  
      "recipient_account_bank_ispb": "35624319",  
      "recipient_account_bank_name": "MK DIGITAL ",  
      "recipient_account_branch": "3000",  
      "recipient_account_number": "10740",  
      "recipient_account_type": "TRAN",  
      "recipient_document_number": "45749646000104",  
      "recipient_name": "BRGABE Servicos de apoio administrativos ltda",  
      "addressing_key": "c4eeb8cd-05d5-4199-a3ab-506827d859b6",  
      "addressing_key_type": "EVP",  
      "transaction_id": null,  
      "initialization_type": "DICT",  
      "correlation_id": "202307031denBiG00000000000"  
    }  
  },  
  "headers": {  
    "Content-Type": "application/json",  
    "Signature": "a4098e82a46bda1da0bd5970f3b3a350c588c6a8c16cd55c12c9d38c0bc198ec"  
  },  
  "meta": \[],  
  "tags": \[],  
  "attempt": 1,  
  "response": "SUCCESS",  
  "response_status": 200,  
  "uuid": "ecd24035-a102-47e2-adb8-e1aaeeef5a22"
}
```

# 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/perform_payment": {
      "post": {
        "summary": "Perform PIX payment by validation code",
        "description": "The Perform Pix Payment endpoint allows you to initiate a payment using a validation code (by searching a pix key before). By providing the validation code obtained from a Pix key search and specifying the payment amount and additional notes, you can process a payment transaction.",
        "operationId": "perform-pix-payment-using-key",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "validation_code",
                  "amount"
                ],
                "properties": {
                  "validation_code": {
                    "type": "string",
                    "description": "Validation code provided by a pix key search"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Payment amount. Min: 0.01.",
                    "format": "float"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Some notes",
                    "default": "Vaquinha para churrasco"
                  },
                  "correlation_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"authentication_code\": \"f3c01874-d73a-4e3a-9828-bb949fba994c\",\n    \"account_id\": 1060,\n    \"type\": \"CASH_OUT\",\n    \"amount\": -3,\n    \"description\": \"Pagamento PIX\",\n    \"complement\": \"João teste\",\n    \"scheduling_date\": \"2023-07-03\",\n    \"performed_at\": null,\n    \"performed_at_timestamp\": null,\n    \"status\": \"CREATED\",\n    \"initiator\": \"API\",\n    \"owner_id\": 82972,\n    \"owner_type\": \"App\\\\Models\\\\PixPayment\",\n    \"updated_at\": \"2023-07-03T17:02:09.000000Z\",\n    \"created_at\": \"2023-07-03T17:02:09.000000Z\",\n    \"id\": 98454,\n    \"owner\": {\n        \"id\": 82972,\n        \"authentication_code\": \"dfd308a1-55a6-4cec-8fd9-224d6655bb35\",\n        \"end_to_end_id\": \"E35624319202307031700316348a9bc6\",\n        \"account_id\": 1060,\n        \"amount\": 3,\n        \"notes\": \"teste de qualidade\",\n        \"scheduling_date\": \"2023-07-03T17:02:09.000000Z\",\n        \"performed_at\": null,\n        \"performed_at_timestamp\": null,\n        \"status\": \"CREATED\",\n        \"reason\": null,\n        \"sender_account_bank_code\": null,\n        \"sender_account_bank_ispb\": \"35624319\",\n        \"sender_account_bank_name\": \"MK Digital Bank S.A.\",\n        \"sender_account_branch\": \"3000\",\n        \"sender_account_number\": \"10286\",\n        \"sender_account_type\": \"TRAN\",\n        \"sender_document_number\": \"02020202020202\",\n        \"sender_name\": \"João teste\",\n        \"recipient_account_bank_code\": null,\n        \"recipient_account_bank_ispb\": \"35624319\",\n        \"recipient_account_bank_name\": \"MK DIGITAL \",\n        \"recipient_account_branch\": \"3000\",\n        \"recipient_account_number\": \"10286\",\n        \"recipient_account_type\": \"TRAN\",\n        \"recipient_document_number\": \"02020202020202\",\n        \"recipient_name\": \"João teste\",\n        \"initialization_type\": \"DICT\",\n        \"transaction_id\": null,\n        \"addressing_key\": \"96187dc9-dff5-436e-a326-9783534ddab3\",\n        \"addressing_key_type\": \"EVP\",\n        \"has_been_locked\": false,\n        \"legacy_order_id\": null,\n        \"legacy_mocc_tabreg\": null,\n        \"legacy_mocc_seqreg\": null,\n        \"legacy_mocc_lanreg\": null,\n        \"created_at\": \"2023-07-03T17:02:09.000000Z\",\n        \"updated_at\": \"2023-07-03T17:02:09.000000Z\",\n        \"correlation_id\": \"34knfks78mdbsmr5ednsofhs038r709rnchsdk4587\"\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "authentication_code": {
                      "type": "string",
                      "example": "f3c01874-d73a-4e3a-9828-bb949fba994c"
                    },
                    "account_id": {
                      "type": "integer",
                      "example": 1060,
                      "default": 0
                    },
                    "type": {
                      "type": "string",
                      "example": "CASH_OUT"
                    },
                    "amount": {
                      "type": "integer",
                      "example": -3,
                      "default": 0
                    },
                    "description": {
                      "type": "string",
                      "example": "Pagamento PIX"
                    },
                    "complement": {
                      "type": "string",
                      "example": "João teste"
                    },
                    "scheduling_date": {
                      "type": "string",
                      "example": "2023-07-03"
                    },
                    "performed_at": {},
                    "performed_at_timestamp": {},
                    "status": {
                      "type": "string",
                      "example": "CREATED"
                    },
                    "initiator": {
                      "type": "string",
                      "example": "API"
                    },
                    "owner_id": {
                      "type": "integer",
                      "example": 82972,
                      "default": 0
                    },
                    "owner_type": {
                      "type": "string",
                      "example": "App\\Models\\PixPayment"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2023-07-03T17:02:09.000000Z"
                    },
                    "created_at": {
                      "type": "string",
                      "example": "2023-07-03T17:02:09.000000Z"
                    },
                    "id": {
                      "type": "integer",
                      "example": 98454,
                      "default": 0
                    },
                    "owner": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "example": 82972,
                          "default": 0
                        },
                        "authentication_code": {
                          "type": "string",
                          "example": "dfd308a1-55a6-4cec-8fd9-224d6655bb35"
                        },
                        "end_to_end_id": {
                          "type": "string",
                          "example": "E35624319202307031700316348a9bc6"
                        },
                        "account_id": {
                          "type": "integer",
                          "example": 1060,
                          "default": 0
                        },
                        "amount": {
                          "type": "integer",
                          "example": 3,
                          "default": 0
                        },
                        "notes": {
                          "type": "string",
                          "example": "teste de qualidade"
                        },
                        "scheduling_date": {
                          "type": "string",
                          "example": "2023-07-03T17:02:09.000000Z"
                        },
                        "performed_at": {},
                        "performed_at_timestamp": {},
                        "status": {
                          "type": "string",
                          "example": "CREATED"
                        },
                        "reason": {},
                        "sender_account_bank_code": {},
                        "sender_account_bank_ispb": {
                          "type": "string",
                          "example": "35624319"
                        },
                        "sender_account_bank_name": {
                          "type": "string",
                          "example": "MK Digital Bank S.A."
                        },
                        "sender_account_branch": {
                          "type": "string",
                          "example": "3000"
                        },
                        "sender_account_number": {
                          "type": "string",
                          "example": "10286"
                        },
                        "sender_account_type": {
                          "type": "string",
                          "example": "TRAN"
                        },
                        "sender_document_number": {
                          "type": "string",
                          "example": "02020202020202"
                        },
                        "sender_name": {
                          "type": "string",
                          "example": "João teste"
                        },
                        "recipient_account_bank_code": {},
                        "recipient_account_bank_ispb": {
                          "type": "string",
                          "example": "35624319"
                        },
                        "recipient_account_bank_name": {
                          "type": "string",
                          "example": "MK DIGITAL "
                        },
                        "recipient_account_branch": {
                          "type": "string",
                          "example": "3000"
                        },
                        "recipient_account_number": {
                          "type": "string",
                          "example": "10286"
                        },
                        "recipient_account_type": {
                          "type": "string",
                          "example": "TRAN"
                        },
                        "recipient_document_number": {
                          "type": "string",
                          "example": "02020202020202"
                        },
                        "recipient_name": {
                          "type": "string",
                          "example": "João teste"
                        },
                        "initialization_type": {
                          "type": "string",
                          "example": "DICT"
                        },
                        "transaction_id": {},
                        "addressing_key": {
                          "type": "string",
                          "example": "96187dc9-dff5-436e-a326-9783534ddab3"
                        },
                        "addressing_key_type": {
                          "type": "string",
                          "example": "EVP"
                        },
                        "has_been_locked": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "legacy_order_id": {},
                        "legacy_mocc_tabreg": {},
                        "legacy_mocc_seqreg": {},
                        "legacy_mocc_lanreg": {},
                        "created_at": {
                          "type": "string",
                          "example": "2023-07-03T17:02:09.000000Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2023-07-03T17:02:09.000000Z"
                        },
                        "correlation_id": {
                          "type": "string",
                          "example": "34knfks78mdbsmr5ednsofhs038r709rnchsdk4587"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"message\": \"Código de chave pix inválido\",\n    \"code\": \"INVALID_PIX_KEY_END_TO_END_ID\",\n    \"data\": []\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Código de chave pix inválido"
                    },
                    "code": {
                      "type": "string",
                      "example": "INVALID_PIX_KEY_END_TO_END_ID"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6297b52a229a9b00142bff3c:62a7817e56e9b200130d4943"
}
```