v1

latestOpenAPI 3.1.02026-07-241040774.6 KB

Editar meio de pagamento da assinatura

Com o verbo HTTP PATCH, através do identificador da assinatura (subscription_id) é possível atualizar o meio de pagamento da assinatura.

patch/subscriptions/{subscription_id}/payment-method

Path parameters

subscription_idstring required

Código da assinatura.<br>Formato: sub_XXXXXXXXXXXXXXXX.

Request body

payment_methodstring required

Meio de pagamento.<br>Valores possíveis: credit_card, boleto, cash ou debit_card .

card_idstring required

Código do novo cartão.<br>Obrigatório , caso o payment_method escolhido seja credit_card e o objeto card e o card_token não sejam informados.

cardobject required

Dados do novo cartão..<br>Obrigatório , caso o payment_method escolhido seja credit_card e o card_id e o card_token não sejam informados.<br>Saiba mais sobre cartões

card_tokenstring

Token do novo cartão. <br>Obrigatório , caso o payment_method escolhido seja credit_card e o card_id e o card não sejam informados.<br>Saiba mais token de cartão

Response

200

idstring
codestring
start_atstring
intervalstring
interval_countinteger
billing_typestring
next_billing_atstring
payment_methodstring
currencystring
statement_descriptorstring
installmentsinteger
statusstring
created_atstring
updated_atstring

Example response

{
  "id": "sub_WeEMlp2FXFMjVq3Q",
  "code": "8YNU49TD4Z",
  "start_at": "2018-04-05T00:00:00Z",
  "interval": "month",
  "interval_count": 1,
  "billing_type": "postpaid",
  "current_cycle": {
    "id": "cycle_6ow0JqhD5sJmMJPl",
    "start_at": "2018-04-05T00:00:00Z",
    "end_at": "2018-05-04T23:59:59Z",
    "billing_at": "2018-05-05T00:00:00Z"
  },
  "setup": {
    "id": "or_0Wd7bYRMSmSYy8qz",
    "description": "Inscrição",
    "amount": 9990,
    "status": "paid"
  },
  "next_billing_at": "2018-05-05T00:00:00Z",
  "payment_method": "credit_card",
  "currency": "BRL",
  "statement_descriptor": "Spotify",
  "installments": 1,
  "status": "active",
  "created_at": "2018-04-05T03:20:16Z",
  "updated_at": "2018-04-05T03:20:16Z",
  "customer": {
    "id": "cus_px3yqRSlRsVqawgj",
    "name": "Tony Stark",
    "email": "ef61ded5-9e60-40c7-89cd-a3b6e70515e8@avengers.com",
    "created_at": "2018-04-05T03:20:15Z",
    "updated_at": "2018-04-05T03:20:15Z"
  },
  "card": {
    "id": "card_PoDev5OCEEUjRJXp",
    "first_six_digits": "542501",
    "last_four_digits": "7793",
    "brand": "Mastercard",
    "holder_name": "Tony Stark",
    "exp_month": 1,
    "exp_year": 2022,
    "status": "active",
    "created_at": "2018-04-05T04:05:02Z",
    "updated_at": "2018-04-05T04:05:02Z",
    "billing_address": {
      "street": "Malibu Point",
      "number": "10880",
      "zip_code": "90265",
      "neighborhood": "Central Malibu",
      "city": "Malibu",
      "state": "CA",
      "country": "US",
      "line_1": "10880, Malibu Point, Central Malibu"
    },
    "type": "credit"
  },
  "plan": {
    "id": "plan_dxVldzsgzu9rpe8v",
    "name": "Premium",
    "description": "Vá de Premium. E seja feliz!",
    "url": "/plans/plan_dxVldzsgzu9rpe8v/vodafone-teste/premium",
    "statement_descriptor": "Spotify",
    "interval": "month",
    "interval_count": 1,
    "billing_type": "postpaid",
    "payment_methods": [
      "boleto"
    ],
    "installments": [
      1
    ],
    "status": "active",
    "currency": "BRL",
    "created_at": "2018-04-04T22:17:16Z",
    "updated_at": "2018-04-04T22:17:16Z"
  },
  "items": [
    {
      "id": "si_5LPVYR1c7WuJd06l",
      "name": "Name - Premium",
      "description": "Test - Description",
      "quantity": 1,
      "status": "active",
      "created_at": "2018-04-05T03:20:16Z",
      "updated_at": "2018-04-05T03:20:16Z",
      "pricing_scheme": {
        "price": 1490,
        "scheme_type": "unit"
      }
    }
  ]
}