v1
latestOpenAPI 3.1.02026-07-241040774.6 KBListar assinaturas
Este recurso permite listar as assinaturas. Pode ser utilizados alguns parâmetros como filtro da listagem.
get/subscriptions
Query parameters
statusstring
Status da assinatura.<br>Valores possíveis: active, canceled ou future
codestring
Código de referência do cliente no sistema da loja.
billing_typestring
Tipo de cobrança.<br>Valores possíveis: prepaid, **postpaid **ou exact_day
customer_idstring
Código do cliente.<br>Formato: cus_XXXXXXXXXXXXXXXX.
plan_idstring
Código do plano.<br>Formato: plan_XXXXXXXXXXXXXXXX.
card_idstring
Código do cartão.<br>Formato: card_XXXXXXXXXXXXXXXX.
next_billing_sincestring date
Data de início da próxima data de cobrança.
next_billing_untilstring date
Data final de próxima data de cobrança.
created_sincestring date
Data de início do período de criação a ser listado.
created_untilstring date
Data final do período de criação a ser listado.
pageinteger
Página atual
sizeinteger
Quantidade de itens por página.
Response
200
Example response
{
"data": [
{
"id": "sub_05jkdIfGYPfN26mI",
"payment_method": "credit_card",
"currency": "BRL",
"interval": "month",
"gateway_affiliation_id": "C56A4180-65AA-42EC-A945-5FD21DEC0538",
"boleto_due_days": 5,
"minimum_price": 10000,
"interval_count": 3,
"billing_type": "prepaid",
"current_period": {
"start_at": "2016-07-19T00:00:00Z",
"end_at": "2016-10-18T23:59:59Z"
},
"next_billing_at": "2016-10-19T00:00:00Z",
"installments": 3,
"customer": {
"id": "cus_017228NmffGbA3d4",
"name": "Luke Skywalker",
"email": "lskywalker@r2d2.com",
"created_at": "2016-07-12T18:25:40Z",
"updated_at": "2016-07-12T18:25:40Z"
},
"credit_card": {
"id": "card_Mome2meGz4PDNQbX",
"holder_name": "Luke Skywalker",
"masked_number": "402400******4251",
"exp_month": 6,
"exp_year": 17,
"status": "active",
"created_at": "2016-07-12T18:25:40Z",
"update_at": "2016-07-12T18:25:40Z",
"billing_address": {
"line_1": "10880, Malibu Point, Malibu Central",
"zip_code": "90265",
"city": "Malibu",
"state": "CA",
"country": "US"
}
},
"discounts": [
{
"id": "si_k2zpBDMsOs0fDfHe",
"cycles": 3,
"value": 10,
"discount_type": "percentage",
"created_at": "2016-07-12T18:25:40Z"
}
],
"increments": [
{
"id": "inc_IYzpxgjsOs0fDIoP",
"cycles": 2,
"value": 20,
"discount_type": "percentage",
"created_at": "2016-07-12T18:25:40Z"
}
],
"items": [
{
"id": "si_B6555Riyq9lj6klS",
"description": "Musculação",
"quantity": 1,
"pricing_scheme": {
"price": 18990,
"scheme_type": "unit"
},
"status": "active",
"created_at": "2016-07-12T18:25:40Z",
"updated_at": "2016-07-12T18:25:40Z"
}
],
"status": "active",
"created_at": "2016-07-12T18:25:40Z",
"updated_at": "2016-07-12T18:25:40Z",
"metadata": {
"id": "my_subscription_id"
}
}
],
"paging": {
"total_items": 1,
"current_page": 1,
"total_pages": 1
}
}