---
updatedAt: 2026-04-06T17:18:50.000Z
agentTools:
  projectIndex: https://docs.pagar.me/v1/llms.txt
---

# Retornando assinaturas

Essa rota é utilizada para retornar os dados de todas assinaturas.

> 📘 Filtros de objetos
>
> Para filtrar por chaves nested de objetos usa-se a sintaxe de chaves. Por exemplo:
>
> ```shell
> curl -X GET https://api.pagar.me/1/subscriptions \
> -d 'api_key=SUA_API_KEY'
> -d 'metadata[chave]=valor'
> ```

> 📘 Filtros de range
>
> Todos os filtros mencionados podem ser usados para buscas em ranges usando os prefixos:
>
> | Prefixo | Significado      |
> | ------- | ---------------- |
> | <       | menor que        |
> | >       | maior que        |
> | <=      | menor ou igual a |
> | >=      | maior ou igual a |
>
> Por exemplo,  para buscar em um range de date\_created:
>
> ```shell
> curl -X GET https://api.pagar.me/1/subscriptions \
> -d 'api_key=SUA_API_KEY'
> -d 'date_created=>=1483236000000'
> -d 'date_created=<=1484689847590'
> ```
>
> Para campos que sejam strings, a comparação é lexicográfica, letras maiúsculas sendo 'maiores' que minúsculas.

> 📘 Exemplo de paginação utilizando cursor
>
> A primeira requisição da paginação não contém o parâmetro cursor visto que ainda nenhum token foi retornado. Segue abaixo o exemplo da primeira requisição:
>
> ```shell
> curl -X GET https://api.pagar.me/1/subscriptions \
> -d 'api_key=SUA_API_KEY'
> ```
>
> No retorno da requisição anterior, será retornado nos headers da resposta os parâmetros x-cursor-previouspagr e x-cursor-nextpage, onde o primeiro será vazio (porque não existe uma pagina anterior no momento) e o segundo conterá o Token de acesso a próxima página.
>
> Dito isto, para acessar a próxima página da listagem, devemos informar dentro do campo cursor o Token retornado no parâmetro x-cursor-nextpage da resposta, como mostra a requisição abaixo:
>
> ```shell
> curl -X GET https://api.pagar.me/1/subscriptions \
> -d 'api_key=SUA_API_KEY'
> -d 'cursor=TOKEN_RETORNADO_NO_CURSOR_NEXTPAGE'
> ```
>
> Para ir avançando para as próximas páginas da listagem, basta ir substituindo o Token passado no parâmetro cursor pelo Token retornado em casa resposta da requisição.
>
> Para consultar a página anterior de uma listagem seguimos a mesma estrutura, onde o que muda é apenas o Token informado no parâmetro cursor, como mostra o exemplo abaixo:
>
> ```shell
> curl -X GET https://api.pagar.me/1/subscriptions \
> -d 'api_key=SUA_API_KEY'
> -d 'cursor=TOKEN_RETORNADO_NO_CURSOR_PREVIOUSPAGE'
> ```

