---
updatedAt: 2026-04-06T17:26:47.000Z
agentTools:
  projectIndex: https://docs.pagar.me/v3/llms.txt
---

# Atualizando uma assinatura

Após criar uma assinatura, você pode atualizar os dados do método do pagamento e o plano que essa assinatura está atrelada.

> 🚧 Vale ressaltar
>
> Para alterar o cartão de uma assinatura, é necessário passar o parâmetro `payment_method=credit_card`.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-settings",
    "version": "3"
  },
  "servers": [
    {
      "url": "https://api.pagar.me/1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "x-default": "",
        "type": "apiKey",
        "name": "api_key",
        "in": "query"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/subscriptions/{subscription_id}": {
      "put": {
        "summary": "Atualizando uma assinatura",
        "description": "Após criar uma assinatura, você pode atualizar os dados do método do pagamento e o plano que essa assinatura está atrelada.",
        "operationId": "atualizando-uma-assinatura",
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "description": "ID da assinatura",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "plan_id": {
                    "type": "string",
                    "description": "ID do novo plano atrelado a assinatura"
                  },
                  "payment_method": {
                    "type": "string",
                    "description": "método de pagamento utilizado na assinatura.  Valores possíveis: credit_card, boleto"
                  },
                  "card_id": {
                    "type": "string",
                    "description": "Identificador dos dados de um cartão previamente salvo na nossa base de dados"
                  },
                  "card_number": {
                    "type": "string",
                    "description": "Número de um cartão de crédito. Usado quando o cartão a ser configurado na assinatura ainda não está salvo no nosso banco de dados"
                  },
                  "card_holder_name": {
                    "type": "string",
                    "description": "Nome do portador do cartão. Usado quando o cartão a ser configurado na assinatura ainda não está salvo no nosso banco de dados"
                  },
                  "card_expiration_date": {
                    "type": "string",
                    "description": "Data de expiração do cartão.  Ex: 0518 (Maio de 2018)"
                  },
                  "card_cvv": {
                    "type": "string",
                    "description": "CVV do cartão, se for uma assinatura paga com cartão"
                  },
                  "boleto_fine": {
                    "properties": {
                      "days": {
                        "type": "string",
                        "description": "Dias após a expiração do boleto quando a multa deve ser cobrada."
                      },
                      "amount": {
                        "type": "string",
                        "description": "Valor em centavos da multa por atraso no pagamento do boleto."
                      }
                    },
                    "required": [],
                    "type": "object"
                  },
                  "boleto_interest": {
                    "properties": {
                      "days": {
                        "type": "string",
                        "description": "Dias após a expiração do boleto quando o juros deve ser cobrado."
                      },
                      "amount": {
                        "type": "string",
                        "description": "Valor em porcentagem da taxa de juros que será cobrado por dia de atraso do boleto."
                      }
                    },
                    "required": [],
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"object\": \"subscription\",\n  \"plan\": {\n    \"object\": \"plan\",\n    \"id\": 166234,\n    \"amount\": 20000,\n    \"days\": 30,\n    \"name\": \"The Dudes Plan\",\n    \"trial_days\": 0,\n    \"date_created\": \"2017-06-19T12:23:53.958Z\",\n    \"payment_methods\": [\n      \"credit_card\"\n    ],\n    \"color\": null,\n    \"charges\": 0,\n    \"installments\": 1,\n    \"invoice_reminder\": null\n  },\n  \"id\": 205881,\n  \"current_transaction\": {\n    \"object\": \"transaction\",\n    \"status\": \"paid\",\n    \"refuse_reason\": null,\n    \"status_reason\": \"acquirer\",\n    \"acquirer_response_code\": \"0000\",\n    \"acquirer_name\": \"pagarme\",\n    \"acquirer_id\": \"56f9d019decf72cc70055d58\",\n    \"authorization_code\": \"426266\",\n    \"soft_descriptor\": null,\n    \"tid\": 1635873,\n    \"nsu\": 1635873,\n    \"date_created\": \"2017-06-21T04:18:13.531Z\",\n    \"date_updated\": \"2017-06-21T04:18:13.951Z\",\n    \"amount\": 10666,\n    \"authorized_amount\": 10666,\n    \"paid_amount\": 10666,\n    \"refunded_amount\": 0,\n    \"installments\": 1,\n    \"id\": 1635873,\n    \"cost\": 50,\n    \"card_holder_name\": \"Aardvark da Silva\",\n    \"card_last_digits\": \"2122\",\n    \"card_first_digits\": \"455636\",\n    \"card_brand\": \"visa\",\n    \"card_pin_mode\": null,\n    \"postback_url\": null,\n    \"payment_method\": \"credit_card\",\n    \"capture_method\": \"ecommerce\",\n    \"antifraud_score\": null,\n    \"boleto_url\": null,\n    \"boleto_barcode\": null,\n    \"boleto_expiration_date\": null,\n    \"referer\": null,\n    \"ip\": null,\n    \"subscription_id\": 205881,\n    \"split_rules\": null,\n    \"metadata\": {},\n    \"antifraud_metadata\": {}\n  },\n  \"postback_url\": null,\n  \"payment_method\": \"credit_card\",\n  \"card_brand\": \"visa\",\n  \"card_last_digits\": \"2122\",\n  \"current_period_start\": \"2017-06-21T04:18:14.006Z\",\n  \"current_period_end\": \"2017-07-21T04:18:14.006Z\",\n  \"charges\": 0,\n  \"status\": \"paid\",\n  \"date_created\": \"2017-06-19T12:26:05.933Z\",\n  \"phone\": null,\n  \"address\": null,\n  \"customer\": {\n    \"object\": \"customer\",\n    \"id\": 198874,\n    \"external_id\": null,\n    \"type\": null,\n    \"country\": null,\n    \"document_number\": \"03427857530\",\n    \"document_type\": \"cpf\",\n    \"name\": \"Aardvark Silva\",\n    \"email\": \"aardvark.silva@emailg.com\",\n    \"phones\": null,\n    \"born_at\": null,\n    \"birthday\": null,\n    \"gender\": null,\n    \"date_created\": \"2017-06-19T12:12:32.020Z\",\n    \"documents\": []\n  },\n  \"card\": {\n    \"object\": \"card\",\n    \"id\": \"card_cj41mpuhc01bb3f6d8exeo072\",\n    \"date_created\": \"2017-06-17T18:41:10.801Z\",\n    \"date_updated\": \"2017-06-17T18:41:11.257Z\",\n    \"brand\": \"visa\",\n    \"holder_name\": \"Aardvark da Silva\",\n    \"first_digits\": \"455636\",\n    \"last_digits\": \"2122\",\n    \"country\": \"AR\",\n    \"fingerprint\": \"SK+CuBxPYsE7\",\n    \"valid\": true,\n    \"expiration_date\": \"1220\"\n  },\n  \"metadata\": null,\n  \"settled_charges\": null\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "example": "subscription"
                    },
                    "plan": {
                      "type": "object",
                      "properties": {
                        "object": {
                          "type": "string",
                          "example": "plan"
                        },
                        "id": {
                          "type": "integer",
                          "example": 166234,
                          "default": 0
                        },
                        "amount": {
                          "type": "integer",
                          "example": 20000,
                          "default": 0
                        },
                        "days": {
                          "type": "integer",
                          "example": 30,
                          "default": 0
                        },
                        "name": {
                          "type": "string",
                          "example": "The Dudes Plan"
                        },
                        "trial_days": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        },
                        "date_created": {
                          "type": "string",
                          "example": "2017-06-19T12:23:53.958Z"
                        },
                        "payment_methods": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "credit_card"
                          }
                        },
                        "color": {},
                        "charges": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        },
                        "installments": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        },
                        "invoice_reminder": {}
                      }
                    },
                    "id": {
                      "type": "integer",
                      "example": 205881,
                      "default": 0
                    },
                    "current_transaction": {
                      "type": "object",
                      "properties": {
                        "object": {
                          "type": "string",
                          "example": "transaction"
                        },
                        "status": {
                          "type": "string",
                          "example": "paid"
                        },
                        "refuse_reason": {},
                        "status_reason": {
                          "type": "string",
                          "example": "acquirer"
                        },
                        "acquirer_response_code": {
                          "type": "string",
                          "example": "0000"
                        },
                        "acquirer_name": {
                          "type": "string",
                          "example": "pagarme"
                        },
                        "acquirer_id": {
                          "type": "string",
                          "example": "56f9d019decf72cc70055d58"
                        },
                        "authorization_code": {
                          "type": "string",
                          "example": "426266"
                        },
                        "soft_descriptor": {},
                        "tid": {
                          "type": "integer",
                          "example": 1635873,
                          "default": 0
                        },
                        "nsu": {
                          "type": "integer",
                          "example": 1635873,
                          "default": 0
                        },
                        "date_created": {
                          "type": "string",
                          "example": "2017-06-21T04:18:13.531Z"
                        },
                        "date_updated": {
                          "type": "string",
                          "example": "2017-06-21T04:18:13.951Z"
                        },
                        "amount": {
                          "type": "integer",
                          "example": 10666,
                          "default": 0
                        },
                        "authorized_amount": {
                          "type": "integer",
                          "example": 10666,
                          "default": 0
                        },
                        "paid_amount": {
                          "type": "integer",
                          "example": 10666,
                          "default": 0
                        },
                        "refunded_amount": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        },
                        "installments": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        },
                        "id": {
                          "type": "integer",
                          "example": 1635873,
                          "default": 0
                        },
                        "cost": {
                          "type": "integer",
                          "example": 50,
                          "default": 0
                        },
                        "card_holder_name": {
                          "type": "string",
                          "example": "Aardvark da Silva"
                        },
                        "card_last_digits": {
                          "type": "string",
                          "example": "2122"
                        },
                        "card_first_digits": {
                          "type": "string",
                          "example": "455636"
                        },
                        "card_brand": {
                          "type": "string",
                          "example": "visa"
                        },
                        "card_pin_mode": {},
                        "postback_url": {},
                        "payment_method": {
                          "type": "string",
                          "example": "credit_card"
                        },
                        "capture_method": {
                          "type": "string",
                          "example": "ecommerce"
                        },
                        "antifraud_score": {},
                        "boleto_url": {},
                        "boleto_barcode": {},
                        "boleto_expiration_date": {},
                        "referer": {},
                        "ip": {},
                        "subscription_id": {
                          "type": "integer",
                          "example": 205881,
                          "default": 0
                        },
                        "split_rules": {},
                        "metadata": {
                          "type": "object",
                          "properties": {}
                        },
                        "antifraud_metadata": {
                          "type": "object",
                          "properties": {}
                        }
                      }
                    },
                    "postback_url": {},
                    "payment_method": {
                      "type": "string",
                      "example": "credit_card"
                    },
                    "card_brand": {
                      "type": "string",
                      "example": "visa"
                    },
                    "card_last_digits": {
                      "type": "string",
                      "example": "2122"
                    },
                    "current_period_start": {
                      "type": "string",
                      "example": "2017-06-21T04:18:14.006Z"
                    },
                    "current_period_end": {
                      "type": "string",
                      "example": "2017-07-21T04:18:14.006Z"
                    },
                    "charges": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    },
                    "status": {
                      "type": "string",
                      "example": "paid"
                    },
                    "date_created": {
                      "type": "string",
                      "example": "2017-06-19T12:26:05.933Z"
                    },
                    "phone": {},
                    "address": {},
                    "customer": {
                      "type": "object",
                      "properties": {
                        "object": {
                          "type": "string",
                          "example": "customer"
                        },
                        "id": {
                          "type": "integer",
                          "example": 198874,
                          "default": 0
                        },
                        "external_id": {},
                        "type": {},
                        "country": {},
                        "document_number": {
                          "type": "string",
                          "example": "03427857530"
                        },
                        "document_type": {
                          "type": "string",
                          "example": "cpf"
                        },
                        "name": {
                          "type": "string",
                          "example": "Aardvark Silva"
                        },
                        "email": {
                          "type": "string",
                          "example": "aardvark.silva@emailg.com"
                        },
                        "phones": {},
                        "born_at": {},
                        "birthday": {},
                        "gender": {},
                        "date_created": {
                          "type": "string",
                          "example": "2017-06-19T12:12:32.020Z"
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {}
                          }
                        }
                      }
                    },
                    "card": {
                      "type": "object",
                      "properties": {
                        "object": {
                          "type": "string",
                          "example": "card"
                        },
                        "id": {
                          "type": "string",
                          "example": "card_cj41mpuhc01bb3f6d8exeo072"
                        },
                        "date_created": {
                          "type": "string",
                          "example": "2017-06-17T18:41:10.801Z"
                        },
                        "date_updated": {
                          "type": "string",
                          "example": "2017-06-17T18:41:11.257Z"
                        },
                        "brand": {
                          "type": "string",
                          "example": "visa"
                        },
                        "holder_name": {
                          "type": "string",
                          "example": "Aardvark da Silva"
                        },
                        "first_digits": {
                          "type": "string",
                          "example": "455636"
                        },
                        "last_digits": {
                          "type": "string",
                          "example": "2122"
                        },
                        "country": {
                          "type": "string",
                          "example": "AR"
                        },
                        "fingerprint": {
                          "type": "string",
                          "example": "SK+CuBxPYsE7"
                        },
                        "valid": {
                          "type": "boolean",
                          "example": true,
                          "default": true
                        },
                        "expiration_date": {
                          "type": "string",
                          "example": "1220"
                        }
                      }
                    },
                    "metadata": {},
                    "settled_charges": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X PUT https://api.pagar.me/1/subscriptions/subscription_id -H 'content-type: application/json' -d '{\n    \"api_key\": \"SUA_API_KEY\", \n    \"card_id\": \"card_cj41mpuhc01bb3f6d8exeo072\", \n    \"payment_method\": \"credit_card\", \n    \"plan_id\": \"166234\"\n}'"
            },
            {
              "language": "ruby",
              "code": "require 'pagarme'\n\nPagarMe.api_key = \"SUA_API_KEY\"\n\nsubscription = PagarMe::Subscription.find_by_id(subscription_id)\n\nsubscription.payment_method = 'credit_card'\nsubscription.card_id = 'card_cj41mpuhc01bb3f6d8exeo072'\nsubscription.plan_id = '166234'\n\nsubscription.save"
            },
            {
              "language": "php",
              "code": "<?php\nrequire(\"vendor/autoload.php\");\n$pagarme = new PagarMe\\Client('SUA_CHAVE_DE_API');\n\n$updatedSubscription = $pagarme->subscriptions()->update([\n  'id' => subscription_id,\n  'plan_id' => plan_id,\n  'payment_method' => 'boleto'\n]);"
            },
            {
              "language": "csharp",
              "code": "PagarMeService.DefaultApiKey = \"SUA_API_KEY\";\n\nvar subscription = PagarMeService.GetDefaultService().Subscriptions.Find(\"subscription_id\");\n\nsubscription.PaymentMethod = PaymentMethod.CreditCard;\nsubscription.Card = PagarMeService.GetDefaultService().Cards.Find(\"card_id\");\nsubscription.Plan = PagarMeService.GetDefaultService().Plans.Find(plan_id);\nsubscription.Save();"
            },
            {
              "language": "javascript",
              "code": "const pagarme = require('pagarme')\n  \npagarme.client.connect({ api_key: 'SUA_API_KEY' })\n  .then(client => client.subscriptions.update({ id: 'subscription_id' }))\n  .then(subscription => console.log(subscription))",
              "name": "JS"
            },
            {
              "language": "python",
              "code": "import pagarme\n\npagarme.authentication_key('SUA_API_KEY')\n\nsubscription = pagarme.subscription.update(\n    \"subscription_id\",\n    {\n        \"card_id\": \"card_id\",\n        \"payment_method\": \"credit_card\",\n        \"plan_id\": \"plan_id\"\n    }\n)\n\nprint (subscription)"
            }
          ],
          "samples-languages": [
            "curl",
            "ruby",
            "php",
            "csharp",
            "javascript",
            "python"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```