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

# Create instant charge with TXID

The Create Instant Charge with TXID endpoint allows you to create a new instant charge to facilitate immediate payment transactions. Use this endpoint to generate a payment request with the necessary details, such as payer information, payment amount, description, additional information, and whether you want to include a QR code to facilitate payment.  The difference between this endpoint and the Create Instant Charge is that you can associate a Transaction ID (TXID) with this charge. This association creates a unique identifier for each transaction, simplifying the process of tracking and identifying the generated charges.

Request body example:

```json
{
    "calendario": {
        "expiracao": "3600"
    },
    "devedor": {
        "cpf": "01010101010",
        "nome": "João teste"
    },
    "valor": {
        "original": 25.90
    },
    "chave": "f59951f6-6d32-4708-be3f-73453620b227",
    "solicitacaoPagador": "Product or payment short description",
    "infoAdicionais": [
        {
            "nome": "Product label",
            "valor": "Product name"
        }
    ]
}
```

# 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/cob/{txid}": {
      "put": {
        "summary": "Create instant charge with TXID",
        "description": "The Create Instant Charge with TXID endpoint allows you to create a new instant charge to facilitate immediate payment transactions. Use this endpoint to generate a payment request with the necessary details, such as payer information, payment amount, description, additional information, and whether you want to include a QR code to facilitate payment.  The difference between this endpoint and the Create Instant Charge is that you can associate a Transaction ID (TXID) with this charge. This association creates a unique identifier for each transaction, simplifying the process of tracking and identifying the generated charges.",
        "operationId": "create-instant-charge-with-txid",
        "parameters": [
          {
            "name": "txid",
            "in": "path",
            "description": "Transaction ID",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "calendario",
                  "valor",
                  "chave"
                ],
                "properties": {
                  "calendario": {
                    "type": "object",
                    "properties": {
                      "expiracao": {
                        "type": "integer",
                        "description": "Expiration time in seconds",
                        "format": "int32"
                      }
                    }
                  },
                  "devedor": {
                    "type": "object",
                    "properties": {
                      "cpf": {
                        "type": "string",
                        "description": "Payer' CPF"
                      },
                      "cnpj": {
                        "type": "string",
                        "description": "Payer's CNPJ"
                      },
                      "name": {
                        "type": "string",
                        "description": "Payer's name"
                      }
                    }
                  },
                  "valor": {
                    "type": "object",
                    "properties": {
                      "original": {
                        "type": "number",
                        "description": "Amount",
                        "format": "float"
                      }
                    }
                  },
                  "chave": {
                    "type": "string",
                    "description": "Pix key"
                  },
                  "solicitacaoPagador": {
                    "type": "string",
                    "description": "Payment description (max 140 chars)"
                  },
                  "infoAdicionais": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "nome": {
                          "type": "string",
                          "description": "Label / Name"
                        },
                        "valor": {
                          "type": "string",
                          "description": "Description"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "incluirQrCode": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"calendario\": {\n        \"criacao\": \"2023-07-24T19:07:49.000000Z\",\n        \"expiracao\": \"3600\"\n    },\n    \"txid\": \"57d7cfee6f604c45aa4bbf421fcd6389\",\n    \"revisao\": 0,\n    \"loc\": {\n        \"id\": 45286,\n        \"location\": \"https://core-h.mkbank.com.br/api/cob/b2e21c49e0634ed38ffd9b61429ce438\",\n        \"tipoCob\": \"cob\"\n    },\n    \"location\": \"https://core-h.mkbank.com.br/api/cob/b2e21c49e0634ed38ffd9b61429ce438\",\n    \"status\": \"ATIVA\",\n    \"valor\": {\n        \"original\": \"25.9\"\n    },\n    \"chave\": \"1aaaa632-bf08-4696-a624-a286464eee1e\",\n    \"solicitacaoPagador\": \"divida de emprestimo\",\n    \"devedor\": {\n        \"cpf\": \"01010101010\",\n        \"nome\": \"João teste\"\n    },\n    \"qrcode\": {\n        \"encoded_value\": \"MDAwMjAxMDEwMjEyMjY4MzAwMTRici5nb3YuYmNiLnBpeDI1NjFjb3JlLWgubWtiYW5rLmNvbS5ici9hcGkvY29iL2IyZTIxYzQ5ZTA2MzRlZDM4ZmZkOWI2MTQyOWNlNDM4NTIwNDAwMDA1MzAzOTg2NTgwMkJSNTkyNUJSVU5PIEVEVUFSRE8gQVJBVUpPIFNPVVo2MDA4Q1VSSVRJQkE2MjA3MDUwMyoqKjYzMDRDMEU5\"\n    },\n    \"invoice_url\": \"https://core-h.mkbank.com.br/invoice/b2e21c49e0634ed38ffd9b61429ce438\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "calendario": {
                      "type": "object",
                      "properties": {
                        "criacao": {
                          "type": "string",
                          "example": "2023-07-24T19:07:49.000000Z"
                        },
                        "expiracao": {
                          "type": "string",
                          "example": "3600"
                        }
                      }
                    },
                    "txid": {
                      "type": "string",
                      "example": "57d7cfee6f604c45aa4bbf421fcd6389"
                    },
                    "revisao": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    },
                    "loc": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "example": 45286,
                          "default": 0
                        },
                        "location": {
                          "type": "string",
                          "example": "https://core-h.mkbank.com.br/api/cob/b2e21c49e0634ed38ffd9b61429ce438"
                        },
                        "tipoCob": {
                          "type": "string",
                          "example": "cob"
                        }
                      }
                    },
                    "location": {
                      "type": "string",
                      "example": "https://core-h.mkbank.com.br/api/cob/b2e21c49e0634ed38ffd9b61429ce438"
                    },
                    "status": {
                      "type": "string",
                      "example": "ATIVA"
                    },
                    "valor": {
                      "type": "object",
                      "properties": {
                        "original": {
                          "type": "string",
                          "example": "25.9"
                        }
                      }
                    },
                    "chave": {
                      "type": "string",
                      "example": "1aaaa632-bf08-4696-a624-a286464eee1e"
                    },
                    "solicitacaoPagador": {
                      "type": "string",
                      "example": "divida de emprestimo"
                    },
                    "devedor": {
                      "type": "object",
                      "properties": {
                        "cpf": {
                          "type": "string",
                          "example": "01010101010"
                        },
                        "nome": {
                          "type": "string",
                          "example": "João teste"
                        }
                      }
                    },
                    "qrcode": {
                      "type": "object",
                      "properties": {
                        "encoded_value": {
                          "type": "string",
                          "example": "MDAwMjAxMDEwMjEyMjY4MzAwMTRici5nb3YuYmNiLnBpeDI1NjFjb3JlLWgubWtiYW5rLmNvbS5ici9hcGkvY29iL2IyZTIxYzQ5ZTA2MzRlZDM4ZmZkOWI2MTQyOWNlNDM4NTIwNDAwMDA1MzAzOTg2NTgwMkJSNTkyNUJSVU5PIEVEVUFSRE8gQVJBVUpPIFNPVVo2MDA4Q1VSSVRJQkE2MjA3MDUwMyoqKjYzMDRDMEU5"
                        }
                      }
                    },
                    "invoice_url": {
                      "type": "string",
                      "example": "https://core-h.mkbank.com.br/invoice/b2e21c49e0634ed38ffd9b61429ce438"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"message\": \"O campo txid já está sendo utilizado.\",\n    \"errors\": {\n        \"txid\": [\n            \"O campo txid já está sendo utilizado.\"\n        ]\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "O campo txid já está sendo utilizado."
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "txid": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo txid já está sendo utilizado."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6297b52a229a9b00142bff3c:63c6c29feeca9e00973965d5"
}
```