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

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

# Editar metadados da assinatura

`PATCH` `/subscriptions/{subscription_id}/metadata`

Operation ID: `editar-metadados-da-assinatura-1`

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

## Path parameters

- `subscription_id` (string, required) - Código da assinatura.<br>Formato: `sub_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:
  /subscriptions/{subscription_id}/metadata:
    patch:
      summary: Editar metadados da assinatura
      description: Com o verbo _HTTP PATCH_, através do identificador da assinatura
        (`subscription_id`) é possível atualizar o objeto `metadata` da
        assinatura.
      operationId: editar-metadados-da-assinatura-1
      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:
                - metadata
              properties:
                metadata:
                  type: string
                  description: Objeto chave/valor utilizado para armazenar informações adicionais
                    sobre a assinatura.<br>[Saiba mais sobre
                    metadata](https://docs.pagar.me/reference/metadata-1)
            examples:
              Request Example:
                value:
                  metadata:
                    code: "1234"
                    company: Avengers
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value: >-
                    {
                        "id": "sub_yOkq7oI03S7Wq741",
                        "code": "V9OMHENIK6",
                        "start_at": "2017-08-10T00:00:00Z",
                        "interval": "month",
                        "interval_count": 1,
                        "billing_type": "postpaid",
                        "gateway_affiliation_id": "C56A4180-65AA-42EC-A945-5FD21DEC0538",
                        "boleto_due_days":5,
                        "minimum_price": 10000,
                        "current_cycle": {
                            "id": "cycle_Z82JyBgSM2iwe4Lp",
                            "start_at": "2017-08-10T00:00:00Z",
                            "end_at": "2017-09-09T23:59:59Z",
                            "billing_at": "2017-09-10T00:00:00Z"
                        },
                        "setup": {
                            "id": "or_8e0l1KGFZgIpzNVG",
                            "description": "Inscrição",
                            "amount": 9990,
                            "status": "paid"
                        },
                        "next_billing_at": "2017-09-10T00:00:00Z",
                        "payment_method": "credit_card",
                        "currency": "BRL",
                        "statement_descriptor": "Spotify",
                        "installments": 1,
                        "status": "active",
                        "created_at": "2017-08-10T21:27:13Z",
                        "updated_at": "2017-08-10T21:27:29Z",
                        "customer": {
                            "id": "cus_4jEgBpgfbIe6vnqy",
                            "name": "Tony Stark",
                            "email": "f95783c1-c288-4dfb-9e1f-c3b9a4d55a7b@avengers.com",
                            "delinquent": false,
                            "created_at": "2017-08-10T21:27:11Z",
                            "updated_at": "2017-08-10T21:27:11Z",
                            "phones": {}
                        },
                        "card": {
                            "id": "card_bQzW0GMfnAsry6KM",
                            "first_six_digits": "342793",
                            "last_four_digits": "8229",
                            "brand": "Amex",
                            "holder_name": "Tony Stark",
                            "exp_month": 1,
                            "exp_year": 2018,
                            "status": "active",
                            "created_at": "2017-08-10T21:27:12Z",
                            "updated_at": "2017-08-10T21:27:12Z",
                            "billing_address": {
                                "line_1": "10880, Malibu Point, Malibu Central",
                                "zip_code": "90265",
                                "city": "Malibu",
                                "state": "CA",
                                "country": "US"
                            },
                            "type": "credit"
                        },
                        "plan": {
                            "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,
                            "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:27:08Z"
                        },
                        "items": [
                            {
                                "id": "si_ZY8Vrapsnu9QjMde",
                                "description": "Premium",
                                "quantity": 1,
                                "status": "active",
                                "created_at": "2017-08-10T21:27:14Z",
                                "updated_at": "2017-08-10T21:27:14Z",
                                "pricing_scheme": {
                                    "price": 1490,
                                    "scheme_type": "unit"
                                }
                            }
                        ],
                        "metadata": {
                            "code": "1234",
                            "company": "Avengers"
                        }
                    }
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: sub_yOkq7oI03S7Wq741
                  code:
                    type: string
                    example: V9OMHENIK6
                  start_at:
                    type: string
                    example: 2017-08-10T00:00:00Z
                  interval:
                    type: string
                    example: month
                  interval_count:
                    type: integer
                    example: 1
                    default: 0
                  billing_type:
                    type: string
                    example: postpaid
                  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
                  current_cycle:
                    type: object
                    properties:
                      id:
                        type: string
                        example: cycle_Z82JyBgSM2iwe4Lp
                      start_at:
                        type: string
                        example: 2017-08-10T00:00:00Z
                      end_at:
                        type: string
                        example: 2017-09-09T23:59:59Z
                      billing_at:
                        type: string
                        example: 2017-09-10T00:00:00Z
                  setup:
                    type: object
                    properties:
                      id:
                        type: string
                        example: or_8e0l1KGFZgIpzNVG
                      description:
                        type: string
                        example: Inscrição
                      amount:
                        type: integer
                        example: 9990
                        default: 0
                      status:
                        type: string
                        example: paid
                  next_billing_at:
                    type: string
                    example: 2017-09-10T00: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: 2017-08-10T21:27:13Z
                  updated_at:
                    type: string
                    example: 2017-08-10T21:27:29Z
                  customer:
                    type: object
                    properties:
                      id:
                        type: string
                        example: cus_4jEgBpgfbIe6vnqy
                      name:
                        type: string
                        example: Tony Stark
                      email:
                        type: string
                        example: f95783c1-c288-4dfb-9e1f-c3b9a4d55a7b@avengers.com
                      delinquent:
                        type: boolean
                        example: false
                        default: true
                      created_at:
                        type: string
                        example: 2017-08-10T21:27:11Z
                      updated_at:
                        type: string
                        example: 2017-08-10T21:27:11Z
                      phones:
                        type: object
                        properties: {}
                  card:
                    type: object
                    properties:
                      id:
                        type: string
                        example: card_bQzW0GMfnAsry6KM
                      first_six_digits:
                        type: string
                        example: "342793"
                      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: 2017-08-10T21:27:12Z
                      updated_at:
                        type: string
                        example: 2017-08-10T21:27:12Z
                      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
                      type:
                        type: string
                        example: credit
                  plan:
                    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
                      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:27:08Z
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: si_ZY8Vrapsnu9QjMde
                        description:
                          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:14Z
                        updated_at:
                          type: string
                          example: 2017-08-10T21:27:14Z
                        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": "Subscription not found."
                    }
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Subscription not found.
      deprecated: false
security:
  - sec0: []
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic
```
