---
agentTools:
  projectIndex: https://docs.mundipagg.com/llms.txt
---

# Editar método de pagamento

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Mundipagg API",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.mundipagg.com/core/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/charges/{charge_id}/payment-method": {
      "patch": {
        "summary": "Editar método de pagamento",
        "description": "",
        "operationId": "editar-método-de-pagamento",
        "parameters": [
          {
            "name": "charge_id",
            "in": "path",
            "description": "Código da cobrança.",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "payment_method"
                ],
                "properties": {
                  "update_subscription": {
                    "type": "string",
                    "description": "Indica se o meio de pagamento da assinatura deve ser atualizado",
                    "default": "false"
                  },
                  "payment_method": {
                    "type": "string",
                    "description": "Meio de pagamento. Valores possíveis: **credit_card**, **boleto**, **voucher**, **bank_transfer** ou **safety_pay**"
                  },
                  "credit_card": {
                    "type": "object",
                    "description": "Dados sobre o pagamento com cartão de crédito (obrigatório caso **payment_method** seja **credit_card**). [Saiba mais sobre pagamentos com cartão de crédito](https://docs.mundipagg.com/v1/reference#meio-de-pagamento-cart%C3%A3o-de-cr%C3%A9dito)",
                    "properties": {}
                  },
                  "voucher": {
                    "type": "object",
                    "description": "Dados sobre o pagamento com voucher (obrigatório caso **payment_method** seja **voucher**). [Saiba mais sobre pagamentos com voucher](https://docs.mundipagg.com/v1/reference#meio-de-pagamento-voucher)",
                    "properties": {}
                  },
                  "boleto": {
                    "type": "object",
                    "description": "Dados sobre o pagamento com boleto (obrigatório caso **payment_method** seja **boleto**). [Saiba mais sobre pagamentos com boleto](https://docs.mundipagg.com/v1/reference#meio-de-pagamento-boleto)",
                    "properties": {}
                  },
                  "bank_transfer": {
                    "type": "object",
                    "description": "Dados sobre o pagamento com transferência entre contas bancárias. (obrigatório caso **payment_method** seja **bank_transfer**). [Saiba mais sobre pagamentos com transferência entre contas](https://docs.mundipagg.com/v1/reference#meio-de-pagamento-transfer%C3%AAncia-entre-contas)",
                    "properties": {}
                  }
                }
              },
              "examples": {
                "JSON": {
                  "value": {
                    "payment_method": "boleto",
                    "boleto": {
                      "bank": "033",
                      "instructions": "Pagar até o vencimento",
                      "due_at": "2020-12-31"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": \"ch_PA2gLJYc9hDxRrXV\",\n    \"code\": \"DPRWS1C38N\",\n    \"gateway_id\": \"c22a0e61-2e3e-4317-b11f-08d03046a1a8\",\n    \"amount\": 1490000,\n    \"status\": \"pending\",\n    \"currency\": \"BRL\",\n    \"payment_method\": \"boleto\",\n    \"created_at\": \"2017-10-05T19:16:51Z\",\n    \"updated_at\": \"2017-10-05T19:18:39Z\",\n    \"customer\": {\n        \"id\": \"cus_9rOWDePfdC5qRYgE\",\n        \"name\": \"Tony Stark\",\n        \"email\": \"a999087b-1fa2-4ed9-8499-5065ebc2a46a@avengers.com\",\n        \"delinquent\": false,\n        \"created_at\": \"2017-10-05T19:16:51Z\",\n        \"updated_at\": \"2017-10-05T19:16:51Z\",\n        \"phones\": {}\n    },\n    \"last_transaction\": {\n        \"id\": \"tran_OX28mah1bSP084wB\",\n        \"transaction_type\": \"boleto\",\n        \"gateway_id\": \"659298db-dcae-492a-afc5-47774026ca9f\",\n        \"amount\": 1490000,\n        \"status\": \"generated\",\n        \"success\": true,\n        \"url\": \"https://sandbox.mundipaggone.com/Boleto/ViewBoleto.aspx?659298db-dcae-492a-afc5-47774026ca9f\",\n        \"pdf\": \"https://api.mundipagg.com/core/v1/transactions/tran_OX28mah1bSP084wB/pdf\",\n        \"line\": \"34191.75009 05636.791237 41234.510000 8 84860001490000\",\n        \"barcode\": \"https://api.mundipagg.com/core/v1/transactions/tran_OX28mah1bSP084wB/barcode\",\n        \"qr_code\": \"https://api.mundipagg.com/core/v1/transactions/tran_OX28mah1bSP084wB/qrcode\",\n        \"nosso_numero\": \"00056367\",\n        \"bank\": \"033\",\n        \"document_number\": \"071838848\",\n        \"instructions\": \"Pagar até o vencimento\",\n        \"due_at\": \"2020-12-31T00:00:00Z\",\n        \"created_at\": \"2017-10-05T19:18:39Z\",\n        \"updated_at\": \"2017-10-05T19:18:39Z\",\n        \"gateway_response\": {\n            \"code\": \"201\"\n        }\n    },\n    \"metadata\": {\n        \"code\": \"123\"\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "ch_PA2gLJYc9hDxRrXV"
                    },
                    "code": {
                      "type": "string",
                      "example": "DPRWS1C38N"
                    },
                    "gateway_id": {
                      "type": "string",
                      "example": "c22a0e61-2e3e-4317-b11f-08d03046a1a8"
                    },
                    "amount": {
                      "type": "integer",
                      "example": 1490000,
                      "default": 0
                    },
                    "status": {
                      "type": "string",
                      "example": "pending"
                    },
                    "currency": {
                      "type": "string",
                      "example": "BRL"
                    },
                    "payment_method": {
                      "type": "string",
                      "example": "boleto"
                    },
                    "created_at": {
                      "type": "string",
                      "example": "2017-10-05T19:16:51Z"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2017-10-05T19:18:39Z"
                    },
                    "customer": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "cus_9rOWDePfdC5qRYgE"
                        },
                        "name": {
                          "type": "string",
                          "example": "Tony Stark"
                        },
                        "email": {
                          "type": "string",
                          "example": "a999087b-1fa2-4ed9-8499-5065ebc2a46a@avengers.com"
                        },
                        "delinquent": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2017-10-05T19:16:51Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2017-10-05T19:16:51Z"
                        },
                        "phones": {
                          "type": "object",
                          "properties": {}
                        }
                      }
                    },
                    "last_transaction": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "tran_OX28mah1bSP084wB"
                        },
                        "transaction_type": {
                          "type": "string",
                          "example": "boleto"
                        },
                        "gateway_id": {
                          "type": "string",
                          "example": "659298db-dcae-492a-afc5-47774026ca9f"
                        },
                        "amount": {
                          "type": "integer",
                          "example": 1490000,
                          "default": 0
                        },
                        "status": {
                          "type": "string",
                          "example": "generated"
                        },
                        "success": {
                          "type": "boolean",
                          "example": true,
                          "default": true
                        },
                        "url": {
                          "type": "string",
                          "example": "https://sandbox.mundipaggone.com/Boleto/ViewBoleto.aspx?659298db-dcae-492a-afc5-47774026ca9f"
                        },
                        "pdf": {
                          "type": "string",
                          "example": "https://api.mundipagg.com/core/v1/transactions/tran_OX28mah1bSP084wB/pdf"
                        },
                        "line": {
                          "type": "string",
                          "example": "34191.75009 05636.791237 41234.510000 8 84860001490000"
                        },
                        "barcode": {
                          "type": "string",
                          "example": "https://api.mundipagg.com/core/v1/transactions/tran_OX28mah1bSP084wB/barcode"
                        },
                        "qr_code": {
                          "type": "string",
                          "example": "https://api.mundipagg.com/core/v1/transactions/tran_OX28mah1bSP084wB/qrcode"
                        },
                        "nosso_numero": {
                          "type": "string",
                          "example": "00056367"
                        },
                        "bank": {
                          "type": "string",
                          "example": "033"
                        },
                        "document_number": {
                          "type": "string",
                          "example": "071838848"
                        },
                        "instructions": {
                          "type": "string",
                          "example": "Pagar até o vencimento"
                        },
                        "due_at": {
                          "type": "string",
                          "example": "2020-12-31T00:00:00Z"
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2017-10-05T19:18:39Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2017-10-05T19:18:39Z"
                        },
                        "gateway_response": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "example": "201"
                            }
                          }
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "example": "123"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "412",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"message\": \"This charge can't have the payment method changed.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "This charge can't have the payment method changed."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "csharp",
              "code": "    // Neste exemplo estamos utilizando A sdk C# MundiAPI.PCL    \n    // Secret key fornecida pela Mundipagg\n    string basicAuthUserName = \"sk_test_4tdVXpseumRmqbo\";\n    // Senha em branco. Passando apenas a secret key\n    string basicAuthPassword = \"\";\n            \n    var client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);\n    string chargeId = \"ch_exRAY21fvNFVD9EX\";\n\n    var request = new UpdateChargePaymentMethodRequest {\n        PaymentMethod = \"boleto\",\n        Boleto = new CreateBoletoPaymentRequest {\n            Bank = \"033\",\n            Instructions = \"Pagar até o vencimento\",\n            DueAt = DateTime.UtcNow.AddDays(2)\n        }\n    };\n\n    var response = client.Charges.UpdateChargePaymentMethod(chargeId, request);",
              "name": "SDK C#"
            }
          ],
          "samples-languages": [
            "csharp"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": false
  },
  "x-readme-fauxas": true,
  "_id": "5aba89f6b169810058a71e9a:5aba89f6b169810058a71ee3"
}
```