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

# Editar data de início da assinatura

Com o verbo _HTTP PATCH_, através do identificador da assinatura (`subscription_id`) é possível atualizar a data de início da assinatura.

[block:callout]
{
  "type": "info",
  "title": "Restrições de mudança de data",
  "body": "1 - Não é possível atualizar a data de início da assinatura para o dia anterior ao dia atual.\n\n2 - Não é possível atualizar a data de início de uma assinatura que já começou."
}
[/block]

# 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": {
    "/subscriptions/{subscription_id}/start-at": {
      "patch": {
        "summary": "Editar data de início da assinatura",
        "description": "Com o verbo _HTTP PATCH_, através do identificador da assinatura (`subscription_id`) é possível atualizar a data de início da assinatura.",
        "operationId": "editar-data-de-início-da-assinatura",
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "description": "Código da assinatura.<br>Formato: `sub_XXXXXXXXXXXXXXXX`.",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "start_at"
                ],
                "properties": {
                  "start_at": {
                    "type": "string",
                    "description": "Data de início da assinatura.",
                    "format": "date"
                  }
                }
              },
              "examples": {
                "JSON": {
                  "value": {
                    "start_at": "2019-01-01"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": \"sub_lmxK4k0hPfJ5z58w\",\n    \"code\": \"9X8HROC4E0\",\n    \"start_at\": \"2019-01-01T00:00:00Z\",\n    \"interval\": \"month\",\n    \"interval_count\": 1,\n    \"billing_type\": \"prepaid\",\n    \"gateway_affiliation_id\": \"C56A4180-65AA-42EC-A945-5FD21DEC0538\",\n    \"boleto_due_days\":5,\n    \"minimum_price\": 10000,\n    \"next_billing_at\": \"2019-01-01T00:00:00Z\",\n    \"payment_method\": \"credit_card\",\n    \"currency\": \"BRL\",\n    \"statement_descriptor\": \"Spotify\",\n    \"installments\": 1,\n    \"status\": \"active\",\n    \"created_at\": \"2018-04-03T19:04:24Z\",\n    \"updated_at\": \"2018-04-03T19:04:24Z\",\n    \"customer\": {\n        \"id\": \"cus_J4wRXJ0U6ytZrpOx\",\n        \"name\": \"Tony Stark\",\n        \"email\": \"tstark@avengers.com\",\n        \"delinquent\": false,\n        \"created_at\": \"2016-09-28T21:04:37Z\",\n        \"updated_at\": \"2017-03-22T19:06:14Z\"\n    },\n    \"card\": {\n        \"id\": \"card_pEYq7rDbFeiW8V6k\",\n        \"last_four_digits\": \"8229\",\n        \"brand\": \"Amex\",\n        \"holder_name\": \"Tony Stark\",\n        \"exp_month\": 1,\n        \"exp_year\": 2018,\n        \"status\": \"active\",\n        \"created_at\": \"2016-11-16T17:02:39Z\",\n        \"updated_at\": \"2016-12-29T12:03:24Z\",\n        \"billing_address\": {\n            \"line_1\": \"10880, Malibu Point, Malibu Central\",\n            \"zip_code\": \"90265\",\n            \"city\": \"Malibu\",\n            \"state\": \"CA\",\n            \"country\": \"US\"\n        }\n    },\n    \"plan\": {\n        \"id\": \"plan_pzrg5YhjyiqBgDw3\",\n        \"name\": \"Plano Premium\",\n        \"description\": \"Vá de Premium. E seja feliz!\",\n        \"url\": \"/plans/plan_pzrg5YhjyiqBgDw3/mundipagg-teste/plano-premium\",\n        \"statement_descriptor\": \"Spotify\",\n        \"interval\": \"month\",\n        \"interval_count\": 1,\n        \"billing_type\": \"prepaid\",\n        \"payment_methods\": [\n            \"credit_card\"\n        ],\n        \"installments\": [\n            1\n        ],\n        \"status\": \"active\",\n        \"currency\": \"BRL\",\n        \"created_at\": \"2017-04-03T19:04:05Z\",\n        \"updated_at\": \"2017-04-03T19:04:05Z\"\n    },\n    \"items\": [\n        {\n            \"id\": \"si_K1Mj03JPSWFwxan4\",\n            \"description\": \"Bola\",\n            \"quantity\": 1,\n            \"status\": \"active\",\n            \"created_at\": \"2017-04-03T19:04:24Z\",\n            \"updated_at\": \"2017-04-03T19:04:24Z\",\n            \"pricing_scheme\": {\n                \"price\": 1490,\n                \"scheme_type\": \"unit\"\n            }\n        }\n    ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "sub_lmxK4k0hPfJ5z58w"
                    },
                    "code": {
                      "type": "string",
                      "example": "9X8HROC4E0"
                    },
                    "start_at": {
                      "type": "string",
                      "example": "2019-01-01T00:00:00Z"
                    },
                    "interval": {
                      "type": "string",
                      "example": "month"
                    },
                    "interval_count": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "billing_type": {
                      "type": "string",
                      "example": "prepaid"
                    },
                    "gateway_affiliation_id": {
                      "type": "string",
                      "example": "C56A4180-65AA-42EC-A945-5FD21DEC0538"
                    },
                    "boleto_due_days": {
                      "type": "integer",
                      "example": 5,
                      "default": 0
                    },
                    "minimum_price": {
                      "type": "integer",
                      "example": 10000,
                      "default": 0
                    },
                    "next_billing_at": {
                      "type": "string",
                      "example": "2019-01-01T00:00:00Z"
                    },
                    "payment_method": {
                      "type": "string",
                      "example": "credit_card"
                    },
                    "currency": {
                      "type": "string",
                      "example": "BRL"
                    },
                    "statement_descriptor": {
                      "type": "string",
                      "example": "Spotify"
                    },
                    "installments": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "status": {
                      "type": "string",
                      "example": "active"
                    },
                    "created_at": {
                      "type": "string",
                      "example": "2018-04-03T19:04:24Z"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2018-04-03T19:04:24Z"
                    },
                    "customer": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "cus_J4wRXJ0U6ytZrpOx"
                        },
                        "name": {
                          "type": "string",
                          "example": "Tony Stark"
                        },
                        "email": {
                          "type": "string",
                          "example": "tstark@avengers.com"
                        },
                        "delinquent": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2016-09-28T21:04:37Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2017-03-22T19:06:14Z"
                        }
                      }
                    },
                    "card": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "card_pEYq7rDbFeiW8V6k"
                        },
                        "last_four_digits": {
                          "type": "string",
                          "example": "8229"
                        },
                        "brand": {
                          "type": "string",
                          "example": "Amex"
                        },
                        "holder_name": {
                          "type": "string",
                          "example": "Tony Stark"
                        },
                        "exp_month": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        },
                        "exp_year": {
                          "type": "integer",
                          "example": 2018,
                          "default": 0
                        },
                        "status": {
                          "type": "string",
                          "example": "active"
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2016-11-16T17:02:39Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2016-12-29T12:03:24Z"
                        },
                        "billing_address": {
                          "type": "object",
                          "properties": {
                            "line_1": {
                              "type": "string",
                              "example": "10880, Malibu Point, Malibu Central"
                            },
                            "zip_code": {
                              "type": "string",
                              "example": "90265"
                            },
                            "city": {
                              "type": "string",
                              "example": "Malibu"
                            },
                            "state": {
                              "type": "string",
                              "example": "CA"
                            },
                            "country": {
                              "type": "string",
                              "example": "US"
                            }
                          }
                        }
                      }
                    },
                    "plan": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "plan_pzrg5YhjyiqBgDw3"
                        },
                        "name": {
                          "type": "string",
                          "example": "Plano Premium"
                        },
                        "description": {
                          "type": "string",
                          "example": "Vá de Premium. E seja feliz!"
                        },
                        "url": {
                          "type": "string",
                          "example": "/plans/plan_pzrg5YhjyiqBgDw3/mundipagg-teste/plano-premium"
                        },
                        "statement_descriptor": {
                          "type": "string",
                          "example": "Spotify"
                        },
                        "interval": {
                          "type": "string",
                          "example": "month"
                        },
                        "interval_count": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        },
                        "billing_type": {
                          "type": "string",
                          "example": "prepaid"
                        },
                        "payment_methods": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "credit_card"
                          }
                        },
                        "installments": {
                          "type": "array",
                          "items": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          }
                        },
                        "status": {
                          "type": "string",
                          "example": "active"
                        },
                        "currency": {
                          "type": "string",
                          "example": "BRL"
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2017-04-03T19:04:05Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2017-04-03T19:04:05Z"
                        }
                      }
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "si_K1Mj03JPSWFwxan4"
                          },
                          "description": {
                            "type": "string",
                            "example": "Bola"
                          },
                          "quantity": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          },
                          "status": {
                            "type": "string",
                            "example": "active"
                          },
                          "created_at": {
                            "type": "string",
                            "example": "2017-04-03T19:04:24Z"
                          },
                          "updated_at": {
                            "type": "string",
                            "example": "2017-04-03T19:04:24Z"
                          },
                          "pricing_scheme": {
                            "type": "object",
                            "properties": {
                              "price": {
                                "type": "integer",
                                "example": 1490,
                                "default": 0
                              },
                              "scheme_type": {
                                "type": "string",
                                "example": "unit"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"message\": \"Subscription not found.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Subscription not found."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"message\": \"The request is invalid.\",\n    \"errors\": {\n        \"next_billing_at\": [\n            \"The next_billing_at field is invalid.\"\n        ]\n    },\n    \"request\": {}\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "The request is invalid."
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "next_billing_at": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "The next_billing_at field is invalid."
                          }
                        }
                      }
                    },
                    "request": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "csharp",
              "code": "using MundiAPI.PCL;\nusing MundiAPI.PCL.Models;\nusing System;\nusing System.Web.Mvc;\n\nnamespace MundipaggTest.Controllers {\n\n    public class HomeController : Controller {\n\n    public ActionResult Index() {\n\n    // Secret key fornecida pela Mundipagg\n    string basicAuthUserName = \"SUA_CHAVE_SECRETA\";\n    // Senha em branco. Passando apenas a secret key\n    string basicAuthPassword = \"\";\n\n    var client = new MundiAPIClient(basicAuthUserName, basicAuthPassword);\n\n     string subscrptionId = \"sub_05jkdIfGYPfN26mI\";\n\n    var request = new UpdateSubscriptionStartAt {\n        StartAt = DateTime.UtcNow.AddDays(2)\n    };\n\n    var response = client.Subscriptions.UpdateSubscriptionStartAt(subscrptionId, request);\n\n    return View();\n    }\n}\n}",
              "name": "SDK C#"
            }
          ],
          "samples-languages": [
            "csharp"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": false
  },
  "x-readme-fauxas": true,
  "_id": "5aba89f6b169810058a71e9a:5b739f24c2f15a000374f4a1"
}
```