> 🚧 Filtros de data
>
> É importante notar o formato das datas para o filtro. Para gerar o unixTimeStamp de uma data, é possível utilizar o console do Google Chrome e utilizar o seguinte código em Javascript :
>
> ```
> new Date("2017-12-25T02:00:00.000Z").getTime()
> ```
>
> que retornará `1514167200000`. Da mesma maneira, para criar uma data ISO date, basta fazer:
>
> ```
> new Date().toISOString()
> ```

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-settings",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.pagar.me/1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "x-default": "",
        "type": "apiKey",
        "name": "api_key",
        "in": "query"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/subscriptions": {
      "get": {
        "summary": "Retornando assinaturas",
        "description": "Essa rota é utilizada para retornar os dados de todas assinaturas.",
        "operationId": "retornando-assinaturas",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Filtro por id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payment_method",
            "in": "query",
            "description": "Filtro pelo meio de pagamento",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "card_brand",
            "in": "query",
            "description": "Filtro pela bandeira do cartão",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "card_last_digits",
            "in": "query",
            "description": "Filtro pelos 4 ultimos dígitos do cartão",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "current_period_start",
            "in": "query",
            "description": "Filtro pelo começo do período atual da assinatura em ISODate",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "current_period_end",
            "in": "query",
            "description": "Filtro pelo fim do período atual em ISODate",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filtro pelo status da assinatura",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_created",
            "in": "query",
            "description": "Filtro pela data de criação",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "metadata",
            "in": "query",
            "description": "Filtro pelo metadata",
            "schema": {
              "type": "string",
              "format": "json"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "Retorna `n` resultados, com um máximo de 1000",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Útil para implementação de uma paginação de resultados, permitindo a troca de páginas utilizando `x-cursor-nextpage` ou `x-cursor-previouspage`.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "x-cursor-nextpage",
            "in": "query",
            "description": "Retornado nos headers da resposta contém o `Token` que permite acesso a próxima página.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-cursor-previouspage",
            "in": "query",
            "description": "Retornado nos headers da resposta contém o `Token` que permite acesso a página anterior.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_updated",
            "in": "query",
            "description": "Filtro pela data de atualização da assinatura",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "[\n  {\n    \"object\": \"subscription\",\n    \"plan\": {\n      \"object\": \"plan\",\n      \"id\": 166235,\n      \"amount\": 10000,\n      \"days\": 30,\n      \"name\": \"The Turtles Plan\",\n      \"trial_days\": 0,\n      \"date_created\": \"2017-06-19T12:24:11.015Z\",\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\": \"46650\",\n      \"soft_descriptor\": null,\n      \"tid\": 1629201,\n      \"nsu\": 1629201,\n      \"date_created\": \"2017-06-19T12:26:05.425Z\",\n      \"date_updated\": \"2017-06-19T12:26:05.952Z\",\n      \"amount\": 10000,\n      \"authorized_amount\": 10000,\n      \"paid_amount\": 10000,\n      \"refunded_amount\": 0,\n      \"installments\": 1,\n      \"id\": 1629201,\n      \"cost\": 50,\n      \"card_holder_name\": \"Aardvark da Silva\",\n      \"card_last_digits\": \"4242\",\n      \"card_first_digits\": \"424242\",\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\": \"api_key\",\n      \"ip\": \"189.8.94.42\",\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\": \"4242\",\n    \"current_period_start\": \"2017-06-19T12:27:01.672Z\",\n    \"current_period_end\": \"2017-07-19T12:27:01.672Z\",\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\": \"424242\",\n      \"last_digits\": \"4242\",\n      \"country\": \"AR\",\n      \"fingerprint\": \"SK+CuBxPYsE7\",\n      \"valid\": true,\n      \"expiration_date\": \"1220\"\n    },\n    \"metadata\": null,\n    \"settled_charges\": null\n  },\n  {\n    \"object\": \"subscription\",\n    \"plan\": {\n      \"object\": \"plan\",\n      \"id\": 166231,\n      \"amount\": 10000,\n      \"days\": 30,\n      \"name\": \"The Turtle Plan\",\n      \"trial_days\": 0,\n      \"date_created\": \"2017-06-19T11:55:24.273Z\",\n      \"payment_methods\": [\n        \"boleto\",\n        \"credit_card\"\n      ],\n      \"color\": null,\n      \"charges\": null,\n      \"installments\": 1,\n      \"invoice_reminder\": null\n    },\n    \"id\": 205880,\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\": \"34097\",\n      \"soft_descriptor\": null,\n      \"tid\": 1629199,\n      \"nsu\": 1629199,\n      \"date_created\": \"2017-06-19T12:24:01.916Z\",\n      \"date_updated\": \"2017-06-19T12:24:02.484Z\",\n      \"amount\": 10000,\n      \"authorized_amount\": 10000,\n      \"paid_amount\": 10000,\n      \"refunded_amount\": 0,\n      \"installments\": 1,\n      \"id\": 1629199,\n      \"cost\": 50,\n      \"card_holder_name\": \"Aardvark da Silva\",\n      \"card_last_digits\": \"4242\",\n      \"card_first_digits\": \"424242\",\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\": \"api_key\",\n      \"ip\": \"189.8.94.42\",\n      \"subscription_id\": 205880,\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\": \"4242\",\n    \"current_period_start\": \"2017-06-19T12:24:01.900Z\",\n    \"current_period_end\": \"2017-07-19T12:24:01.900Z\",\n    \"charges\": 0,\n    \"status\": \"paid\",\n    \"date_created\": \"2017-06-19T12:24:02.463Z\",\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\": \"424242\",\n      \"last_digits\": \"4242\",\n      \"country\": \"AR\",\n      \"fingerprint\": \"SK+CuBxPYsE7\",\n      \"valid\": true,\n      \"expiration_date\": \"1220\"\n    },\n    \"metadata\": null,\n    \"settled_charges\": null\n  }\n]"
                  }
                },
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "object": {
                        "type": "string",
                        "example": "subscription"
                      },
                      "plan": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string",
                            "example": "plan"
                          },
                          "id": {
                            "type": "integer",
                            "example": 166235,
                            "default": 0
                          },
                          "amount": {
                            "type": "integer",
                            "example": 10000,
                            "default": 0
                          },
                          "days": {
                            "type": "integer",
                            "example": 30,
                            "default": 0
                          },
                          "name": {
                            "type": "string",
                            "example": "The Turtles Plan"
                          },
                          "trial_days": {
                            "type": "integer",
                            "example": 0,
                            "default": 0
                          },
                          "date_created": {
                            "type": "string",
                            "example": "2017-06-19T12:24:11.015Z"
                          },
                          "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": "46650"
                          },
                          "soft_descriptor": {},
                          "tid": {
                            "type": "integer",
                            "example": 1629201,
                            "default": 0
                          },
                          "nsu": {
                            "type": "integer",
                            "example": 1629201,
                            "default": 0
                          },
                          "date_created": {
                            "type": "string",
                            "example": "2017-06-19T12:26:05.425Z"
                          },
                          "date_updated": {
                            "type": "string",
                            "example": "2017-06-19T12:26:05.952Z"
                          },
                          "amount": {
                            "type": "integer",
                            "example": 10000,
                            "default": 0
                          },
                          "authorized_amount": {
                            "type": "integer",
                            "example": 10000,
                            "default": 0
                          },
                          "paid_amount": {
                            "type": "integer",
                            "example": 10000,
                            "default": 0
                          },
                          "refunded_amount": {
                            "type": "integer",
                            "example": 0,
                            "default": 0
                          },
                          "installments": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          },
                          "id": {
                            "type": "integer",
                            "example": 1629201,
                            "default": 0
                          },
                          "cost": {
                            "type": "integer",
                            "example": 50,
                            "default": 0
                          },
                          "card_holder_name": {
                            "type": "string",
                            "example": "Aardvark da Silva"
                          },
                          "card_last_digits": {
                            "type": "string",
                            "example": "4242"
                          },
                          "card_first_digits": {
                            "type": "string",
                            "example": "424242"
                          },
                          "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": {
                            "type": "string",
                            "example": "api_key"
                          },
                          "ip": {
                            "type": "string",
                            "example": "189.8.94.42"
                          },
                          "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": "4242"
                      },
                      "current_period_start": {
                        "type": "string",
                        "example": "2017-06-19T12:27:01.672Z"
                      },
                      "current_period_end": {
                        "type": "string",
                        "example": "2017-07-19T12:27:01.672Z"
                      },
                      "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": "424242"
                          },
                          "last_digits": {
                            "type": "string",
                            "example": "4242"
                          },
                          "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": {}
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X GET https://api.pagar.me/1/subscriptions -H 'content-type: application/json' -d '{\n    \"api_key\": \"SUA_API_KEY\", \n    \"count\": \"2\", \n    \"page\": \"1\"\n}'"
            },
            {
              "language": "ruby",
              "code": "require 'pagarme'\n\nPagarMe.api_key = \"SUA_API_KEY\"\n\nsubscriptions = PagarMe::Subscription.all()\n"
            },
            {
              "language": "php",
              "code": "<?php\nrequire(\"vendor/autoload.php\");\n$pagarme = new PagarMe\\Client('SUA_CHAVE_DE_API');\n\n$subscription = $pagarme->subscriptions()->getList();"
            },
            {
              "language": "csharp",
              "code": "PagarMeService.DefaultApiKey = \"SUA_API_KEY\";\n\nvar subscriptions = PagarMeService.GetDefaultService().Subscriptions.FindAll(new Subscription());\n"
            },
            {
              "language": "java",
              "code": "import java.util.Collection;\n\nimport me.pagar.model.PagarMe;\nimport me.pagar.model.PagarMeException;\nimport me.pagar.model.Subscription;\n\nPagarMe.init(\"SUA_API_KEY\");\n\nInteger count = 10;\nInteger page = 1;\nCollection<Subscription> subs = new Subscription().findCollection(count, page);"
            },
            {
              "language": "javascript",
              "code": "const pagarme = require('pagarme')\n  \npagarme.client.connect({ api_key: 'SUA_API_KEY' })\n  .then(client => client.subscriptions.all())\n  .then(subscriptions => console.log(subscriptions))",
              "name": "JS"
            }
          ],
          "samples-languages": [
            "curl",
            "ruby",
            "php",
            "csharp",
            "java",
            "javascript"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```