openapi: 3.2.0
info:
title: pagarme-api Subscriptions API
version: '5'
servers:
- url: https://api.pagar.me/core/v5
security:
- sec0: []
tags:
- name: Subscriptions
paths:
/subscriptions:
post:
summary: Criar assinatura de plano
description: Fornecemos a possibilidade de criação de uma assinatura (`subscription`) a partir de plano (`plan`).
operationId: criar-assinatura-de-plano-1
requestBody:
content:
application/json:
schema:
type: object
required:
- plan_id
- payment_method
- customer_id
- customer
- card
properties:
code:
type: string
description: 'Código da assinatura no sistema da loja. Máx.: 52 caracteres'
plan_id:
type: string
description: 'Código do plano.
Formato: `plan_XXXXXXXXXXXXXXXX`'
payment_method:
type: string
description: 'Meio de pagamento.
Valores possíveis: **credit_card**, **boleto** e **debit_card** .'
start_at:
type: string
description: Data de início da assinatura.
Se não for informada, a assinatura será iniciada **imediatamente**.
format: date
customer_id:
type: string
description: Código do cliente.
**Obrigatório** caso o `customer` não seja informado. [Saiba mais sobre clientes](https://docs.pagar.me/reference/clientes-1).
customer:
type: object
description: Dados do cliente.
**Obrigatório** caso o `customer_id` não seja informado. [Saiba mais sobre clientes](https://docs.pagar.me/reference/clientes-1).
required:
- name
properties:
name:
type: string
description: 'Nome do cliente. Max: 64 caracteres.'
type:
type: string
description: 'Tipo de cliente. Valores possíveis: individual (pessoa física) ou company (pessoa jurídica). Obrigatório, caso o document seja enviado.'
email:
type: string
description: 'E-mail do cliente. Max: 64 caracteres.'
code:
type: string
description: 'Código de referência do cliente no sistema da loja. Max: 52 caracteres.'
document:
type: string
description: 'CPF, CNPJ ou PASSAPORTE do cliente. Max: 16 caracteres para CPF e CNPJ e Max: 50 caracteres para PASSAPORTE.'
document_type:
type: string
description: 'Tipo de documento. Valores possíveis: "CPF", "CNPJ" ou "PASSPORT".'
gender:
type: string
description: 'Sexo do cliente . Valores possíveis: male ou female.'
address:
type: object
description: Endereço do cliente.
properties:
country:
type: string
description: País (Código do país no formato ISO 3166-1 alpha-2)(2 digitos)
state:
type: string
description: Estado (Código do estado no formato ISO 3166-2).
city:
type: string
description: Cidade.
zip_code:
type: string
description: Código Postal (CEP) (Apenas numérico).
line_1:
type: string
description: Dados principais do endereço. Neste campo deve ser informado Número, Rua, Bairro, nesta ordem e separados por vírgula.
line_2:
type: string
description: Dados complementares do endereço. Neste campo pode ser informado complemento, referências.
phones:
type: object
description: Telefone residencial do cliente.
properties:
home_phone:
type: object
description: Telefone residencial do cliente.
properties:
country_code:
type: string
description: Código do País (Apenas numérico).
area_code:
type: string
description: Código da área (Apenas numérico).
number:
type: string
description: Número do telefone (Apenas numérico).
mobile_phone:
type: object
description: Telefone celular do cliente.
properties:
country_code:
type: string
description: Código do País (Apenas numérico).
area_code:
type: string
description: Código da área (Apenas numérico).
number:
type: string
description: Número do telefone (Apenas numérico).
birthdate:
type: string
description: Data de nascimento do cliente.
format: date
metadata:
type: string
description: Objeto chave/valor utilizado para armazenar informações adicionais sobre o cliente.
card:
type: object
description: Cartão que será utilizado na assinatura.
**- card_id** é o código do cartão do cliente.
**- card_token** é token do cartão gerado pelo checkout transparente.
É **obrigatório** o envio de uma dessas identificações, caso o **payment_method** seja credit_card ou debit_card.
[Saiba mais sobre cartões](https://docs.pagar.me/reference/cart%C3%B5es-1).
required:
- number
- holder_name
- exp_month
- exp_year
properties:
number:
type: string
description: Número do cartão. Entre 13 e 19 caracteres
holder_name:
type: string
description: Nome do portador como está impresso no cartão. Máximo de 64 caracteres (Caracteres especiais e números não são aceitos)
holder_document:
type: string
description: CPF ou CNPJ do portador do cartão. Obrigatório caso o tipo do cartão seja voucher (bandeiras VR ou Pluxee).
exp_month:
type: integer
description: Mês de validade do cartão. Valor entre 1 e 12 (inclusive)
format: int32
exp_year:
type: integer
description: 'Ano de validade do cartão. Formatos yy ou yyyy. Ex: 23 ou 2023.'
format: int32
cvv:
type: string
description: Código de segurança do cartão. O campo aceita 4 ou 3 caracteres, variando por bandeira.
brand:
type: string
description: '(Opcional) Bandeira do cartão. Para cartões de crédito, temos como valores possíveis: Elo, Mastercard, Visa, Amex, ou Hipercard. Para voucher, temos como valores possíveis: Alelo, Ticket, VR ou Pluxee.'
label:
type: string
description: Indica a label do cartão
billing_address_id:
type: string
description: 'Código do endereço de cobrança. Max: 36 caracteres.<>Opcional, pode ser utilizado no lugar do billing_address.'
billing_address:
type: object
properties:
line_1:
type: string
description: 'Linha 1 do endereço. (Número, Rua, e Bairro - Nesta ordem e separados por vírgula) Max: 256 caracteres.'
line_2:
type: string
description: 'Linha 2 do endereço. (Complemento - Andar, Sala, Apto). Max: 128 caracteres.'
zip_code:
type: string
description: 'CEP. Max: 16 caracteres.'
city:
type: string
description: 'Cidade. Max: 64 caracteres.'
state:
type: string
description: Código do estado no formato ISO 3166-2.
country:
type: string
description: Código do país no formato ISO 3166-1 alpha-2.
installments:
type: integer
description: Quantidade de parcelas.
O número de parcelas deverá ser 1 em recorrências.
default: 1
format: int32
discounts:
type: array
description: Descontos.
items:
properties:
cycles:
type: string
description: Número de vezes que o desconto será aplicado.
value:
type: string
description: Valor do desconto.
discount_type:
type: string
description: 'Tipo do desconto. Valores possíveis: flat ou percentage. Valor padrão: percentage.'
type: object
increments:
type: array
description: Incrementos
items:
properties:
value:
type: integer
description: Valor do incremento.
format: int32
cycles:
type: string
description: Número de vezes que o incremento será aplicado.
increment_type:
type: string
description: 'Tipo do incremento. Valores possíveis: flat ou percentage. Valor padrão: percentage.'
type: object
boleto_due_days:
type: integer
description: Dias para expiração do boleto. (Caso não seja passado, será pego um valor padrão das configurações da loja)
format: int32
metadata:
type: string
description: Objeto chave/valor utilizado para armazenar informações adicionais sobre a assinatura.
[Saiba mais sobre metadata](https://docs.pagar.me/reference/metadata-1).
examples:
JSON (with credit card):
value:
plan_id: plan_21r4CTG0ux77Qv13
payment_method: credit_card
boleto_due_days: 5
customer:
name: Tony Stark
email: tonystark@avengers.com
card:
holder_name: Tony Stark
number: '4532464862385322'
exp_month: 1
exp_year: 30
cvv: '903'
billing_address:
line_1: 375, Av. General Justo, Centro
line_2: 8º andar
zip_code: '20021130'
city: Rio de Janeiro
state: RJ
country: BR
discounts:
- cycles: 3
value: 10
discount_type: percentage
increments:
- cycles: 2
value: 20
discount_type: percentage
metadata:
id: my_subscription_id
JSON (with boleto):
value:
plan_id: plan_21r4CTG0ux77Qv13
customer:
name: Tony Stark
email: tonystark@avengers.com
payment_method: boleto
responses:
'200':
description: '200'
content:
application/json:
examples:
OK (with credit card):
value: "{\n \"id\": \"sub_05jkdIfGYPfN26mI\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"interval\": \"month\",\n \"interval_count\": 3,\n \"billing_type\": \"prepaid\",\n \"boleto_due_days\":5,\n \"current_cycle\": {\n \"start_at\": \"2016-07-19T00:00:00Z\",\n \"end_at\": \"2016-10-18T23:59:59Z\"\n },\n \"next_billing_at\": \"2016-10-19T00:00:00Z\",\n \"installments\": 3,\n \"customer\": {\n \"id\": \"cus_017228NmffGbA3d4\",\n \"name\": \"Luke Skywalker\",\n \"email\": \"lskywalker@r2d2.com\",\n \"delinquent\": false,\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\",\n },\n \"card\": {\n \"id\": \"card_Mome2meGz4PDNQbX\",\n \"holder_name\": \"Luke Skywalker\",\n \"masked_number\": \"453246******5322\",\n \"exp_month\": 1,\n \"exp_year\": 30,\n \"expired\": false,\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"update_at\": \"2016-07-12T18:25:40Z\",\n \"billing_address\": {\n \"id\": \"addr_Mome2meGz4PDNQbX\",\n \"line_1\": \"375, Av. General Justo, Centro\",\n \"line_2\": \"8º andar\",\n \"zip_code\": \"20021130\",\n \"city\": \"Rio de Janeiro\",\n \"state\": \"RJ\",\n \"country\": \"BR\",\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\"\n }\n },\n \"plan\": {\n \"id\": \"plan_21r4CTG0ux77Qv13\",\n \"name\": \"Plano Gold\",\n \"url\": \"/plan_21r4CTG0ux77Qv13/academia/plano-gold\",\n \"currency\": \"BRL\",\n \"interval\": \"month\",\n \"minimum_price\": 10000,\n \"interval_count\": 3,\n \"billing_type\": \"prepaid\",\n \"installments\": 3,\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\",\n \"metadata\": {\n \"id\": \"my_plan_id\"\n }\n },\n \"discounts\": [\n {\n \"id\": \"si_k2zpBDMsOs0fDfHe\",\n \"cycles\": 3,\n \"value\": 10,\n \"discount_type\": \"percentage\",\n \"created_at\": \"2016-07-12T18:25:40Z\"\n }\n ],\n \"increments\": [\n {\n \"cycles\": 2,\n \"value\": 20,\n \"discount_type\": \"percentage\"\n }\n ],\n \"items\": [\n {\n \"id\": \"si_B6555Riyq9lj6klS\",\n \"description\": \"Musculação\",\n \"quantity\": 1,\n \"pricing_scheme\": {\n \"price\": 18990\n },\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\",\n },\n {\n \"id\": \"si_lFjtC2xYGttulJpn\",\n \"description\": \"Matrícula\",\n \"quantity\": 1,\n \"cycles\": 1,\n \"pricing_scheme\": {\n \"price\": 5990\n },\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\",\n }\n ],\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\",\n \"metadata\": {\n \"id\": \"my_subscription_id\"\n }\n}"
OK (with boleto):
value: "{\n \"id\": \"sub_bpYjMr9f8sA6QJNg\",\n \"code\": \"XPLMBV9U10\",\n \"start_at\": \"2018-04-04T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"current_cycle\": {\n \"id\": \"cycle_j6WnJ7ei1hW68bXo\",\n \"start_at\": \"2018-04-04T00:00:00Z\",\n \"end_at\": \"2018-05-03T23:59:59Z\",\n \"billing_at\": \"2018-05-04T00:00:00Z\"\n },\n \"next_billing_at\": \"2018-05-04T00:00:00Z\",\n \"payment_method\": \"boleto\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2018-04-04T21:36:13Z\",\n \"updated_at\": \"2018-04-04T21:36:13Z\",\n \"customer\": {\n \"id\": \"cus_qr2AgDGiOhr61Y5L\",\n \"name\": \"Tony Stark\",\n \"email\": \"cc25e912-197c-4626-a85d-8c0597e9b157@avengers.com\",\n \"delinquent\": false,\n \"created_at\": \"2018-04-04T21:36:13Z\",\n \"updated_at\": \"2018-04-04T21:36:13Z\",\n \"phones\": {}\n },\n \"plan\": {\n \"id\": \"plan_85AK5eF15feLKM4J\",\n \"name\": \"Premium\",\n \"description\": \"Vá de Premium. E seja feliz!\",\n \"url\": \"/plans/plan_85AK5eF15feLKM4J/pagarme-teste/premium\",\n \"statement_descriptor\": \"Spotify\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"payment_methods\": [\n \"boleto\",\n \"credit_card\"\n ],\n \"installments\": [\n 1\n ],\n \"status\": \"active\",\n \"currency\": \"BRL\",\n \"created_at\": \"2018-04-04T21:36:09Z\",\n \"updated_at\": \"2018-04-04T21:36:09Z\"\n },\n \"items\": [\n {\n \"id\": \"si_xGw3AeYiaTJ639A6\",\n \"name\": \"Name - Premium\",\n \"description\": \"Test - Description\",\n \"quantity\": 1,\n \"status\": \"active\",\n \"created_at\": \"2018-04-04T21:36:13Z\",\n \"updated_at\": \"2018-04-04T21:36:13Z\",\n \"pricing_scheme\": {\n \"price\": 1490,\n \"scheme_type\": \"unit\"\n }\n }\n ]\n}"
schema:
type: object
properties:
id:
type: string
example: sub_bpYjMr9f8sA6QJNg
code:
type: string
example: XPLMBV9U10
start_at:
type: string
example: '2018-04-04T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
current_cycle:
type: object
properties:
id:
type: string
example: cycle_j6WnJ7ei1hW68bXo
start_at:
type: string
example: '2018-04-04T00:00:00Z'
end_at:
type: string
example: '2018-05-03T23:59:59Z'
billing_at:
type: string
example: '2018-05-04T00:00:00Z'
next_billing_at:
type: string
example: '2018-05-04T00:00:00Z'
payment_method:
type: string
example: boleto
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-04T21:36:13Z'
updated_at:
type: string
example: '2018-04-04T21:36:13Z'
customer:
type: object
properties:
id:
type: string
example: cus_qr2AgDGiOhr61Y5L
name:
type: string
example: Tony Stark
email:
type: string
example: cc25e912-197c-4626-a85d-8c0597e9b157@avengers.com
delinquent:
type: boolean
example: false
default: true
created_at:
type: string
example: '2018-04-04T21:36:13Z'
updated_at:
type: string
example: '2018-04-04T21:36:13Z'
phones:
type: object
properties: {}
plan:
type: object
properties:
id:
type: string
example: plan_85AK5eF15feLKM4J
name:
type: string
example: Premium
description:
type: string
example: Vá de Premium. E seja feliz!
url:
type: string
example: /plans/plan_85AK5eF15feLKM4J/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: '2018-04-04T21:36:09Z'
updated_at:
type: string
example: '2018-04-04T21:36:09Z'
items:
type: array
items:
type: object
properties:
id:
type: string
example: si_xGw3AeYiaTJ639A6
name:
type: string
example: Name - Premium
description:
type: string
example: Test - Description
quantity:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2018-04-04T21:36:13Z'
updated_at:
type: string
example: '2018-04-04T21:36:13Z'
pricing_scheme:
type: object
properties:
price:
type: integer
example: 1490
default: 0
scheme_type:
type: string
example: unit
'400':
description: '400'
content:
application/json:
examples:
Result:
value: '{}'
schema:
type: object
properties: {}
deprecated: false
x-readme:
code-samples:
- language: csharp
code: "using System.Collections.Generic;\nusing System.Web.Mvc;\nusing MundiAPI.PCL;\nusing MundiAPI.PCL.Models;\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 planId = \"plan_21r4CTG0ux77Qv13\";\n\n var billinAddress = new CreateAddressRequest {\n Line1 = \"375, Av. General Justo, Centro\",\n Line2 = \"8º andar\",\n ZipCode = \"20021130\",\n City = \"Rio de Janeiro\",\n State = \"RJ\",\n Country = \"BR\"\n };\n\n var card = new CreateCardRequest {\n HolderName = \"Tony Stark\",\n Number = \"4532464862385322\",\n ExpMonth = 1,\n ExpYear = 30,\n Cvv = \"903\",\n BillingAddress = billinAddress\n };\n\n var discounts = new List {\n new CreateDiscountRequest {\n Cycles = 3,\n Value = 10,\n DiscountType = \"percentage\"\n }\n };\n\n var metadata = new Dictionary ();\n metadata.Add (\"id\", \"my_subscription_id\");\n\n var request = new CreateSubscriptionRequest {\n PlanId = planId,\n PaymentMethod = \"credit_card\",\n Currency = \"BRL\",\n Interval = \"month\",\n IntervalCount = 3,\n BillingType = \"prepaid\",\n Installments = 3,\n Customer = new CreateCustomerRequest {\n Name = \"Tony Stark\",\n Email = \"tonystark@avengers.com\"\n },\n Card = card,\n Discounts = discounts,\n Metadata = metadata\n };\n\n var response = client.Subscriptions.CreateSubscription (request);\n\n return View ();\n }\n }\n}"
name: SDK C#
samples-languages:
- csharp
tags:
- Subscriptions
get:
summary: Listar assinaturas
description: Este recurso permite listar as assinaturas. Pode ser utilizados alguns parâmetros como filtro da listagem.
operationId: listar-assinaturas-1
parameters:
- name: status
in: query
description: 'Status da assinatura.
Valores possíveis: **active**, **canceled** ou **future**'
schema:
type: string
- name: code
in: query
description: 'Código da assinatura no sistema da loja. Máx.: 52 caracteres'
schema:
type: string
- name: billing_type
in: query
description: 'Tipo de cobrança.
Valores possíveis: **prepaid**, **postpaid **ou **exact_day**.'
schema:
type: string
- name: customer_id
in: query
description: Código do cliente. [Saiba mais sobre clientes](https://docs.pagar.me/reference/clientes-1).
schema:
type: string
- name: plan_id
in: query
description: 'Código do plano.
Formato: `plan_XXXXXXXXXXXXXXXX`.'
schema:
type: string
- name: card_id
in: query
description: 'Código do cartão.
Formato: `card_XXXXXXXXXXXXXXXX`.'
schema:
type: string
- name: next_billing_since
in: query
description: Data de início da próxima data de cobrança.
schema:
type: string
format: date
- name: next_billing_until
in: query
description: Data final de próxima data de cobrança.
schema:
type: string
format: date
- name: created_since
in: query
description: Data de início do período de criação a ser listado.
schema:
type: string
format: date
- name: created_until
in: query
description: Data final do período de criação a ser listado.
schema:
type: string
format: date
- name: page
in: query
description: Página atual
schema:
type: integer
format: int32
default: 1
- name: size
in: query
description: Quantidade de itens por página.
schema:
type: integer
format: int32
default: 10
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"data\": [\n {\n \"id\": \"sub_05jkdIfGYPfN26mI\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"interval\": \"month\",\n \"gateway_affiliation_id\": \"C56A4180-65AA-42EC-A945-5FD21DEC0538\",\n \"boleto_due_days\": 5,\n \"minimum_price\": 10000,\n \"interval_count\": 3,\n \"billing_type\": \"prepaid\",\n \"current_cycle\": {\n \"start_at\": \"2016-07-19T00:00:00Z\",\n \"end_at\": \"2016-10-18T23:59:59Z\"\n },\n \"next_billing_at\": \"2016-10-19T00:00:00Z\",\n \"installments\": 3,\n \"customer\": {\n \"id\": \"cus_017228NmffGbA3d4\",\n \"name\": \"Luke Skywalker\",\n \"email\": \"lskywalker@r2d2.com\",\n \"delinquent\": false,\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\"\n },\n \"credit_card\": {\n \"id\": \"card_Mome2meGz4PDNQbX\",\n \"holder_name\": \"Luke Skywalker\",\n \"masked_number\": \"402400******4251\",\n \"exp_month\": 6,\n \"exp_year\": 17,\n \"expired\": false,\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"update_at\": \"2016-07-12T18:25:40Z\",\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 \"discounts\": [\n {\n \"id\": \"si_k2zpBDMsOs0fDfHe\",\n \"cycles\": 3,\n \"value\": 10,\n \"discount_type\": \"percentage\",\n \"created_at\": \"2016-07-12T18:25:40Z\"\n }\n ],\n \"increments\": [\n {\n \"id\": \"inc_IYzpxgjsOs0fDIoP\",\n \"cycles\": 2,\n \"value\": 20,\n \"discount_type\": \"percentage\",\n \"created_at\": \"2016-07-12T18:25:40Z\"\n }\n ],\n \"items\": [\n {\n \"id\": \"si_B6555Riyq9lj6klS\",\n \"description\": \"Musculação\",\n \"quantity\": 1,\n \"pricing_scheme\": {\n \"price\": 18990,\n \"scheme_type\": \"unit\"\n },\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\"\n }\n ],\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\",\n \"metadata\": {\n \"id\": \"my_subscription_id\"\n }\n }\n ],\n \"paging\": {\n \"total_items\": 1,\n \"current_page\": 1,\n \"total_pages\": 1\n }\n}"
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
id:
type: string
example: sub_05jkdIfGYPfN26mI
payment_method:
type: string
example: credit_card
currency:
type: string
example: BRL
interval:
type: string
example: month
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
interval_count:
type: integer
example: 3
default: 0
billing_type:
type: string
example: prepaid
current_cycle:
type: object
properties:
start_at:
type: string
example: '2016-07-19T00:00:00Z'
end_at:
type: string
example: '2016-10-18T23:59:59Z'
next_billing_at:
type: string
example: '2016-10-19T00:00:00Z'
installments:
type: integer
example: 3
default: 0
customer:
type: object
properties:
id:
type: string
example: cus_017228NmffGbA3d4
name:
type: string
example: Luke Skywalker
email:
type: string
example: lskywalker@r2d2.com
delinquent:
type: boolean
example: false
default: true
created_at:
type: string
example: '2016-07-12T18:25:40Z'
updated_at:
type: string
example: '2016-07-12T18:25:40Z'
credit_card:
type: object
properties:
id:
type: string
example: card_Mome2meGz4PDNQbX
holder_name:
type: string
example: Luke Skywalker
masked_number:
type: string
example: 402400******4251
exp_month:
type: integer
example: 6
default: 0
exp_year:
type: integer
example: 17
default: 0
expired:
type: boolean
example: false
default: true
status:
type: string
example: active
created_at:
type: string
example: '2016-07-12T18:25:40Z'
update_at:
type: string
example: '2016-07-12T18:25:40Z'
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
discounts:
type: array
items:
type: object
properties:
id:
type: string
example: si_k2zpBDMsOs0fDfHe
cycles:
type: integer
example: 3
default: 0
value:
type: integer
example: 10
default: 0
discount_type:
type: string
example: percentage
created_at:
type: string
example: '2016-07-12T18:25:40Z'
increments:
type: array
items:
type: object
properties:
id:
type: string
example: inc_IYzpxgjsOs0fDIoP
cycles:
type: integer
example: 2
default: 0
value:
type: integer
example: 20
default: 0
discount_type:
type: string
example: percentage
created_at:
type: string
example: '2016-07-12T18:25:40Z'
items:
type: array
items:
type: object
properties:
id:
type: string
example: si_B6555Riyq9lj6klS
description:
type: string
example: Musculação
quantity:
type: integer
example: 1
default: 0
pricing_scheme:
type: object
properties:
price:
type: integer
example: 18990
default: 0
scheme_type:
type: string
example: unit
status:
type: string
example: active
created_at:
type: string
example: '2016-07-12T18:25:40Z'
updated_at:
type: string
example: '2016-07-12T18:25:40Z'
status:
type: string
example: active
created_at:
type: string
example: '2016-07-12T18:25:40Z'
updated_at:
type: string
example: '2016-07-12T18:25:40Z'
metadata:
type: object
properties:
id:
type: string
example: my_subscription_id
paging:
type: object
properties:
total_items:
type: integer
example: 1
default: 0
current_page:
type: integer
example: 1
default: 0
total_pages:
type: integer
example: 1
default: 0
'401':
description: '401'
content:
application/json:
examples:
Result:
value: "{\n \"message\": \"Authorization has been denied for this request.\"\n}"
schema:
type: object
properties:
message:
type: string
example: Authorization has been denied for this request.
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}:
get:
summary: Obter assinatura com split
description: Este recurso possibilita, através do identificador da assinatura (subscription_id), recuperar as informações da assinatura com Split.
operationId: obter-assinatura-split
parameters:
- name: subscription_id
in: path
description: 'Código da Assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX.`'
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: '{}'
schema:
type: object
properties: {}
'400':
description: '400'
content:
application/json:
examples:
Result:
value: '{}'
schema:
type: object
properties: {}
deprecated: false
tags:
- Subscriptions
delete:
summary: Cancelar assinatura
description: Com o verbo HTTP DELETE, através do identificador da assinatura (`subscription_id`) é possível cancelar a assinatura.
operationId: cancelar-assinatura-1
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
cancel_pending_invoices:
type: boolean
description: Parâmetro que define se as cobranças e faturas pendentes dentro de uma assinatura serão canceladas automaticamente com a execução do cancelamento da assinatura
default: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"sub_WeEMlp2FXFMjVq3Q\",\n \"code\": \"8YNU49TD4Z\",\n \"start_at\": \"2018-04-05T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"boleto_due_days\":5,\n \"current_cycle\": {\n \"id\": \"cycle_6ow0JqhD5sJmMJPl\",\n \"start_at\": \"2018-04-05T00:00:00Z\",\n \"end_at\": \"2018-05-04T23:59:59Z\",\n \"billing_at\": \"2018-04-05T00:00:00Z\"\n },\n \"setup\": {\n \"id\": \"or_0Wd7bYRMSmSYy8qz\",\n \"description\": \"Inscrição\",\n \"amount\": 9990,\n \"status\": \"paid\"\n },\n \"next_billing_at\": \"2018-04-05T00:00:00Z\",\n \"payment_method\": \"boleto\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"canceled\",\n \"created_at\": \"2018-04-05T03:20:16Z\",\n \"updated_at\": \"2018-04-05T12:14:06Z\",\n \"canceled_at\": \"2018-04-05T12:14:06Z\",\n \"customer\": {\n \"id\": \"cus_px3yqRSlRsVqawgj\",\n \"name\": \"Tony Stark\",\n \"email\": \"ef61ded5-9e60-40c7-89cd-a3b6e70515e8@avengers.com\",\n \"delinquent\": false,\n \"created_at\": \"2018-04-05T03:20:15Z\",\n \"updated_at\": \"2018-04-05T03:20:15Z\",\n \"phones\": {}\n },\n \"plan\": {\n \"id\": \"plan_dxVldzsgzu9rpe8v\",\n \"name\": \"Premium\",\n \"description\": \"Vá de Premium. E seja feliz!\",\n \"url\": \"/plans/plan_dxVldzsgzu9rpe8v/vodafone-teste/premium\",\n \"statement_descriptor\": \"Spotify\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"payment_methods\": [\n \"boleto\",\n \"credit_card\"\n ],\n \"installments\": [\n 1\n ],\n \"status\": \"active\",\n \"currency\": \"BRL\",\n \"created_at\": \"2018-04-04T22:17:16Z\",\n \"updated_at\": \"2018-04-04T22:17:16Z\"\n },\n \"items\": [\n {\n \"id\": \"si_5LPVYR1c7WuJd06l\",\n \"name\": \"Name - Premium\",\n \"description\": \"Test - Description\",\n \"quantity\": 1,\n \"status\": \"active\",\n \"created_at\": \"2018-04-05T03:20:16Z\",\n \"updated_at\": \"2018-04-05T03:20:16Z\",\n \"pricing_scheme\": {\n \"price\": 1490,\n \"scheme_type\": \"unit\"\n }\n }\n ]\n}"
schema:
type: object
properties:
id:
type: string
example: sub_WeEMlp2FXFMjVq3Q
code:
type: string
example: 8YNU49TD4Z
start_at:
type: string
example: '2018-04-05T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
boleto_due_days:
type: integer
example: 5
default: 0
current_cycle:
type: object
properties:
id:
type: string
example: cycle_6ow0JqhD5sJmMJPl
start_at:
type: string
example: '2018-04-05T00:00:00Z'
end_at:
type: string
example: '2018-05-04T23:59:59Z'
billing_at:
type: string
example: '2018-04-05T00:00:00Z'
setup:
type: object
properties:
id:
type: string
example: or_0Wd7bYRMSmSYy8qz
description:
type: string
example: Inscrição
amount:
type: integer
example: 9990
default: 0
status:
type: string
example: paid
next_billing_at:
type: string
example: '2018-04-05T00:00:00Z'
payment_method:
type: string
example: boleto
currency:
type: string
example: BRL
statement_descriptor:
type: string
example: Spotify
installments:
type: integer
example: 1
default: 0
status:
type: string
example: canceled
created_at:
type: string
example: '2018-04-05T03:20:16Z'
updated_at:
type: string
example: '2018-04-05T12:14:06Z'
canceled_at:
type: string
example: '2018-04-05T12:14:06Z'
customer:
type: object
properties:
id:
type: string
example: cus_px3yqRSlRsVqawgj
name:
type: string
example: Tony Stark
email:
type: string
example: ef61ded5-9e60-40c7-89cd-a3b6e70515e8@avengers.com
delinquent:
type: boolean
example: false
default: true
created_at:
type: string
example: '2018-04-05T03:20:15Z'
updated_at:
type: string
example: '2018-04-05T03:20:15Z'
phones:
type: object
properties: {}
plan:
type: object
properties:
id:
type: string
example: plan_dxVldzsgzu9rpe8v
name:
type: string
example: Premium
description:
type: string
example: Vá de Premium. E seja feliz!
url:
type: string
example: /plans/plan_dxVldzsgzu9rpe8v/vodafone-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: '2018-04-04T22:17:16Z'
updated_at:
type: string
example: '2018-04-04T22:17:16Z'
items:
type: array
items:
type: object
properties:
id:
type: string
example: si_5LPVYR1c7WuJd06l
name:
type: string
example: Name - Premium
description:
type: string
example: Test - Description
quantity:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2018-04-05T03:20:16Z'
updated_at:
type: string
example: '2018-04-05T03:20:16Z'
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.
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/cycles:
post:
summary: Renovar ciclo
description: Através do identificador da assinatura (`subscription_id`) é possível renovar o ciclo de uma assinatura. A utilização do método irá sempre renovar o ciclo à frente. Para Listar os ciclos de uma assinatura, acesse Listar Ciclos.
operationId: renovar-ciclo-1
parameters:
- name: subscription_id
in: path
description: Código da assinatura.
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"cycle_Qal5a0LCpphoDpnR\",\n \"billing_at\": \"2019-04-30T00:00:00Z\",\n \"cycle\": 1,\n \"start_at\": \"2019-04-30T00:00:00Z\",\n \"end_at\": \"2019-07-29T23:59:59Z\",\n \"duration\": 7862399,\n \"created_at\": \"2019-04-30T18:09:32Z\",\n \"updated_at\": \"2019-04-30T18:12:20Z\",\n \"status\": \"billed\"\n}"
schema:
type: object
properties:
id:
type: string
example: cycle_Qal5a0LCpphoDpnR
billing_at:
type: string
example: '2019-04-30T00:00:00Z'
cycle:
type: integer
example: 1
default: 0
start_at:
type: string
example: '2019-04-30T00:00:00Z'
end_at:
type: string
example: '2019-07-29T23:59:59Z'
duration:
type: integer
example: 7862399
default: 0
created_at:
type: string
example: '2019-04-30T18:09:32Z'
updated_at:
type: string
example: '2019-04-30T18:12:20Z'
status:
type: string
example: billed
'400':
description: '400'
content:
application/json:
examples:
Result:
value: '{}'
schema:
type: object
properties: {}
deprecated: false
tags:
- Subscriptions
get:
summary: Listar ciclos
description: Este recurso permite listar os ciclos associados a uma assinatura. Podem ser utilizados alguns parâmetros como filtro da listagem.
operationId: listar-ciclos-1
parameters:
- name: subscription_id
in: path
description: Código da assinatura.
schema:
type: string
required: true
- name: id
in: query
description: '_Código do ciclo_. Formato: `cycle_XXXXXXXXXXXXXXXX`.'
schema:
type: string
- name: billing_at
in: query
description: Data de cobrança do ciclo
schema:
type: string
format: date
- name: cycle
in: query
description: Quantidade de ciclos na assinatura
schema:
type: string
- name: start_at
in: query
description: Data de início do ciclo
schema:
type: string
- name: end_at
in: query
description: Data final do ciclo
schema:
type: string
- name: duration
in: query
schema:
type: string
- name: created_at
in: query
description: Data de criação da assinatura
schema:
type: string
- name: updated_at
in: query
description: Data de atualização do ciclo da assinatura.
schema:
type: string
format: date
- name: status
in: query
description: 'Status dos ciclos. Valores possíveis: **billed** ou **unbilled**'
schema:
type: string
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"data\": [\n {\n \"id\": \"cycle_Qal5a0LCpphoDpnR\",\n \"billing_at\": \"2019-04-30T00:00:00Z\",\n \"cycle\": 1,\n \"start_at\": \"2019-04-30T00:00:00Z\",\n \"end_at\": \"2019-07-29T23:59:59Z\",\n \"duration\": 7862399,\n \"created_at\": \"2019-04-30T18:09:32Z\",\n \"updated_at\": \"2019-04-30T18:09:33Z\",\n \"status\": \"billed\"\n }\n ],\n \"paging\": {\n \"total\": 1\n }\n}"
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
id:
type: string
example: cycle_Qal5a0LCpphoDpnR
billing_at:
type: string
example: '2019-04-30T00:00:00Z'
cycle:
type: integer
example: 1
default: 0
start_at:
type: string
example: '2019-04-30T00:00:00Z'
end_at:
type: string
example: '2019-07-29T23:59:59Z'
duration:
type: integer
example: 7862399
default: 0
created_at:
type: string
example: '2019-04-30T18:09:32Z'
updated_at:
type: string
example: '2019-04-30T18:09:33Z'
status:
type: string
example: billed
paging:
type: object
properties:
total:
type: integer
example: 1
default: 0
'400':
description: '400'
content:
application/json:
examples:
Result:
value: '{}'
schema:
type: object
properties: {}
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/cycles/{cycle_id}:
get:
summary: Obter ciclo
description: Através do identificador do ciclo (`cycle_id`) é possível recuperar as informação do ciclo de uma assinatura.
operationId: obter-ciclo-1
parameters:
- name: subscription_id
in: path
description: Código da assinatura.
schema:
type: string
required: true
- name: cycle_id
in: path
description: '_Código do ciclo_. Formato: `cycle_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"cycle_Qal5a0LCpphoDpnR\",\n \"billing_at\": \"2019-04-30T00:00:00Z\",\n \"cycle\": 1,\n \"start_at\": \"2019-04-30T00:00:00Z\",\n \"end_at\": \"2019-07-29T23:59:59Z\",\n \"duration\": 7862399,\n \"created_at\": \"2019-04-30T18:09:32Z\",\n \"updated_at\": \"2019-04-30T18:09:33Z\",\n \"status\": \"billed\"\n}"
schema:
type: object
properties:
id:
type: string
example: cycle_Qal5a0LCpphoDpnR
billing_at:
type: string
example: '2019-04-30T00:00:00Z'
cycle:
type: integer
example: 1
default: 0
start_at:
type: string
example: '2019-04-30T00:00:00Z'
end_at:
type: string
example: '2019-07-29T23:59:59Z'
duration:
type: integer
example: 7862399
default: 0
created_at:
type: string
example: '2019-04-30T18:09:32Z'
updated_at:
type: string
example: '2019-04-30T18:09:33Z'
status:
type: string
example: billed
'400':
description: '400'
content:
application/json:
examples:
Result:
value: '{}'
schema:
type: object
properties: {}
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/cycles/{cycle_id}/pay:
post:
summary: Criar fatura
description: Este recurso cria uma fatura (`invoice`) de acordo com o identificador do ciclo a ser cobrado (`cycle_id`) de um determinada assinatura (`subscription_id`).
operationId: criar-fatura-1
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
- name: cycle_id
in: path
description: 'Código do ciclo.
Formato: `cycle_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
metadata:
type: string
description: Objeto chave/valor utilizado para armazenar informações adicionais sobre a fatura. [Saiba mais sobre metadata](https://docs.pagar.me/reference/metadata-1)
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"in_6d2BVXnaUdT8DOkL\",\n \"code\": \"59QDSPB5NP\",\n \"url\": \"/invoices/in_6d2BVXnaUdT8DOkL\",\n \"amount\": 1490,\n \"status\": \"paid\",\n \"payment_method\": \"credit_card\",\n \"due_at\": \"2017-04-04T00:00:00Z\",\n \"created_at\": \"2017-04-04T15:10:35Z\",\n \"items\": [\n {\n \"name\": \"Nome - teste\",\n \"amount\": 1490,\n \"quantity\": 1,\n \"description\": \"Bola\"\n }\n ],\n \"customer\": {\n \"id\": \"cus_J4wRXJ0U6ytZrpAx\",\n \"name\": \"Tony Star8k\",\n \"email\": \"tstark@avengers.com\",\n \"delinquent\": false,\n \"created_at\": \"2016-09-28T21:04:37Z\",\n \"updated_at\": \"2017-04-04T15:08:20Z\"\n },\n \"subscription\": {\n \"id\": \"sub_KrmEXBxHVIRAJxDG\",\n \"code\": \"KERZFJ6TQZ\",\n \"start_at\": \"2017-04-04T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2017-05-04T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T15:10:01Z\",\n \"updated_at\": \"2017-04-04T15:10:01Z\"\n },\n \"cycle\": {\n \"id\": \"cycle_WE1ZYoX7uEfbRar4\",\n \"start_at\": \"2017-04-04T00:00:00Z\",\n \"end_at\": \"2017-05-03T23:59:59\",\n \"billing_at\": \"2017-05-04T00:00:00Z\"\n },\n \"charge\": {\n \"id\": \"ch_x75JLo9SRFnEo6jY\",\n \"code\": \"KERZFJ6TQZ-01\",\n \"gateway_id\": \"477bcafc-194b-4aa9-bb18-6fc621e49c22\",\n \"amount\": 1490,\n \"status\": \"paid\",\n \"currency\": \"BRL\",\n \"payment_method\": \"credit_card\",\n \"due_at\": \"2017-04-04T00:00:00Z\",\n \"paid_at\": \"2017-04-04T15:10:46Z\",\n \"created_at\": \"2017-04-04T15:10:35Z\",\n \"updated_at\": \"2017-04-04T15:10:35Z\",\n \"last_transaction\": {\n \"id\": \"tran_mnVqmLOfJGhzWKzW\",\n \"transaction_type\": \"credit_card\",\n \"funding_source\": \"prepaid\",\n \"gateway_id\": \"da859279-6251-4721-9909-4d8a1142f098\",\n \"amount\": 1490,\n \"status\": \"captured\",\n \"success\": true,\n \"installments\": 1,\n \"statement_descriptor\": \"Spotify\",\n \"acquirer_name\": \"simulator\",\n \"acquirer_affiliation_code\": \"12345\",\n \"acquirer_tid\": \"704735\",\n \"acquirer_nsu\": \"999048\",\n \"acquirer_auth_code\": \"468669\",\n \"acquirer_message\": \"Simulator|Transação de simulação autorizada com sucesso\",\n \"acquirer_return_code\": \"0\",\n \"operation_type\": \"auth_and_capture\",\n \"credit_card\": {\n \"id\": \"card_pEYq7rDbFeiW8V6k\",\n \"first_six_digits\": \"542501\",\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 \"created_at\": \"2017-04-04T15:10:35Z\",\n \"updated_at\": \"2017-04-04T15:10:35Z\"\n }\n }\n}"
schema:
type: object
properties:
id:
type: string
example: in_6d2BVXnaUdT8DOkL
code:
type: string
example: 59QDSPB5NP
url:
type: string
example: /invoices/in_6d2BVXnaUdT8DOkL
amount:
type: integer
example: 1490
default: 0
status:
type: string
example: paid
payment_method:
type: string
example: credit_card
due_at:
type: string
example: '2017-04-04T00:00:00Z'
created_at:
type: string
example: '2017-04-04T15:10:35Z'
items:
type: array
items:
type: object
properties:
name:
type: string
example: Nome - teste
amount:
type: integer
example: 1490
default: 0
quantity:
type: integer
example: 1
default: 0
description:
type: string
example: Bola
customer:
type: object
properties:
id:
type: string
example: cus_J4wRXJ0U6ytZrpAx
name:
type: string
example: Tony Star8k
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-04-04T15:08:20Z'
subscription:
type: object
properties:
id:
type: string
example: sub_KrmEXBxHVIRAJxDG
code:
type: string
example: KERZFJ6TQZ
start_at:
type: string
example: '2017-04-04T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2017-05-04T00: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-04-04T15:10:01Z'
updated_at:
type: string
example: '2017-04-04T15:10:01Z'
cycle:
type: object
properties:
id:
type: string
example: cycle_WE1ZYoX7uEfbRar4
start_at:
type: string
example: '2017-04-04T00:00:00Z'
end_at:
type: string
example: '2017-05-03T23:59:59'
billing_at:
type: string
example: '2017-05-04T00:00:00Z'
charge:
type: object
properties:
id:
type: string
example: ch_x75JLo9SRFnEo6jY
code:
type: string
example: KERZFJ6TQZ-01
gateway_id:
type: string
example: 477bcafc-194b-4aa9-bb18-6fc621e49c22
amount:
type: integer
example: 1490
default: 0
status:
type: string
example: paid
currency:
type: string
example: BRL
payment_method:
type: string
example: credit_card
due_at:
type: string
example: '2017-04-04T00:00:00Z'
paid_at:
type: string
example: '2017-04-04T15:10:46Z'
created_at:
type: string
example: '2017-04-04T15:10:35Z'
updated_at:
type: string
example: '2017-04-04T15:10:35Z'
last_transaction:
type: object
properties:
id:
type: string
example: tran_mnVqmLOfJGhzWKzW
transaction_type:
type: string
example: credit_card
funding_source:
type: string
example: prepaid
gateway_id:
type: string
example: da859279-6251-4721-9909-4d8a1142f098
amount:
type: integer
example: 1490
default: 0
status:
type: string
example: captured
success:
type: boolean
example: true
default: true
installments:
type: integer
example: 1
default: 0
statement_descriptor:
type: string
example: Spotify
acquirer_name:
type: string
example: simulator
acquirer_affiliation_code:
type: string
example: '12345'
acquirer_tid:
type: string
example: '704735'
acquirer_nsu:
type: string
example: '999048'
acquirer_auth_code:
type: string
example: '468669'
acquirer_message:
type: string
example: Simulator|Transação de simulação autorizada com sucesso
acquirer_return_code:
type: string
example: '0'
operation_type:
type: string
example: auth_and_capture
credit_card:
type: object
properties:
id:
type: string
example: card_pEYq7rDbFeiW8V6k
first_six_digits:
type: string
example: '542501'
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
created_at:
type: string
example: '2017-04-04T15:10:35Z'
updated_at:
type: string
example: '2017-04-04T15:10:35Z'
'412':
description: '412'
content:
application/json:
examples:
Result:
value: "{\n \"message\": \"This cycle has been billed.\"\n}"
schema:
type: object
properties:
message:
type: string
example: This cycle has been billed.
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/discounts:
post:
summary: Incluir desconto
description: Este recurso permite adicionar um desconto, através do identificador da assinatura (`subscription_id`).
operationId: incluir-desconto-1
parameters:
- name: subscription_id
in: path
description: Código da assinatura.
Formato `sub_XXXXXXXXXXXXXXXX`
schema:
type: string
required: true
requestBody:
content:
application/json:
schema:
type: object
required:
- value
- discount_type
properties:
value:
type: string
description: Valor do desconto.
discount_type:
type: string
description: 'Tipo do desconto.
Valores possíveis: **flat** ou **percentage**. O padrão é **percentage**'
cycles:
type: string
description: Indica quantas vezes o desconto será aplicado.
Caso não seja informado, o desconto será aplicado até que o item seja excluído
item_id:
type: string
description: 'Código do item da assinatura.
Formato: `si_XXXXXXXXXXXXXXXX`
Caso seja informado, o desconto será aplicado no item. Max: 36 caracteres'
examples:
Request Example:
value:
value: 10
discount_type: percentage
cycles: '1'
item_id: si_GyL1lmGU6tOXYr2O
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"dis_LP4j5dXztPSj5A02\",\n \"value\": 10,\n \"discount_type\": \"percentage\",\n \"cycles\": 1,\n \"status\": \"active\",\n \"created_at\": \"2019-05-22T14:23:55Z\",\n \"updated_at\": \"2019-05-22T14:23:55Z\",\n \"subscription\": {\n \"id\": \"sub_DvPanXLsqcQnk8e1\",\n \"code\": \"5Z7ZU01F60\",\n \"start_at\": \"2019-05-22T00:00:00Z\",\n \"interval\": \"day\",\n \"interval_count\": 1,\n \"billing_type\": \"prepaid\",\n \"next_billing_at\": \"2019-05-25T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"installments\": 1,\n \"minimum_price\": 10,\n \"status\": \"active\",\n \"boleto_due_days\": 5,\n \"created_at\": \"2019-05-22T14:05:49Z\",\n \"updated_at\": \"2019-05-22T14:21:51Z\"\n }\n}"
schema:
type: object
properties:
id:
type: string
example: dis_LP4j5dXztPSj5A02
value:
type: integer
example: 10
default: 0
discount_type:
type: string
example: percentage
cycles:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2019-05-22T14:23:55Z'
updated_at:
type: string
example: '2019-05-22T14:23:55Z'
subscription:
type: object
properties:
id:
type: string
example: sub_DvPanXLsqcQnk8e1
code:
type: string
example: 5Z7ZU01F60
start_at:
type: string
example: '2019-05-22T00:00:00Z'
interval:
type: string
example: day
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: prepaid
next_billing_at:
type: string
example: '2019-05-25T00:00:00Z'
payment_method:
type: string
example: credit_card
currency:
type: string
example: BRL
installments:
type: integer
example: 1
default: 0
minimum_price:
type: integer
example: 10
default: 0
status:
type: string
example: active
boleto_due_days:
type: integer
example: 5
default: 0
created_at:
type: string
example: '2019-05-22T14:05:49Z'
updated_at:
type: string
example: '2019-05-22T14:21:51Z'
'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 \"discount.discount_type\": [\n \"The discount_type field is invalid. Possible values are 'flat' or 'percentage'.\"\n ]\n },\n \"request\": {\n \"discount_type\": \"null\",\n \"value\": 10\n }\n}"
schema:
oneOf:
- type: object
properties:
message:
type: string
example: The request is invalid.
errors:
type: object
properties:
discount.value:
type: array
items:
type: string
example: The value field should be greater than the zero.
request:
type: object
properties:
discount_type:
type: string
example: percentage
- type: object
properties:
message:
type: string
example: The request is invalid.
errors:
type: object
properties:
discount.discount_type:
type: array
items:
type: string
example: The discount_type field is invalid. Possible values are 'flat' or 'percentage'.
request:
type: object
properties:
discount_type:
type: string
example: 'null'
value:
type: integer
example: 10
default: 0
deprecated: false
tags:
- Subscriptions
get:
summary: Listar descontos
description: Este recurso permite listar os descontos associados a uma assinatura.
operationId: listar-descontos-2
parameters:
- name: subscription_id
in: path
description: Código da assinatura.
Formato `sub_XXXXXXXXXXXXXXXX`
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"data\": [\n {\n \"id\": \"dis_IYzpxgjsOs0fDIoP\",\n \"value\": 20,\n \"discount_type\": \"percentage\",\n \"status\": \"active\",\n \"created_at\": \"2018-03-15T19:49:29Z\",\n \"subscription\": {\n \"id\": \"sub_Yo2VQVyeSWHKmN5k\",\n \"code\": \"Z8OXUJI3M5\",\n \"start_at\": \"2018-03-15T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"prepaid\",\n \"next_billing_at\": \"2018-04-15T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2018-03-15T19:49:05Z\",\n \"updated_at\": \"2018-03-15T19:49:05Z\"\n }\n },\n {\n \"id\": \"dis_kyzpJFssOs0fIoUx\",\n \"value\": 10,\n \"discount_type\": \"percentage\",\n \"status\": \"active\",\n \"created_at\": \"2018-03-15T19:49:25Z\",\n \"subscription\": {\n \"id\": \"sub_Yo2VQVyeSWHKmN5k\",\n \"code\": \"Z8OXUJI3M5\",\n \"start_at\": \"2018-03-15T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"prepaid\",\n \"next_billing_at\": \"2018-04-15T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2018-03-15T19:49:05Z\",\n \"updated_at\": \"2018-03-15T19:49:05Z\"\n }\n }\n ],\n \"paging\": {\n \"total\": 2\n }\n}"
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
id:
type: string
example: dis_IYzpxgjsOs0fDIoP
value:
type: integer
example: 20
default: 0
discount_type:
type: string
example: percentage
status:
type: string
example: active
created_at:
type: string
example: '2018-03-15T19:49:29Z'
subscription:
type: object
properties:
id:
type: string
example: sub_Yo2VQVyeSWHKmN5k
code:
type: string
example: Z8OXUJI3M5
start_at:
type: string
example: '2018-03-15T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: prepaid
next_billing_at:
type: string
example: '2018-04-15T00:00:00Z'
payment_method:
type: string
example: credit_card
currency:
type: string
example: BRL
installments:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2018-03-15T19:49:05Z'
updated_at:
type: string
example: '2018-03-15T19:49:05Z'
paging:
type: object
properties:
total:
type: integer
example: 2
default: 0
'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.
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/discounts/{discount_id}:
get:
summary: Obter desconto
description: Através dos identificadores da assinatura (`subscription_id`) e do desconto associado (`discount_id`) é possível recuperar as informações do desconto.
operationId: obter-desconto-1
parameters:
- name: subscription_id
in: path
description: Código da assinatura.
Formato `sub_XXXXXXXXXXXXXXXX`
schema:
type: string
required: true
- name: discount_id
in: path
description: 'Código do desconto.
Formato: `dis_XXXXXXXXXXXXXXXX`'
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"dis_brMgW6KCdmf2dEQ7\",\n \"value\": 10,\n \"discount_type\": \"percentage\",\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:36:43Z\",\n \"subscription\": {\n \"id\": \"sub_o0Jw4WYCMuPNqzGr\",\n \"code\": \"09NFPLBZY0\",\n \"start_at\": \"2017-04-04T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2017-05-04T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:21:17Z\",\n \"updated_at\": \"2017-04-04T18:21:17Z\"\n }\n}"
schema:
type: object
properties:
id:
type: string
example: dis_brMgW6KCdmf2dEQ7
value:
type: integer
example: 10
default: 0
discount_type:
type: string
example: percentage
status:
type: string
example: active
created_at:
type: string
example: '2017-04-04T18:36:43Z'
subscription:
type: object
properties:
id:
type: string
example: sub_o0Jw4WYCMuPNqzGr
code:
type: string
example: 09NFPLBZY0
start_at:
type: string
example: '2017-04-04T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2017-05-04T00: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-04-04T18:21:17Z'
updated_at:
type: string
example: '2017-04-04T18:21:17Z'
'404':
description: '404'
content:
application/json:
examples:
Result:
value: "{\n \"message\": \"Discount not found.\"\n}"
schema:
oneOf:
- type: object
properties:
message:
type: string
example: Subscription not found.
- type: object
properties:
message:
type: string
example: Discount not found.
deprecated: false
tags:
- Subscriptions
delete:
summary: Remover desconto
description: Com o verbo _HTTP DELETE_, através dos identificadores do desconto (`discount_id`) e da assinatura associada (`subscription_id`) é possível remover um desconto do plano.
operationId: remover-desconto-1
parameters:
- name: subscription_id
in: path
description: Código da assinatura.
Formato `sub_XXXXXXXXXXXXXXXX`
schema:
type: string
required: true
- name: discount_id
in: path
description: 'Código do desconto.
Formato: `dis_XXXXXXXXXXXXXXXX`'
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"dis_kqGj1JMCaGSRm9Yz\",\n \"value\": 10,\n \"discount_type\": \"percentage\",\n \"status\": \"deleted\",\n \"created_at\": \"2017-04-04T18:40:15Z\",\n \"deleted_at\": \"2017-04-04T18:40:48Z\",\n \"subscription\": {\n \"id\": \"sub_o0Jw4WYCMuPNqzGr\",\n \"code\": \"09NFPLBZY0\",\n \"start_at\": \"2017-04-04T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2017-05-04T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:21:17Z\",\n \"updated_at\": \"2017-04-04T18:21:17Z\"\n }\n}"
schema:
type: object
properties:
id:
type: string
example: dis_kqGj1JMCaGSRm9Yz
value:
type: integer
example: 10
default: 0
discount_type:
type: string
example: percentage
status:
type: string
example: deleted
created_at:
type: string
example: '2017-04-04T18:40:15Z'
deleted_at:
type: string
example: '2017-04-04T18:40:48Z'
subscription:
type: object
properties:
id:
type: string
example: sub_o0Jw4WYCMuPNqzGr
code:
type: string
example: 09NFPLBZY0
start_at:
type: string
example: '2017-04-04T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2017-05-04T00: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-04-04T18:21:17Z'
updated_at:
type: string
example: '2017-04-04T18:21:17Z'
'404':
description: '404'
content:
application/json:
examples:
Result:
value: "{\n \"message\": \"Discount not found.\"\n}"
schema:
oneOf:
- type: object
properties:
message:
type: string
example: Subscription not found.
- type: object
properties:
message:
type: string
example: Discount not found.
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/increments:
post:
summary: Incluir incremento
description: Este recurso permite adicionar um incremento, através do identificador da assinatura (`subscription_id`).
operationId: incluir-incremento-1
parameters:
- name: subscription_id
in: path
description: Código da assinatura.
Formato `sub_XXXXXXXXXXXXXXXX`
schema:
type: string
required: true
requestBody:
content:
application/json:
schema:
type: object
required:
- value
- increment_type
properties:
value:
type: string
description: Valor do incremento.
increment_type:
type: string
description: 'Tipo do incremento.
Valores possíveis: **flat** ou **percentage**. O padrão é **percentage**'
cycles:
type: integer
description: Indica quantas vezes o incremento será aplicado.
Caso não seja informada, o incremento será aplicado até que o item seja excluído
format: int32
item_id:
type: string
description: 'Código do item da assinatura.
Formato: `si_XXXXXXXXXXXXXXXX`
Caso seja informado, o incremento será aplicado no item. Max: 36 caracteres'
examples:
Request Example:
value:
value: 20
increment_type: percentage
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"inc_IYzpxgjsOs0fDIoP\",\n \"value\": 20,\n \"increment_type\": \"percentage\",\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:36:43Z\",\n \"subscription\": {\n \"id\": \"sub_o0Jw4WYCMuPNqzGr\",\n \"code\": \"09NFPLBZY0\",\n \"start_at\": \"2017-04-04T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2017-05-04T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:21:17Z\",\n \"updated_at\": \"2017-04-04T18:21:17Z\"\n }\n}"
schema:
type: object
properties:
id:
type: string
example: inc_IYzpxgjsOs0fDIoP
value:
type: integer
example: 20
default: 0
increment_type:
type: string
example: percentage
status:
type: string
example: active
created_at:
type: string
example: '2017-04-04T18:36:43Z'
subscription:
type: object
properties:
id:
type: string
example: sub_o0Jw4WYCMuPNqzGr
code:
type: string
example: 09NFPLBZY0
start_at:
type: string
example: '2017-04-04T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2017-05-04T00: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-04-04T18:21:17Z'
updated_at:
type: string
example: '2017-04-04T18:21:17Z'
'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 \"increment.increment_type\": [\n \"The increment_type field is invalid. Possible values are 'flat' or 'percentage'.\"\n ]\n },\n \"request\": {\n \"increment_type\": \"null\",\n \"value\": 10\n }\n}"
schema:
oneOf:
- type: object
properties:
message:
type: string
example: The request is invalid.
errors:
type: object
properties:
increment.value:
type: array
items:
type: string
example: The value field should be greater than the zero.
request:
type: object
properties:
increment_type:
type: string
example: percentage
- type: object
properties:
message:
type: string
example: The request is invalid.
errors:
type: object
properties:
increment.increment_type:
type: array
items:
type: string
example: The increment_type field is invalid. Possible values are 'flat' or 'percentage'.
request:
type: object
properties:
increment_type:
type: string
example: 'null'
value:
type: integer
example: 10
default: 0
deprecated: false
tags:
- Subscriptions
get:
summary: Listar incrementos
description: Este recurso permite listar os incrementos associados a uma assinatura.
operationId: listar-incrementos
parameters:
- name: subscription_id
in: path
description: Código da assinatura.
Formato `sub_XXXXXXXXXXXXXXXX`
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"data\": [\n {\n \"id\": \"inc_IYzpxgjsOs0fDIoP\",\n \"value\": 20,\n \"increment_type\": \"percentage\",\n \"status\": \"active\",\n \"created_at\": \"2018-03-15T19:49:29Z\",\n \"subscription\": {\n \"id\": \"sub_Yo2VQVyeSWHKmN5k\",\n \"code\": \"Z8OXUJI3M5\",\n \"start_at\": \"2018-03-15T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"prepaid\",\n \"next_billing_at\": \"2018-04-15T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2018-03-15T19:49:05Z\",\n \"updated_at\": \"2018-03-15T19:49:05Z\"\n }\n },\n {\n \"id\": \"inc_kyzpJFssOs0fIoUx\",\n \"value\": 10,\n \"increment_type\": \"percentage\",\n \"status\": \"active\",\n \"created_at\": \"2018-03-15T19:49:25Z\",\n \"subscription\": {\n \"id\": \"sub_Yo2VQVyeSWHKmN5k\",\n \"code\": \"Z8OXUJI3M5\",\n \"start_at\": \"2018-03-15T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"prepaid\",\n \"next_billing_at\": \"2018-04-15T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2018-03-15T19:49:05Z\",\n \"updated_at\": \"2018-03-15T19:49:05Z\"\n }\n }\n ],\n \"paging\": {\n \"total\": 2\n }\n}"
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
id:
type: string
example: inc_IYzpxgjsOs0fDIoP
value:
type: integer
example: 20
default: 0
increment_type:
type: string
example: percentage
status:
type: string
example: active
created_at:
type: string
example: '2018-03-15T19:49:29Z'
subscription:
type: object
properties:
id:
type: string
example: sub_Yo2VQVyeSWHKmN5k
code:
type: string
example: Z8OXUJI3M5
start_at:
type: string
example: '2018-03-15T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: prepaid
next_billing_at:
type: string
example: '2018-04-15T00:00:00Z'
payment_method:
type: string
example: credit_card
currency:
type: string
example: BRL
installments:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2018-03-15T19:49:05Z'
updated_at:
type: string
example: '2018-03-15T19:49:05Z'
paging:
type: object
properties:
total:
type: integer
example: 2
default: 0
'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.
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/increments/{increment_id}:
get:
summary: Obter incremento
description: Através dos identificadores da assinatura (`subscription_id`) e do incremento associado (`incremento_id`) é possível recuperar as informações do incremento.
operationId: obter-incremento-1
parameters:
- name: subscription_id
in: path
description: Código da assinatura.
Formato `sub_XXXXXXXXXXXXXXXX`
schema:
type: string
required: true
- name: increment_id
in: path
description: 'Código do incremento.
Formato: `dis_XXXXXXXXXXXXXXXX`'
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"inc_IYzpxgjsOs0fDIoP\",\n \"value\": 10,\n \"increment_type\": \"percentage\",\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:36:43Z\",\n \"subscription\": {\n \"id\": \"sub_o0Jw4WYCMuPNqzGr\",\n \"code\": \"09NFPLBZY0\",\n \"start_at\": \"2017-04-04T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2017-05-04T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:21:17Z\",\n \"updated_at\": \"2017-04-04T18:21:17Z\"\n }\n}"
schema:
type: object
properties:
id:
type: string
example: inc_IYzpxgjsOs0fDIoP
value:
type: integer
example: 10
default: 0
increment_type:
type: string
example: percentage
status:
type: string
example: active
created_at:
type: string
example: '2017-04-04T18:36:43Z'
subscription:
type: object
properties:
id:
type: string
example: sub_o0Jw4WYCMuPNqzGr
code:
type: string
example: 09NFPLBZY0
start_at:
type: string
example: '2017-04-04T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2017-05-04T00: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-04-04T18:21:17Z'
updated_at:
type: string
example: '2017-04-04T18:21:17Z'
'404':
description: '404'
content:
application/json:
examples:
Result:
value: "{\n \"message\": \"Increment not found.\"\n}"
schema:
oneOf:
- type: object
properties:
message:
type: string
example: Subscription not found.
- type: object
properties:
message:
type: string
example: Increment not found.
deprecated: false
tags:
- Subscriptions
delete:
summary: Remover incremento
description: Com o verbo _HTTP DELETE_, através dos identificadores do incremento (`increment_id`) e da assinatura associada (`subscription_id`) é possível remover um incremento do plano.
operationId: remover-incremento-1
parameters:
- name: subscription_id
in: path
description: Código da assinatura.
Formato `sub_XXXXXXXXXXXXXXXX`
schema:
type: string
required: true
- name: increment_id
in: path
description: 'Código do incremento.
Formato: `dis_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"inc_IYzpxgjsOs0fDIoP\",\n \"value\": 20,\n \"increment_type\": \"percentage\",\n \"status\": \"deleted\",\n \"created_at\": \"2017-04-04T18:40:15Z\",\n \"deleted_at\": \"2017-04-04T18:40:48Z\",\n \"subscription\": {\n \"id\": \"sub_o0Jw4WYCMuPNqzGr\",\n \"code\": \"09NFPLBZY0\",\n \"start_at\": \"2017-04-04T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2017-05-04T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:21:17Z\",\n \"updated_at\": \"2017-04-04T18:21:17Z\"\n }\n}"
schema:
type: object
properties:
id:
type: string
example: inc_IYzpxgjsOs0fDIoP
value:
type: integer
example: 20
default: 0
increment_type:
type: string
example: percentage
status:
type: string
example: deleted
created_at:
type: string
example: '2017-04-04T18:40:15Z'
deleted_at:
type: string
example: '2017-04-04T18:40:48Z'
subscription:
type: object
properties:
id:
type: string
example: sub_o0Jw4WYCMuPNqzGr
code:
type: string
example: 09NFPLBZY0
start_at:
type: string
example: '2017-04-04T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2017-05-04T00: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-04-04T18:21:17Z'
updated_at:
type: string
example: '2017-04-04T18:21:17Z'
'404':
description: '404'
content:
application/json:
examples:
Result:
value: "{\n \"message\": \"Increment not found.\"\n}"
schema:
oneOf:
- type: object
properties:
message:
type: string
example: Subscription not found.
- type: object
properties:
message:
type: string
example: Increment not found.
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/items:
post:
summary: Incluir item
description: Através do identificador da assinatura (`subscription_id`) é possível incluir itens na assinatura do cliente.
operationId: incluir-item-1
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
requestBody:
content:
application/json:
schema:
type: object
required:
- description
- pricing_scheme
- quantity
properties:
plan_item_id:
type: string
description: 'Código do item do plano.
Max: 36 caracteres.'
description:
type: string
description: 'Descrição do item.
Max: 256 caracteres.
**Obrigatório** caso o `plan_item_id` não seja informado.'
cycles:
type: integer
description: Indica quantas vezes o item será cobrado.
Caso não seja informado, o item será cobrado até que seja excluído o desativado.
format: int32
pricing_scheme:
type: object
description: Esquema de precificação.
[Saiba mais sobre precificação](https://docs.pagar.me/reference/precifica%C3%A7%C3%A3o).
required:
- scheme_type
properties:
scheme_type:
type: string
description: 'Esquema de precificação do item. Valores possíveis: **unit**, **package**, **volume** e **tier**. Valor default: unit'
default: Unit
price:
type: integer
description: 'Valor do item. Este atributo está disponível para o scheme_type : **Unit**'
format: int32
mininum_price:
type: integer
description: Valor mínimo a ser cobrado.
format: int32
price_brackets:
type: array
description: 'Intervalo de preços. Este atributo está disponível para os scheme_type : **package**, **volume** e **tier**.'
items:
properties:
start_quantity:
type: integer
description: Valor que define a quantidade inicial de unidades do intervalo.
format: int32
end_quantity:
type: integer
description: Valor que define a quantidade final de unidades do intervalo.
format: int32
overage_price:
type: integer
description: Valor para cálculo do preço por unidade que exceder o intervalo.
format: int32
price:
type: integer
description: 'Valor para cálculo do preço dentro do intervalo. OBS: o preço a ser cobrado do cliente será calculado de acordo com a quantidade e o scheme_type'
format: int32
type: object
discounts:
type: array
description: Descontos do item.
[Saiba mais sobre desconto](https://docs.pagar.me/reference/desconto-1)
items:
properties:
cycles:
type: string
description: Número de vezes que o desconto será aplicado.
value:
type: string
description: Valor do desconto.
discount_type:
type: string
description: 'Tipo do desconto. Valores possíveis: flat ou percentage. Valor padrão: percentage.'
type: object
quantity:
type: integer
description: Quantidade de itens.
**Obrigatório** caso **pricing_scheme.scheme_type** seja **unit**
format: int32
name:
type: string
description: Nome do item da assinatura.
increments:
type: array
description: Incrementos do item.
[Saiba mais sobre desconto](https://docs.pagar.me/reference/incremento-1)
items:
properties:
value:
type: integer
description: Valor do incremento.
format: int32
cycles:
type: string
description: Número de vezes que o incremento será aplicado.
increment_type:
type: string
description: 'Tipo do incremento. Valores possíveis: flat ou percentage. Valor padrão: percentage.'
type: object
examples:
Request Example:
value:
description: Celular
cycles: 1
quantity: 1
pricing_scheme:
price: 99
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"si_WQEmvEEfGigkL0Zx\",\n \"description\": \"Celular\",\n \"cycles\": 1,\n \"quantity\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-07-28T21:00:26Z\",\n \"updated_at\": \"2017-07-28T21:00:26Z\",\n \"pricing_scheme\": {\n \"price\": 99,\n \"scheme_type\": \"unit\"\n },\n \"subscription\": {\n \"id\": \"sub_z4ogwpZfdKCnGj9m\",\n \"code\": \"3670A7IQWL\",\n \"start_at\": \"2017-07-28T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 3,\n \"billing_type\": \"prepaid\",\n \"next_billing_at\": \"2017-10-28T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"installments\": 3,\n \"status\": \"active\",\n \"created_at\": \"2017-07-28T20:59:18Z\",\n \"updated_at\": \"2017-07-28T20:59:18Z\",\n \"metadata\": {\n \"id\": \"my_subscription_id\"\n }\n }\n}"
schema:
type: object
properties:
id:
type: string
example: si_WQEmvEEfGigkL0Zx
description:
type: string
example: Celular
cycles:
type: integer
example: 1
default: 0
quantity:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2017-07-28T21:00:26Z'
updated_at:
type: string
example: '2017-07-28T21:00:26Z'
pricing_scheme:
type: object
properties:
price:
type: integer
example: 99
default: 0
scheme_type:
type: string
example: unit
subscription:
type: object
properties:
id:
type: string
example: sub_z4ogwpZfdKCnGj9m
code:
type: string
example: 3670A7IQWL
start_at:
type: string
example: '2017-07-28T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 3
default: 0
billing_type:
type: string
example: prepaid
next_billing_at:
type: string
example: '2017-10-28T00:00:00Z'
payment_method:
type: string
example: credit_card
currency:
type: string
example: BRL
installments:
type: integer
example: 3
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2017-07-28T20:59:18Z'
updated_at:
type: string
example: '2017-07-28T20:59:18Z'
metadata:
type: object
properties:
id:
type: string
example: my_subscription_id
'422':
description: '422'
content:
application/json:
examples:
Result:
value: "{\n \"message\": \"The request is invalid.\",\n \"errors\": {\n \"item.cycles\": [\n \"The field cycles must be greater than or equal to 1\"\n ]\n },\n \"request\": {\n \"description\": \"Celular\",\n \"cycles\": 0,\n \"quantity\": 1,\n \"pricing_scheme\": {\n \"price\": 99,\n \"scheme_type\": \"unit\"\n }\n }\n}"
schema:
type: object
properties:
message:
type: string
example: The request is invalid.
errors:
type: object
properties:
item.cycles:
type: array
items:
type: string
example: The field cycles must be greater than or equal to 1
request:
type: object
properties:
description:
type: string
example: Celular
cycles:
type: integer
example: 0
default: 0
quantity:
type: integer
example: 1
default: 0
pricing_scheme:
type: object
properties:
price:
type: integer
example: 99
default: 0
scheme_type:
type: string
example: unit
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/items/{item_id}:
put:
summary: Editar item
description: Com o verbo _HTTP PUT_, através dos identificadores do item (`subscription_item_id`) e da assinatura (`subscription_id`) associada é possível atualizar os dados do item da assinatura.
operationId: editar-item
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
- name: item_id
in: path
description: 'Código do item da assinatura.
Formato: `si_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
requestBody:
content:
application/json:
schema:
type: object
required:
- quantity
properties:
name:
type: string
description: Nome do item da assinatura.
description:
type: string
description: 'Descrição do item.
Max: 256 caracteres.
**Obrigatório** caso o `plan_item_id` não seja informado.'
cycle:
type: integer
description: Indica quantas vezes o item será cobrado.
Caso não seja informado, o item será cobrado até que seja excluído o desativado.
format: int32
page:
type: integer
description: Página atual
default: 1
format: int32
size:
type: integer
description: Quantidade de itens por página.
default: 10
format: int32
quantity:
type: integer
description: Quantidade de itens.
**Obrigatório** caso **pricing_scheme.scheme_type** seja **unit**.
format: int32
pricing_scheme:
type: object
description: Esquema de precificação.
[Saiba mais sobre precificação](https://docs.pagar.me/reference/precifica%C3%A7%C3%A3o)
required:
- scheme_type
properties:
scheme_type:
type: string
description: 'Esquema de precificação do item. Valores possíveis: **unit**, **package**, **volume** e **tier**. Valor default: unit'
default: Unit
price:
type: integer
description: 'Valor do item. Este atributo está disponível para o scheme_type : **Unit**'
format: int32
mininum_price:
type: integer
description: Valor mínimo a ser cobrado.
format: int32
price_brackets:
type: array
description: 'Intervalo de preços. Este atributo está disponível para os scheme_type : **package**, **volume** e **tier**.'
items:
properties:
start_quantity:
type: integer
description: Valor que define a quantidade inicial de unidades do intervalo.
format: int32
end_quantity:
type: integer
description: Valor que define a quantidade final de unidades do intervalo.
format: int32
overage_price:
type: integer
description: Valor para cálculo do preço por unidade que exceder o intervalo.
format: int32
price:
type: integer
description: 'Valor para cálculo do preço dentro do intervalo. OBS: o preço a ser cobrado do cliente será calculado de acordo com a quantidade e o scheme_type'
format: int32
type: object
examples:
Request Example:
value:
name: Nome - teste
description: Telefone
cycles: 3
quantity: 1
pricing_scheme:
price: 99
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"si_mARl1OvTYcA3pG49\",\n \"description\": \"Telefone\",\n \"cycles\": 3,\n \"quantity\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:56:44Z\",\n \"updated_at\": \"2017-04-04T18:57:48Z\",\n \"pricing_scheme\": {\n \"price\": 99,\n \"scheme_type\": \"unit\"\n },\n \"subscription\": {\n \"id\": \"sub_o0Jw4WYCMuPNqzGr\",\n \"code\": \"09NFPLBZY0\",\n \"start_at\": \"2017-04-04T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2017-05-04T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:21:17\",\n \"updated_at\": \"2017-04-04T18:21:17\"\n }\n}"
schema:
type: object
properties:
id:
type: string
example: si_mARl1OvTYcA3pG49
description:
type: string
example: Telefone
cycles:
type: integer
example: 3
default: 0
quantity:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2017-04-04T18:56:44Z'
updated_at:
type: string
example: '2017-04-04T18:57:48Z'
pricing_scheme:
type: object
properties:
price:
type: integer
example: 99
default: 0
scheme_type:
type: string
example: unit
subscription:
type: object
properties:
id:
type: string
example: sub_o0Jw4WYCMuPNqzGr
code:
type: string
example: 09NFPLBZY0
start_at:
type: string
example: '2017-04-04T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2017-05-04T00: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-04-04T18:21:17'
updated_at:
type: string
example: '2017-04-04T18:21:17'
'404':
description: '404'
content:
application/json:
examples:
Result:
value: "{\n \"message\": \"Item not found.\"\n}"
schema:
type: object
properties:
message:
type: string
example: Item not found.
deprecated: false
tags:
- Subscriptions
delete:
summary: Remover item
description: Com o verbo _HTTP DELETE_, através dos identificadores do item (`subscription_item_id`) e da assinatura (`subscription_id`) associada é possível remover um item da assinatura.
operationId: remover-item
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
- name: item_id
in: path
description: 'Código do item da assinatura.
Formato: `si_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"si_mARl1OvTYcA3pG49\",\n \"description\": \"Telefone\",\n \"cycles\": 3,\n \"quantity\": 1,\n \"name\":\"Nome - teste\",\n \"status\": \"deleted\",\n \"created_at\": \"2017-04-04T18:56:44Z\",\n \"updated_at\": \"2017-04-04T18:57:48Z\",\n \"deleted_at\": \"2017-04-04T19:00:44Z\",\n \"pricing_scheme\": {\n \"price\": 99,\n \"scheme_type\": \"unit\"\n },\n \"subscription\": {\n \"id\": \"sub_o0Jw4WYCMuPNqzGr\",\n \"code\": \"09NFPLBZY0\",\n \"start_at\": \"2017-04-04T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2017-05-04T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:21:17Z\",\n \"updated_at\": \"2017-04-04T18:21:17Z\"\n }\n}"
schema:
type: object
properties:
id:
type: string
example: si_mARl1OvTYcA3pG49
description:
type: string
example: Telefone
cycles:
type: integer
example: 3
default: 0
quantity:
type: integer
example: 1
default: 0
name:
type: string
example: Nome - teste
status:
type: string
example: deleted
created_at:
type: string
example: '2017-04-04T18:56:44Z'
updated_at:
type: string
example: '2017-04-04T18:57:48Z'
deleted_at:
type: string
example: '2017-04-04T19:00:44Z'
pricing_scheme:
type: object
properties:
price:
type: integer
example: 99
default: 0
scheme_type:
type: string
example: unit
subscription:
type: object
properties:
id:
type: string
example: sub_o0Jw4WYCMuPNqzGr
code:
type: string
example: 09NFPLBZY0
start_at:
type: string
example: '2017-04-04T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2017-05-04T00: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-04-04T18:21:17Z'
updated_at:
type: string
example: '2017-04-04T18:21:17Z'
'400':
description: '400'
content:
application/json:
examples:
Result:
value: '{}'
schema:
type: object
properties: {}
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/items/{item_id}/usages:
post:
summary: Incluir uso
description: Este recurso permite incluir um `usage` de um `items` associado a uma `subscription`.
operationId: incluir-uso
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
- name: item_id
in: path
description: 'Código do item da assinatura.
Formato: `si_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
quantity:
type: integer
description: Quantidade de usos a serem incluídos.
default: 1
format: int32
description:
type: string
description: Descrição do uso.
code:
type: string
description: Código de identificação no sistema do cliente
group:
type: string
description: Código de identificação do grupo no sistema do cliente
examples:
Request Example:
value:
quantity: 50
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"usage_QV1gBLhalU35RNbx\",\n \"quantity\": 1,\n \"status\": \"active\",\n \"used_at\": \"2017-04-04T18:21:50Z\",\n \"created_at\": \"2017-04-04T18:21:50Z\",\n \"subscription_item\": {\n \"id\": \"si_EJ8lP61Cotbyz9jx\",\n \"description\": \"Bola\",\n \"quantity\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:21:18Z\",\n \"updated_at\": \"2017-04-04T18:21:18Z\",\n \"subscription\": {\n \"id\": \"sub_o0Jw4WYCMuPNqzGr\",\n \"code\": \"09NFPLBZY0\",\n \"start_at\": \"2017-04-04T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2017-05-04T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:21:17Z\",\n \"updated_at\": \"2017-04-04T18:21:17Z\"\n }\n }\n}"
schema:
type: object
properties:
id:
type: string
example: usage_QV1gBLhalU35RNbx
quantity:
type: integer
example: 1
default: 0
status:
type: string
example: active
used_at:
type: string
example: '2017-04-04T18:21:50Z'
created_at:
type: string
example: '2017-04-04T18:21:50Z'
subscription_item:
type: object
properties:
id:
type: string
example: si_EJ8lP61Cotbyz9jx
description:
type: string
example: Bola
quantity:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2017-04-04T18:21:18Z'
updated_at:
type: string
example: '2017-04-04T18:21:18Z'
subscription:
type: object
properties:
id:
type: string
example: sub_o0Jw4WYCMuPNqzGr
code:
type: string
example: 09NFPLBZY0
start_at:
type: string
example: '2017-04-04T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2017-05-04T00: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-04-04T18:21:17Z'
updated_at:
type: string
example: '2017-04-04T18:21:17Z'
'404':
description: '404'
content:
application/json:
examples:
Result:
value: "{\n \"message\": \"Item not found.\"\n}"
schema:
type: object
properties:
message:
type: string
example: Item not found.
deprecated: false
tags:
- Subscriptions
get:
summary: Listar uso
description: Este recurso permite listar os usos de um item de assinatura.
operationId: listar-uso
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
- name: item_id
in: path
description: 'Código do item da assinatura.
Formato: `si_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
code:
type: string
description: Código de identificação no sistema do cliente
group:
type: string
description: Código de identificação do grupo no sistema do cliente
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"data\": [\n {\n \"id\": \"usage_QV1gBLhalU35RNbx\",\n \"quantity\": 1,\n \"status\": \"deleted\",\n \"used_at\": \"2017-04-04T18:21:50Z\",\n \"created_at\": \"2017-04-04T18:21:50Z\",\n \"deleted_at\": \"2017-04-04T18:25:08Z\"\n },\n {\n \"id\": \"usage_73ybm1nCMfRVYdxA\",\n \"quantity\": 1,\n \"description\": \"Bola\",\n \"status\": \"active\",\n \"used_at\": \"2017-04-04T00:00:00Z\",\n \"created_at\": \"2017-04-04T18:21:18Z\"\n }\n ],\n \"paging\": {\n \"total\": 2\n }\n}"
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
id:
type: string
example: usage_QV1gBLhalU35RNbx
quantity:
type: integer
example: 1
default: 0
status:
type: string
example: deleted
used_at:
type: string
example: '2017-04-04T18:21:50Z'
created_at:
type: string
example: '2017-04-04T18:21:50Z'
deleted_at:
type: string
example: '2017-04-04T18:25:08Z'
paging:
type: object
properties:
total:
type: integer
example: 2
default: 0
'404':
description: '404'
content:
application/json:
examples:
item not found:
value: "{\n \"message\": \"Item not found.\"\n}"
subsciption not found:
value: "{\n \"message\": \"Subscription not found.\"\n}"
schema:
oneOf:
- title: item not found
type: object
properties:
message:
type: string
example: Item not found.
- title: subsciption not found
type: object
properties:
message:
type: string
example: Subscription not found.
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/items/{item_id}/usages/{usage_id}:
delete:
summary: Remover uso
description: Com o verbo HTTP DELETE, através dos identificadores do uso (`usage_id`), do item (`subscription_item_id`) a da assinatura associada (`subscription_id`), é possível excluir o uso do item de uma assinatura.
operationId: remover-uso
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
- name: item_id
in: path
description: 'Código do item da assinatura.
Formato: `si_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
- name: usage_id
in: path
description: 'Código do uso.
Formato: `usage_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"usage_QV1gBLhalU35RNbx\",\n \"quantity\": 1,\n \"status\": \"deleted\",\n \"used_at\": \"2017-04-04T18:21:50Z\",\n \"created_at\": \"2017-04-04T18:21:50Z\",\n \"deleted_at\": \"2017-04-04T18:24:57Z\",\n \"subscription_item\": {\n \"id\": \"si_EJ8lP61Cotbyz9jx\",\n \"description\": \"Bola\",\n \"quantity\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:21:18Z\",\n \"updated_at\": \"2017-04-04T18:21:18Z\",\n \"subscription\": {\n \"id\": \"sub_o0Jw4WYCMuPNqzGr\",\n \"code\": \"09NFPLBZY0\",\n \"start_at\": \"2017-04-04T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2017-05-04T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-04-04T18:21:17Z\",\n \"updated_at\": \"2017-04-04T18:21:17Z\"\n }\n }\n}"
schema:
type: object
properties:
id:
type: string
example: usage_QV1gBLhalU35RNbx
quantity:
type: integer
example: 1
default: 0
status:
type: string
example: deleted
used_at:
type: string
example: '2017-04-04T18:21:50Z'
created_at:
type: string
example: '2017-04-04T18:21:50Z'
deleted_at:
type: string
example: '2017-04-04T18:24:57Z'
subscription_item:
type: object
properties:
id:
type: string
example: si_EJ8lP61Cotbyz9jx
description:
type: string
example: Bola
quantity:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2017-04-04T18:21:18Z'
updated_at:
type: string
example: '2017-04-04T18:21:18Z'
subscription:
type: object
properties:
id:
type: string
example: sub_o0Jw4WYCMuPNqzGr
code:
type: string
example: 09NFPLBZY0
start_at:
type: string
example: '2017-04-04T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2017-05-04T00: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-04-04T18:21:17Z'
updated_at:
type: string
example: '2017-04-04T18:21:17Z'
'404':
description: '404'
content:
application/json:
examples:
Result:
value: "{\n \"message\": \"Usage not found.\"\n}"
schema:
oneOf:
- type: object
properties:
message:
type: string
example: Item not found.
- type: object
properties:
message:
type: string
example: Subscription not found.
- type: object
properties:
message:
type: string
example: Usage not found.
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/manual-billing:
post:
summary: Ativar faturamento manual
description: Configuração da assinatura que indica se o faturamento será feito de forma `manual` ou `automática`.`Caso esteja ativa`, as faturas não serão geradas automaticamente pelo nosso sistema, ficando a cargo do lojista realizar o faturamento pelo endpoint Criar Fatura.
operationId: ativar-faturamento-manual-1
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"sub_kpWeWOBcOcpqe8jg\",\n \"code\": \"PX7ECLF6Y3\",\n \"start_at\": \"2019-05-07T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2019-06-07T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2019-05-07T21:32:28Z\",\n \"updated_at\": \"2019-05-07T21:33:22Z\",\n \"manual_billing\": true\n}"
schema:
type: object
properties:
id:
type: string
example: sub_kpWeWOBcOcpqe8jg
code:
type: string
example: PX7ECLF6Y3
start_at:
type: string
example: '2019-05-07T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2019-06-07T00:00:00Z'
payment_method:
type: string
example: credit_card
currency:
type: string
example: BRL
installments:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2019-05-07T21:32:28Z'
updated_at:
type: string
example: '2019-05-07T21:33:22Z'
manual_billing:
type: boolean
example: true
default: true
'400':
description: '400'
content:
application/json:
examples:
Result:
value: '{}'
schema:
type: object
properties: {}
deprecated: false
tags:
- Subscriptions
delete:
summary: Desativar faturamento manual
description: 'Configuração da assinatura que indica se o faturamento será feito de forma `manual` ou `automática`.
`Caso esteja desativada`, as faturas serão geradas automaticamente pelo nosso sistema.'
operationId: desativar-faturamento-manual-1
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
responses:
'200':
description: '200'
content:
application/json:
examples:
Result:
value: "{\n \"id\": \"sub_kpWeWOBcOcpqe8jg\",\n \"code\": \"PX7ECLF6Y3\",\n \"start_at\": \"2019-05-07T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"next_billing_at\": \"2019-06-07T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2019-05-07T21:32:28Z\",\n \"updated_at\": \"2019-05-07T21:32:38Z\"\n}"
schema:
type: object
properties:
id:
type: string
example: sub_kpWeWOBcOcpqe8jg
code:
type: string
example: PX7ECLF6Y3
start_at:
type: string
example: '2019-05-07T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
next_billing_at:
type: string
example: '2019-06-07T00:00:00Z'
payment_method:
type: string
example: credit_card
currency:
type: string
example: BRL
installments:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2019-05-07T21:32:28Z'
updated_at:
type: string
example: '2019-05-07T21:32:38Z'
'400':
description: '400'
content:
application/json:
examples:
Result:
value: '{}'
schema:
type: object
properties: {}
deprecated: false
tags:
- Subscriptions
/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.
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.
[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: "{\n \"id\": \"sub_yOkq7oI03S7Wq741\",\n \"code\": \"V9OMHENIK6\",\n \"start_at\": \"2017-08-10T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"gateway_affiliation_id\": \"C56A4180-65AA-42EC-A945-5FD21DEC0538\",\n \"boleto_due_days\":5,\n \"minimum_price\": 10000,\n \"current_cycle\": {\n \"id\": \"cycle_Z82JyBgSM2iwe4Lp\",\n \"start_at\": \"2017-08-10T00:00:00Z\",\n \"end_at\": \"2017-09-09T23:59:59Z\",\n \"billing_at\": \"2017-09-10T00:00:00Z\"\n },\n \"setup\": {\n \"id\": \"or_8e0l1KGFZgIpzNVG\",\n \"description\": \"Inscrição\",\n \"amount\": 9990,\n \"status\": \"paid\"\n },\n \"next_billing_at\": \"2017-09-10T00:00:00Z\",\n \"payment_method\": \"credit_card\",\n \"currency\": \"BRL\",\n \"statement_descriptor\": \"Spotify\",\n \"installments\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-08-10T21:27:13Z\",\n \"updated_at\": \"2017-08-10T21:27:29Z\",\n \"customer\": {\n \"id\": \"cus_4jEgBpgfbIe6vnqy\",\n \"name\": \"Tony Stark\",\n \"email\": \"f95783c1-c288-4dfb-9e1f-c3b9a4d55a7b@avengers.com\",\n \"delinquent\": false,\n \"created_at\": \"2017-08-10T21:27:11Z\",\n \"updated_at\": \"2017-08-10T21:27:11Z\",\n \"phones\": {}\n },\n \"card\": {\n \"id\": \"card_bQzW0GMfnAsry6KM\",\n \"first_six_digits\": \"342793\",\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\": \"2017-08-10T21:27:12Z\",\n \"updated_at\": \"2017-08-10T21:27:12Z\",\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 \"type\": \"credit\"\n },\n \"plan\": {\n \"id\": \"plan_jEJWD1qF2Xf92eKv\",\n \"name\": \"Premium\",\n \"description\": \"Vá de Premium. E seja feliz!\",\n \"url\": \"/plans/plan_jEJWD1qF2Xf92eKv/pagarme-teste/premium\",\n \"statement_descriptor\": \"Spotify\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"payment_methods\": [\n \"boleto\",\n \"credit_card\"\n ],\n \"installments\": [\n 1\n ],\n \"status\": \"active\",\n \"currency\": \"BRL\",\n \"created_at\": \"2017-08-10T21:27:08Z\",\n \"updated_at\": \"2017-08-10T21:27:08Z\"\n },\n \"items\": [\n {\n \"id\": \"si_ZY8Vrapsnu9QjMde\",\n \"description\": \"Premium\",\n \"quantity\": 1,\n \"status\": \"active\",\n \"created_at\": \"2017-08-10T21:27:14Z\",\n \"updated_at\": \"2017-08-10T21:27:14Z\",\n \"pricing_scheme\": {\n \"price\": 1490,\n \"scheme_type\": \"unit\"\n }\n }\n ],\n \"metadata\": {\n \"code\": \"1234\",\n \"company\": \"Avengers\"\n }\n}"
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: "{\n \"message\": \"Subscription not found.\"\n}"
schema:
type: object
properties:
message:
type: string
example: Subscription not found.
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/minimum_price:
patch:
summary: Editar preço mínimo da assinatura
description: Com o verbo HTTP PATCH, através do identificador da assinatura (`subscription_id`) é possível atualizar o minimum price da assinatura.
operationId: editar-minimum-price-da-assinatura
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
minimum_price:
type: integer
description: Valor mínimo da assinatura em centavos.
format: int32
examples:
Request Example:
value:
minimum_price: '100'
responses:
'200':
description: '200'
content:
application/json:
examples:
OK (to boleto):
value: "{\n \"id\": \"sub_JrvX5MpS6Niq9wzL\",\n \"code\": \"6NXQF71FJD\",\n \"start_at\": \"2022-03-10T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"prepaid\",\n \"current_cycle\": {\n \"id\": \"cycle_g6ek64cdmtE6JqVj\",\n \"start_at\": \"2022-03-10T00:00:00Z\",\n \"end_at\": \"2022-04-09T23:59:59Z\",\n \"billing_at\": \"2022-03-10T00:00:00Z\",\n \"status\": \"billed\",\n \"cycle\": 1\n },\n \"next_billing_at\": \"2022-04-10T00:00:00Z\",\n \"payment_method\": \"boleto\",\n \"currency\": \"BRL\",\n \"installments\": 1,\n \"minimum_price\": 100,\n \"status\": \"active\",\n \"boleto_due_days\": 20,\n \"created_at\": \"2022-03-10T19:42:17Z\",\n \"updated_at\": \"2022-03-10T19:42:56Z\",\n \"customer\": {\n \"id\": \"cus_EbKg5vdUK9hJ0MVX\",\n \"name\": \"Tony Stark\",\n \"email\": \"98724a80-19ef-4208-bee4-739c138eb85f@avengers.com\",\n \"delinquent\": false,\n \"created_at\": \"2022-03-10T19:42:17Z\",\n \"updated_at\": \"2022-03-10T19:42:17Z\",\n \"phones\": {}\n },\n \"items\": [\n {\n \"id\": \"si_ZO5pLyltRf80ml6B\",\n \"name\": \"Premium\",\n \"description\": \"Sem anuncios\",\n \"quantity\": 1,\n \"status\": \"active\",\n \"created_at\": \"2022-03-10T19:42:17Z\",\n \"updated_at\": \"2022-03-10T19:42:17Z\",\n \"pricing_scheme\": {\n \"price\": 1490,\n \"scheme_type\": \"unit\"\n }\n },\n {\n \"id\": \"si_yNo8g7TadToJ8bPa\",\n \"name\": \"Silver\",\n \"description\": \"Com anuncios\",\n \"quantity\": 1,\n \"status\": \"active\",\n \"created_at\": \"2022-03-10T19:42:17Z\",\n \"updated_at\": \"2022-03-10T19:42:17Z\",\n \"pricing_scheme\": {\n \"price\": 2000,\n \"scheme_type\": \"unit\"\n }\n }\n ]\n}"
schema:
type: object
properties:
id:
type: string
example: sub_JrvX5MpS6Niq9wzL
code:
type: string
example: 6NXQF71FJD
start_at:
type: string
example: '2022-03-10T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: prepaid
current_cycle:
type: object
properties:
id:
type: string
example: cycle_g6ek64cdmtE6JqVj
start_at:
type: string
example: '2022-03-10T00:00:00Z'
end_at:
type: string
example: '2022-04-09T23:59:59Z'
billing_at:
type: string
example: '2022-03-10T00:00:00Z'
status:
type: string
example: billed
cycle:
type: integer
example: 1
default: 0
next_billing_at:
type: string
example: '2022-04-10T00:00:00Z'
payment_method:
type: string
example: boleto
currency:
type: string
example: BRL
installments:
type: integer
example: 1
default: 0
minimum_price:
type: integer
example: 100
default: 0
status:
type: string
example: active
boleto_due_days:
type: integer
example: 20
default: 0
created_at:
type: string
example: '2022-03-10T19:42:17Z'
updated_at:
type: string
example: '2022-03-10T19:42:56Z'
customer:
type: object
properties:
id:
type: string
example: cus_EbKg5vdUK9hJ0MVX
name:
type: string
example: Tony Stark
email:
type: string
example: 98724a80-19ef-4208-bee4-739c138eb85f@avengers.com
delinquent:
type: boolean
example: false
default: true
created_at:
type: string
example: '2022-03-10T19:42:17Z'
updated_at:
type: string
example: '2022-03-10T19:42:17Z'
phones:
type: object
properties: {}
items:
type: array
items:
type: object
properties:
id:
type: string
example: si_ZO5pLyltRf80ml6B
name:
type: string
example: Premium
description:
type: string
example: Sem anuncios
quantity:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2022-03-10T19:42:17Z'
updated_at:
type: string
example: '2022-03-10T19:42:17Z'
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.
deprecated: false
tags:
- Subscriptions
/subscriptions/{subscription_id}/payment-method:
patch:
summary: Editar meio de pagamento da assinatura
description: Com o verbo HTTP PATCH, através do identificador da assinatura (`subscription_id`) é possível atualizar o meio de pagamento da assinatura.
operationId: editar-meio-de-pagamento-da-assinatura
parameters:
- name: subscription_id
in: path
description: 'Código da assinatura.
Formato: `sub_XXXXXXXXXXXXXXXX`.'
schema:
type: string
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
payment_method:
type: string
description: 'Meio de pagamento.
Valores possíveis: **credit_card**, **boleto**, **cash** ou **debit_card** . Deve-se adicionar o meio de pagamento após o objeto "payment_method"'
card:
type: object
description: Dados do novo cartão.
**Obrigatório** , caso o `payment_method` escolhido seja `credit_card` e o `card_id` e o `card_token` não sejam informados.
properties: {}
card_id:
type: string
description: Código do novo cartão.
**Obrigatório** , caso o `payment_method` escolhido seja `credit_card` e o objeto `card` e o `card_token` não sejam informados.
card_token:
type: string
description: Token do novo cartão.
**Obrigatório** , caso o `payment_method` escolhido seja `credit_card` e o `card_id` e o `card` não sejam informados.
[Saiba mais token de cartão](https://docs.pagar.me/reference/criar-token-cart%C3%A3o-1)
examples:
JSON (to boleto):
value:
payment_method: boleto
JSON (to credit card by Id):
value:
payment_method: credit_card
card_id: card_PoDev5OCEEUjRJXp
responses:
'200':
description: '200'
content:
application/json:
examples:
OK (to boleto):
value: "{\n \"id\": \"sub_05jkdIfGYPfN26mI\",\n \"payment_method\": \"boleto\",\n \"currency\": \"BRL\",\n \"interval\": \"month\",\n \"interval_count\": 3,\n \"billing_type\": \"prepaid\",\n \"gateway_affiliation_id\":\"C56A4180-65AA-42EC-A945-5FD21DEC0538\",\n \"boleto_due_days\":5,\n \"minimum_price\": 10000,\n \"current_period\": {\n \"start_at\": \"2016-07-19T00:00:00Z\",\n \"end_at\": \"2016-10-18T23:59:59Z\"\n },\n \"next_billing_at\": \"2016-10-19T00:00:00Z\",\n \"installments\": 3,\n \"customer\": {\n \"id\": \"cus_017228NmffGbA3d4\",\n \"name\": \"Luke Skywalker\",\n \"email\": \"lskywalker@r2d2.com\",\n \"delinquent\": false,\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\",\n },\n \"discounts\": [\n {\n \"id\": \"si_k2zpBDMsOs0fDfHe\",\n \"cycles\": 3,\n \"value\": 10,\n \"discount_type\": \"percentage\",\n \"created_at\": \"2016-07-12T18:25:40Z\"\n }\n ],\n \"increments\": [\n {\n \"id\": \"inc_IYzpxgjsOs0fDIoP\",\n \"cycles\": 2,\n \"value\": 20,\n \"discount_type\": \"percentage\",\n \"created_at\": \"2016-07-12T18:25:40Z\"\n }\n ],\n \"items\": [\n {\n \"id\": \"si_B6555Riyq9lj6klS\",\n \"description\": \"Musculação\",\n \"quantity\": 1,\n \"pricing_scheme\": {\n \"price\": 18990,\n \"scheme_type\": \"unit\"\n },\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\",\n },\n {\n \"id\": \"si_lFjtC2xYGttulJpn\",\n \"description\": \"Matrícula\",\n \"quantity\": 1,\n \"cycles\": 1,\n \"pricing_scheme\": {\n \"price\": 5990,\n \"scheme_type\": \"unit\"\n },\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\",\n }\n ],\n \"status\": \"active\",\n \"created_at\": \"2016-07-12T18:25:40Z\",\n \"updated_at\": \"2016-07-12T18:25:40Z\",\n \"metadata\": {\n \"id\": \"my_subscription_id\"\n }\n}"
OK (to credit card by Id):
value: "{\n \"id\": \"sub_WeEMlp2FXFMjVq3Q\",\n \"code\": \"8YNU49TD4Z\",\n \"start_at\": \"2018-04-05T00:00:00Z\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"current_cycle\": {\n \"id\": \"cycle_6ow0JqhD5sJmMJPl\",\n \"start_at\": \"2018-04-05T00:00:00Z\",\n \"end_at\": \"2018-05-04T23:59:59Z\",\n \"billing_at\": \"2018-05-05T00:00:00Z\"\n },\n \"setup\": {\n \"id\": \"or_0Wd7bYRMSmSYy8qz\",\n \"description\": \"Inscrição\",\n \"amount\": 9990,\n \"status\": \"paid\"\n },\n \"next_billing_at\": \"2018-05-05T00: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-05T03:20:16Z\",\n \"updated_at\": \"2018-04-05T03:20:16Z\",\n \"customer\": {\n \"id\": \"cus_px3yqRSlRsVqawgj\",\n \"name\": \"Tony Stark\",\n \"email\": \"ef61ded5-9e60-40c7-89cd-a3b6e70515e8@avengers.com\",\n \"delinquent\": false,\n \"created_at\": \"2018-04-05T03:20:15Z\",\n \"updated_at\": \"2018-04-05T03:20:15Z\",\n \"phones\": {}\n },\n \"card\": {\n \"id\": \"card_PoDev5OCEEUjRJXp\",\n \"first_six_digits\": \"542501\",\n \"last_four_digits\": \"7793\",\n \"brand\": \"Mastercard\",\n \"holder_name\": \"Tony Stark\",\n \"exp_month\": 1,\n \"exp_year\": 2022,\n \"status\": \"active\",\n \"created_at\": \"2018-04-05T04:05:02Z\",\n \"updated_at\": \"2018-04-05T04:05:02Z\",\n \"billing_address\": {\n \"street\": \"Malibu Point\",\n \"number\": \"10880\",\n \"zip_code\": \"90265\",\n \"neighborhood\": \"Central Malibu\",\n \"city\": \"Malibu\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"line_1\": \"10880, Malibu Point, Central Malibu\"\n },\n \"type\": \"credit\"\n },\n \"plan\": {\n \"id\": \"plan_dxVldzsgzu9rpe8v\",\n \"name\": \"Premium\",\n \"description\": \"Vá de Premium. E seja feliz!\",\n \"url\": \"/plans/plan_dxVldzsgzu9rpe8v/vodafone-teste/premium\",\n \"statement_descriptor\": \"Spotify\",\n \"interval\": \"month\",\n \"interval_count\": 1,\n \"billing_type\": \"postpaid\",\n \"payment_methods\": [\n \"boleto\",\n \"credit_card\"\n ],\n \"installments\": [\n 1\n ],\n \"status\": \"active\",\n \"currency\": \"BRL\",\n \"created_at\": \"2018-04-04T22:17:16Z\",\n \"updated_at\": \"2018-04-04T22:17:16Z\"\n },\n \"items\": [\n {\n \"id\": \"si_5LPVYR1c7WuJd06l\",\n \"name\": \"Name - Premium\",\n \"description\": \"Test - Description\",\n \"quantity\": 1,\n \"status\": \"active\",\n \"created_at\": \"2018-04-05T03:20:16Z\",\n \"updated_at\": \"2018-04-05T03:20:16Z\",\n \"pricing_scheme\": {\n \"price\": 1490,\n \"scheme_type\": \"unit\"\n }\n }\n ]\n}"
schema:
type: object
properties:
id:
type: string
example: sub_WeEMlp2FXFMjVq3Q
code:
type: string
example: 8YNU49TD4Z
start_at:
type: string
example: '2018-04-05T00:00:00Z'
interval:
type: string
example: month
interval_count:
type: integer
example: 1
default: 0
billing_type:
type: string
example: postpaid
current_cycle:
type: object
properties:
id:
type: string
example: cycle_6ow0JqhD5sJmMJPl
start_at:
type: string
example: '2018-04-05T00:00:00Z'
end_at:
type: string
example: '2018-05-04T23:59:59Z'
billing_at:
type: string
example: '2018-05-05T00:00:00Z'
setup:
type: object
properties:
id:
type: string
example: or_0Wd7bYRMSmSYy8qz
description:
type: string
example: Inscrição
amount:
type: integer
example: 9990
default: 0
status:
type: string
example: paid
next_billing_at:
type: string
example: '2018-05-05T00: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-05T03:20:16Z'
updated_at:
type: string
example: '2018-04-05T03:20:16Z'
customer:
type: object
properties:
id:
type: string
example: cus_px3yqRSlRsVqawgj
name:
type: string
example: Tony Stark
email:
type: string
example: ef61ded5-9e60-40c7-89cd-a3b6e70515e8@avengers.com
delinquent:
type: boolean
example: false
default: true
created_at:
type: string
example: '2018-04-05T03:20:15Z'
updated_at:
type: string
example: '2018-04-05T03:20:15Z'
phones:
type: object
properties: {}
card:
type: object
properties:
id:
type: string
example: card_PoDev5OCEEUjRJXp
first_six_digits:
type: string
example: '542501'
last_four_digits:
type: string
example: '7793'
brand:
type: string
example: Mastercard
holder_name:
type: string
example: Tony Stark
exp_month:
type: integer
example: 1
default: 0
exp_year:
type: integer
example: 2022
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2018-04-05T04:05:02Z'
updated_at:
type: string
example: '2018-04-05T04:05:02Z'
billing_address:
type: object
properties:
street:
type: string
example: Malibu Point
number:
type: string
example: '10880'
zip_code:
type: string
example: '90265'
neighborhood:
type: string
example: Central Malibu
city:
type: string
example: Malibu
state:
type: string
example: CA
country:
type: string
example: US
line_1:
type: string
example: 10880, Malibu Point, Central Malibu
type:
type: string
example: credit
plan:
type: object
properties:
id:
type: string
example: plan_dxVldzsgzu9rpe8v
name:
type: string
example: Premium
description:
type: string
example: Vá de Premium. E seja feliz!
url:
type: string
example: /plans/plan_dxVldzsgzu9rpe8v/vodafone-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: '2018-04-04T22:17:16Z'
updated_at:
type: string
example: '2018-04-04T22:17:16Z'
items:
type: array
items:
type: object
properties:
id:
type: string
example: si_5LPVYR1c7WuJd06l
name:
type: string
example: Name - Premium
description:
type: string
example: Test - Description
quantity:
type: integer
example: 1
default: 0
status:
type: string
example: active
created_at:
type: string
example: '2018-04-05T03:20:16Z'
updated_at:
type: string
example: '2018-04-05T03:20:16Z'
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 \"\": [\n \"The card_id, card_token or card field is required.\"\n ]\n },\n \"request\": {\n \"payment_method\": \"credit_card\"\n }\n}"
schema:
type: object
properties:
message:
type: string
example: The request is invalid.
errors:
type: object
properties:
? ''
: type: array
items:
type: string
example: The card_id, card_token or card field is required.
request:
type: object
properties:
payment_method:
type: string
example: credit_card
deprecated: false
tags:
- Subscriptions
components:
securitySchemes:
sec0:
type: http
scheme: basic
x-readme-fauxas: true
x-provenance:
method: searched
source: https://docs.pagar.me/reference
harvested: '2026-10-14'
tool: harvest-readme-openapi.py
note: Assembled verbatim from the OpenAPI definition ReadMe embeds in each operation page of the provider's developer portal; paths and components merged by API title, nothing authored.
assembled_from:
- https://docs.pagar.me/reference/ativar-faturamento-manual-1.md
- https://docs.pagar.me/reference/atualizar-code-de-recebedor.md
- https://docs.pagar.me/reference/cancelar-assinatura-1.md
- https://docs.pagar.me/reference/cancelar-fatura-1.md
- https://docs.pagar.me/reference/cancelar-um-link-de-pagamento.md
- https://docs.pagar.me/reference/create-link.md
- https://docs.pagar.me/reference/criar-assinatura-avulsa.md
- https://docs.pagar.me/reference/criar-assinatura-de-plano-1.md
- https://docs.pagar.me/reference/criar-cliente-1.md
- https://docs.pagar.me/reference/criar-fatura-1.md
- https://docs.pagar.me/reference/criar-link-recebedor.md
- https://docs.pagar.me/reference/criar-link.md
- https://docs.pagar.me/reference/criar-pedido-2.md
- https://docs.pagar.me/reference/criar-pedido-com-antifraude.md
- https://docs.pagar.me/reference/criar-pedido-com-split-1.md
- https://docs.pagar.me/reference/criar-pedido-multicompradores.md
- https://docs.pagar.me/reference/criar-pedido-multimeios.md
- https://docs.pagar.me/reference/criar-plano-1.md
- https://docs.pagar.me/reference/criar-recebedor-1.md
- https://docs.pagar.me/reference/criar-token-cart%C3%A3o-1.md
- https://docs.pagar.me/reference/deletar-item.md
- https://docs.pagar.me/reference/desativar-faturamento-manual-1.md
- https://docs.pagar.me/reference/editar-cliente-1.md
- https://docs.pagar.me/reference/editar-item-1.md
- https://docs.pagar.me/reference/editar-item-do-pedido.md
- https://docs.pagar.me/reference/editar-item.md
- https://docs.pagar.me/reference/editar-meio-de-pagamento-da-assinatura.md
- https://docs.pagar.me/reference/editar-metadados-da-assinatura-1.md
- https://docs.pagar.me/reference/editar-metadados-da-fatura-1.md
- https://docs.pagar.me/reference/editar-metadados-do-plano-1.md
- https://docs.pagar.me/reference/editar-minimum-price-da-assinatura.md
- https://docs.pagar.me/reference/editar-plano-1.md
- https://docs.pagar.me/reference/editar-recebedor-1.md
- https://docs.pagar.me/reference/enviar-webhook.md
- https://docs.pagar.me/reference/excluir-plano-1.md
- https://docs.pagar.me/reference/fechar-um-pedido.md
- https://docs.pagar.me/reference/incluir-desconto-1.md
- https://docs.pagar.me/reference/incluir-incremento-1.md
- https://docs.pagar.me/reference/incluir-item-1.md
- https://docs.pagar.me/reference/incluir-item-2.md
- https://docs.pagar.me/reference/incluir-item.md
- https://docs.pagar.me/reference/incluir-uso.md
- https://docs.pagar.me/reference/listar-assinaturas-1.md
- https://docs.pagar.me/reference/listar-ciclos-1.md
- https://docs.pagar.me/reference/listar-clientes-1.md
- https://docs.pagar.me/reference/listar-descontos-2.md
- https://docs.pagar.me/reference/listar-faturas-1.md
- https://docs.pagar.me/reference/listar-incrementos.md
- https://docs.pagar.me/reference/listar-pedidos.md
- https://docs.pagar.me/reference/listar-planos-1.md
- https://docs.pagar.me/reference/listar-recebedores-1.md
- https://docs.pagar.me/reference/listar-uso.md
- https://docs.pagar.me/reference/listar-webhooks.md
- https://docs.pagar.me/reference/obter-assinatura-1.md
- https://docs.pagar.me/reference/obter-ciclo-1.md
- https://docs.pagar.me/reference/obter-cliente-1.md
- https://docs.pagar.me/reference/obter-desconto-1.md
- https://docs.pagar.me/reference/obter-fatura-1.md
- https://docs.pagar.me/reference/obter-incremento-1.md
- https://docs.pagar.me/reference/obter-item-do-pedido.md
- https://docs.pagar.me/reference/obter-link.md
- https://docs.pagar.me/reference/obter-links.md
- https://docs.pagar.me/reference/obter-pedido.md
- https://docs.pagar.me/reference/obter-plano-1.md
- https://docs.pagar.me/reference/obter-recebedor-1.md
- https://docs.pagar.me/reference/obter-saldo.md
- https://docs.pagar.me/reference/obter-webhook.md
- https://docs.pagar.me/reference/remover-desconto-1.md
- https://docs.pagar.me/reference/remover-incremento-1.md
- https://docs.pagar.me/reference/remover-item-1.md
- https://docs.pagar.me/reference/remover-item.md
- https://docs.pagar.me/reference/remover-todos-os-itens.md
- https://docs.pagar.me/reference/remover-uso.md
- https://docs.pagar.me/reference/renovar-ciclo-1.md
- https://docs.pagar.me/reference/retornando-pagamentos-por-recebedor.md
- https://docs.pagar.me/reference/retornando-pagamentos.md
- https://docs.pagar.me/reference/retornando-um-pagamento.md
- https://docs.pagar.me/reference/retornando-urs-de-um-recebedor-v5.md
merge:
pages: 78
deduped: 82
conflicts_kept_first: 0