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

# Create charge with due date

The Create Charge with Due Date endpoint allows you to create an instant charge with a specific due date. Use this endpoint to generate a charge that has an expiration date and may include additional parameters such as fines, interest, and discounts. The charge will be associated with a transaction ID (TXID) for future reference.

**Request body example:**

```json
{
    "calendario": {
        "dataDeVencimento": "2023-01-30",
        "validadeAposVencimento": 0
    },
    "devedor": {
        "logradouro": "Street name, 123",
        "cidade": "Sao Paulo",
        "uf": "SP",
        "cep": "84061100",
        "cpf": "66876685012",
        "nome": "Jose da Silva",
    },
    "valor": {
        "original": 25.90,
        "multa": {
            "modalidade": "1",
            "valor": 3.00
        },
        "juros": {
            "modalidade": "2",
            "valor": 1.00
        },
        "desconto": {
            "modalidade": "1",
            "data": "2023-01-25",
            "valor": 5.00
        }
    },
    "chave": "f59951f6-6d32-4708-be3f-73453620b227",
    "solicitacaoPagador": "Product or payment short description"
}
```

# 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/cobv/{txid}": {
      "put": {
        "summary": "Create charge with due date",
        "description": "The Create Charge with Due Date endpoint allows you to create an instant charge with a specific due date. Use this endpoint to generate a charge that has an expiration date and may include additional parameters such as fines, interest, and discounts. The charge will be associated with a transaction ID (TXID) for future reference.",
        "operationId": "create-charge-with-due-date",
        "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": {
                      "dataDeVencimento": {
                        "type": "string",
                        "description": "Due date. Format: YYYY-MM-DD",
                        "format": "date"
                      },
                      "validadeAposVencimento": {
                        "type": "integer",
                        "description": "Number of days the charge is still valid after the due date",
                        "format": "int32"
                      }
                    }
                  },
                  "devedor": {
                    "type": "object",
                    "required": [
                      "logradouro",
                      "cidade",
                      "cep",
                      "nome"
                    ],
                    "properties": {
                      "logradouro": {
                        "type": "string",
                        "description": "Payer's address line or street"
                      },
                      "cidade": {
                        "type": "string",
                        "description": "Payer's city"
                      },
                      "cep": {
                        "type": "string",
                        "description": "Payer's zip code"
                      },
                      "cpf": {
                        "type": "string",
                        "description": "Payer's CPF"
                      },
                      "cnpj": {
                        "type": "string",
                        "description": "Payer's CNPJ"
                      },
                      "nome": {
                        "type": "string",
                        "description": "Payer's name"
                      },
                      "uf": {
                        "type": "string",
                        "description": "Payer's address state"
                      }
                    }
                  },
                  "valor": {
                    "type": "object",
                    "description": "Charge amount, fine, interest and discount definitions.",
                    "required": [
                      "original"
                    ],
                    "properties": {
                      "original": {
                        "type": "number",
                        "description": "Charge original amount.",
                        "format": "float"
                      },
                      "multa": {
                        "type": "object",
                        "description": "Fine definitions.",
                        "properties": {
                          "modalidade": {
                            "type": "string",
                            "description": "Amount type: Fixed amount (1), Percent amount (2).",
                            "enum": [
                              "1",
                              "2"
                            ]
                          },
                          "valor": {
                            "type": "number",
                            "description": "Fine amount. It can be a fixed amount or a percentual amount.",
                            "format": "float"
                          }
                        }
                      },
                      "juros": {
                        "type": "object",
                        "description": "Interest definitions.",
                        "properties": {
                          "modalidade": {
                            "type": "string",
                            "description": "Amount type: Fixed amount per day (1), Percentual amount per day (2)",
                            "enum": [
                              "1",
                              "2"
                            ]
                          },
                          "valor": {
                            "type": "number",
                            "description": "Interest amount per day since due date. It can be a fixed amount or a percentual amount.",
                            "format": "float"
                          }
                        }
                      },
                      "desconto": {
                        "type": "object",
                        "description": "Discount definitions.",
                        "properties": {
                          "modalidade": {
                            "type": "string",
                            "description": "Discount amount type: Fixed amount (1), Percentual amount (2)",
                            "enum": [
                              "1",
                              "2"
                            ]
                          },
                          "data": {
                            "type": "string",
                            "description": "Deadline for the discount to be applied. Format: YYYY-MM-DD",
                            "format": "date"
                          },
                          "valor": {
                            "type": "number",
                            "description": "Discount amount. It can be a fixed amount or a percentual amount.",
                            "format": "float"
                          }
                        }
                      }
                    }
                  },
                  "chave": {
                    "type": "string",
                    "description": "Pix key"
                  },
                  "solicitacaoPagador": {
                    "type": "string",
                    "description": "Payment description (max 140 chars)"
                  },
                  "incluirQrCode": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"calendario\": {\n        \"criacao\": \"Tue Jul 25 2023 14:09:37 GMT-0300\",\n        \"dataDeVencimento\": \"2023-07-26T03:00:00.000000Z\",\n        \"validadeAposVencimento\": 10\n    },\n    \"txid\": \"d71e678898b84506ad8djsi7ncj2lshj207\",\n    \"revisao\": 0,\n    \"loc\": {\n        \"id\": 45310,\n        \"location\": \"https://core-h.mkbank.com.br/api/cobv/5236e6af8fa74801af99512b8d3751a0\",\n        \"tipoCob\": \"cob\"\n    },\n    \"status\": \"ATIVA\",\n    \"devedor\": {\n        \"logradouro\": \"Rua Guilh, 000\",\n        \"cidade\": \"Curitiba\",\n        \"uf\": \"PR\",\n        \"cep\": \"800000\",\n        \"cpf\": \"01010101010\",\n        \"nome\": \"João teste\"\n    },\n    \"recebedor\": {\n        \"logradouro\": \"Rua Doutor,100\",\n        \"cidade\": \"Curitiba\",\n        \"uf\": \"PR\",\n        \"cep\": \"80000000\",\n        \"cnpj\": \"02020202020202\",\n        \"nome\": \"João teste\"\n    },\n    \"valor\": {\n        \"original\": \"25.9\",\n        \"multa\": {\n            \"modalidade\": \"1\",\n            \"valor\": 3\n        },\n        \"juros\": {\n            \"modalidade\": \"2\",\n            \"valor\": 1\n        },\n        \"desconto\": {\n            \"modalidade\": \"2\",\n            \"data\": \"2023-07-26\",\n            \"valor\": 5\n        }\n    },\n    \"chave\": \"73898f5a-d646-454a-89a8-b83a8e82c8b9\",\n    \"solicitacaoPagador\": \"Pagemento de divida\",\n    \"invoice_url\": \"https://core-h.mkbank.com.br/invoice/5236e6af8fa74801af99512b8d3751a0\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "calendario": {
                      "type": "object",
                      "properties": {
                        "criacao": {
                          "type": "string",
                          "example": "Tue Jul 25 2023 14:09:37 GMT-0300"
                        },
                        "dataDeVencimento": {
                          "type": "string",
                          "example": "2023-07-26T03:00:00.000000Z"
                        },
                        "validadeAposVencimento": {
                          "type": "integer",
                          "example": 10,
                          "default": 0
                        }
                      }
                    },
                    "txid": {
                      "type": "string",
                      "example": "d71e678898b84506ad8djsi7ncj2lshj207"
                    },
                    "revisao": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    },
                    "loc": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "example": 45310,
                          "default": 0
                        },
                        "location": {
                          "type": "string",
                          "example": "https://core-h.mkbank.com.br/api/cobv/5236e6af8fa74801af99512b8d3751a0"
                        },
                        "tipoCob": {
                          "type": "string",
                          "example": "cob"
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "example": "ATIVA"
                    },
                    "devedor": {
                      "type": "object",
                      "properties": {
                        "logradouro": {
                          "type": "string",
                          "example": "Rua Guilh, 000"
                        },
                        "cidade": {
                          "type": "string",
                          "example": "Curitiba"
                        },
                        "uf": {
                          "type": "string",
                          "example": "PR"
                        },
                        "cep": {
                          "type": "string",
                          "example": "800000"
                        },
                        "cpf": {
                          "type": "string",
                          "example": "01010101010"
                        },
                        "nome": {
                          "type": "string",
                          "example": "João teste"
                        }
                      }
                    },
                    "recebedor": {
                      "type": "object",
                      "properties": {
                        "logradouro": {
                          "type": "string",
                          "example": "Rua Doutor,100"
                        },
                        "cidade": {
                          "type": "string",
                          "example": "Curitiba"
                        },
                        "uf": {
                          "type": "string",
                          "example": "PR"
                        },
                        "cep": {
                          "type": "string",
                          "example": "80000000"
                        },
                        "cnpj": {
                          "type": "string",
                          "example": "02020202020202"
                        },
                        "nome": {
                          "type": "string",
                          "example": "João teste"
                        }
                      }
                    },
                    "valor": {
                      "type": "object",
                      "properties": {
                        "original": {
                          "type": "string",
                          "example": "25.9"
                        },
                        "multa": {
                          "type": "object",
                          "properties": {
                            "modalidade": {
                              "type": "string",
                              "example": "1"
                            },
                            "valor": {
                              "type": "integer",
                              "example": 3,
                              "default": 0
                            }
                          }
                        },
                        "juros": {
                          "type": "object",
                          "properties": {
                            "modalidade": {
                              "type": "string",
                              "example": "2"
                            },
                            "valor": {
                              "type": "integer",
                              "example": 1,
                              "default": 0
                            }
                          }
                        },
                        "desconto": {
                          "type": "object",
                          "properties": {
                            "modalidade": {
                              "type": "string",
                              "example": "2"
                            },
                            "data": {
                              "type": "string",
                              "example": "2023-07-26"
                            },
                            "valor": {
                              "type": "integer",
                              "example": 5,
                              "default": 0
                            }
                          }
                        }
                      }
                    },
                    "chave": {
                      "type": "string",
                      "example": "73898f5a-d646-454a-89a8-b83a8e82c8b9"
                    },
                    "solicitacaoPagador": {
                      "type": "string",
                      "example": "Pagemento de divida"
                    },
                    "invoice_url": {
                      "type": "string",
                      "example": "https://core-h.mkbank.com.br/invoice/5236e6af8fa74801af99512b8d3751a0"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"message\": \"The given txid is invalid. It must contains only alphanumeric characters and be between 26 and 35 characters long. (and 9 more errors)\",\n    \"errors\": {\n        \"txid\": [\n            \"The given txid is invalid. It must contains only alphanumeric characters and be between 26 and 35 characters long.\"\n        ],\n        \"calendario.dataDeVencimento\": [\n            \"O campo calendario.data de vencimento é obrigatório.\"\n        ],\n        \"calendario.validadeAposVencimento\": [\n            \"O campo calendario.validade apos vencimento é obrigatório.\"\n        ],\n        \"devedor.logradouro\": [\n            \"O campo devedor.logradouro é obrigatório.\"\n        ],\n        \"devedor.cidade\": [\n            \"O campo devedor.cidade é obrigatório.\"\n        ],\n        \"devedor.uf\": [\n            \"O campo devedor.uf é obrigatório.\"\n        ],\n        \"devedor.cep\": [\n            \"O campo devedor.cep é obrigatório.\"\n        ],\n        \"devedor.nome\": [\n            \"O campo devedor.nome é obrigatório.\"\n        ],\n        \"valor.original\": [\n            \"O campo valor.original é obrigatório.\"\n        ],\n        \"chave\": [\n            \"O campo chave é obrigatório.\"\n        ]\n    }\n}"
                  },
                  "TXID was used": {
                    "value": "curl --location --request PUT 'https://core-h.mkbank.com.br/api/pix/cobv/d71e678898b84506ad8d8909b9062fc2' \\\n--header 'Authorization: Bearer 20141|ZR6GUuRBBcIQ2kVtEcs5e7ylWVbEeJ3e60hBKWUE' \\\n--data '{\n    \"calendario\": {\n        \"dataDeVencimento\": \"2023-05-20\",\n        \"validadeAposVencimento\": 0\n    },\n    \"devedor\": {\n        \"logradouro\": \"Rua Guilherme Pugsley, 123\",\n        \"cidade\": \"Curitiba\",\n        \"uf\": \"PR\",\n        \"cep\": \"80620000\",\n        \"cpf\": \"08524288981\",\n        \"nome\": \"Luiz Gonçalves\"\n    },\n    \"valor\": {\n        \"original\": 25.90\n    },\n    \"chave\": \"16d2aabf-0b6e-4ab4-aae8-60a90d08f8fc\",\n    \"solicitacaoPagador\": \"Product or payment short description\"\n}'"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "The given txid is invalid. It must contains only alphanumeric characters and be between 26 and 35 characters long. (and 9 more errors)"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "txid": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "The given txid is invalid. It must contains only alphanumeric characters and be between 26 and 35 characters long."
                          }
                        },
                        "calendario.dataDeVencimento": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo calendario.data de vencimento é obrigatório."
                          }
                        },
                        "calendario.validadeAposVencimento": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo calendario.validade apos vencimento é obrigatório."
                          }
                        },
                        "devedor.logradouro": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo devedor.logradouro é obrigatório."
                          }
                        },
                        "devedor.cidade": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo devedor.cidade é obrigatório."
                          }
                        },
                        "devedor.uf": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo devedor.uf é obrigatório."
                          }
                        },
                        "devedor.cep": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo devedor.cep é obrigatório."
                          }
                        },
                        "devedor.nome": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo devedor.nome é obrigatório."
                          }
                        },
                        "valor.original": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo valor.original é obrigatório."
                          }
                        },
                        "chave": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo chave é obrigatório."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6297b52a229a9b00142bff3c:63c6c3c5f20e21001ea89d4f"
}
```