---
title: "Editar metadados do plano"
url: "https://devcenter.stone.com.br/apis/v5-docs-legacy/versions/b9aaff36-6dcc-4353-8398-836d6c13dfa5/operations/editar-metadados-do-plano-1"
---

> Full API specification: https://devcenter.stone.com.br/apis/v5-docs-legacy/versions/b9aaff36-6dcc-4353-8398-836d6c13dfa5.md

# Editar metadados do plano

`PATCH` `/plans/{plan_id}/metadata`

Operation ID: `editar-metadados-do-plano-1`

Com o verbo _HTTP PATCH_, através do identificador do plano (`plan_id`) é possível atualizar o objeto `metadata` do plano.

## Path parameters

- `plan_id` (string, required) - Código do plano.<br>Formato: `plan_XXXXXXXXXXXXXXXX`.

## Request body

Content types: `application/json`

## Responses

- `200` - 200
- `404` - 404

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Pagar.me v5 API (Legado)
  version: 5.0.0
servers:
  - url: https://api.stone.com.br/core/v5
paths:
  /plans/{plan_id}/metadata:
    patch:
      summary: Editar metadados do plano
      description: Com o verbo _HTTP PATCH_, através do identificador do plano
        (`plan_id`) é possível atualizar o objeto `metadata` do plano.
      operationId: editar-metadados-do-plano-1
      parameters:
        - name: plan_id
          in: path
          description: "Código do plano.<br>Formato: `plan_XXXXXXXXXXXXXXXX`."
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - metadata
              properties:
                metadata:
                  type: object
                  description: Objeto chave/valor utilizado para armazenar informações adicionais
                    sobre o plano.
                  properties: {}
            examples:
              Request Example:
                value:
                  metadata:
                    code: "1234"
                    company: Avengers
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value: >-
                    {
                        "id": "plan_jEJWD1qF2Xf92eKv",
                        "name": "Premium",
                        "description": "Vá de Premium. E seja feliz!",
                        "url": "/plans/plan_jEJWD1qF2Xf92eKv/pagarme-teste/premium",
                        "statement_descriptor": "Spotify",
                        "interval": "month",
                        "interval_count": 1,
                        "minimum_price": 10000,
                        "billing_type": "postpaid",
                        "payment_methods": [
                            "boleto",
                            "credit_card"
                        ],
                        "installments": [
                            1
                        ],
                        "status": "active",
                        "currency": "BRL",
                        "created_at": "2017-08-10T21:27:08Z",
                        "updated_at": "2017-08-10T21:33:24Z",
                        "items": [
                            {
                                "id": "pi_JDG10BpS1sKwboXk",
                                "name": "Premium",
                                "quantity": 1,
                                "status": "active",
                                "created_at": "2017-08-10T21:27:08Z",
                                "updated_at": "2017-08-10T21:27:08Z",
                                "pricing_scheme": {
                                    "price": 1490,
                                    "scheme_type": "unit"
                                }
                            }
                        ],
                        "metadata": {
                            "code": "1234",
                            "company": "Avengers"
                        }
                    }
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: plan_jEJWD1qF2Xf92eKv
                  name:
                    type: string
                    example: Premium
                  description:
                    type: string
                    example: Vá de Premium. E seja feliz!
                  url:
                    type: string
                    example: /plans/plan_jEJWD1qF2Xf92eKv/pagarme-teste/premium
                  statement_descriptor:
                    type: string
                    example: Spotify
                  interval:
                    type: string
                    example: month
                  interval_count:
                    type: integer
                    example: 1
                    default: 0
                  minimum_price:
                    type: integer
                    example: 10000
                    default: 0
                  billing_type:
                    type: string
                    example: postpaid
                  payment_methods:
                    type: array
                    items:
                      type: string
                      example: boleto
                  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-08-10T21:27:08Z
                  updated_at:
                    type: string
                    example: 2017-08-10T21:33:24Z
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: pi_JDG10BpS1sKwboXk
                        name:
                          type: string
                          example: Premium
                        quantity:
                          type: integer
                          example: 1
                          default: 0
                        status:
                          type: string
                          example: active
                        created_at:
                          type: string
                          example: 2017-08-10T21:27:08Z
                        updated_at:
                          type: string
                          example: 2017-08-10T21:27:08Z
                        pricing_scheme:
                          type: object
                          properties:
                            price:
                              type: integer
                              example: 1490
                              default: 0
                            scheme_type:
                              type: string
                              example: unit
                  metadata:
                    type: object
                    properties:
                      code:
                        type: string
                        example: "1234"
                      company:
                        type: string
                        example: Avengers
        "404":
          description: "404"
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "message": "Plan not found."
                    }
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Plan not found.
      deprecated: false
security:
  - sec0: []
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic
```
