Cancelar assinatura

Com o verbo HTTP DELETE, através do identificador da assinatura (subscription_id) é possível cancelar a assinatura.

delete
https://api.stone.com.br/core/v5/subscriptions/{subscription_id}

Path Parameters

subscription_idstringrequired

Código da assinatura.
Formato: sub_XXXXXXXXXXXXXXXX.

Body

application/json
cancel_pending_invoicesboolean

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

Response

application/json

200

idstring

Example:sub_WeEMlp2FXFMjVq3Q

codestring

Example:8YNU49TD4Z

start_atstring

Example:2018-04-05T00:00:00Z

intervalstring

Example:month

interval_countinteger

Default:0

Example:1

billing_typestring

Example:postpaid

boleto_due_daysinteger

Default:0

Example:5

current_cycleobject
Show Child Parameters
setupobject
Show Child Parameters
next_billing_atstring

Example:2018-04-05T00:00:00Z

payment_methodstring

Example:boleto

currencystring

Example:BRL

statement_descriptorstring

Example:Spotify

installmentsinteger

Default:0

Example:1

statusstring

Example:canceled

created_atstring

Example:2018-04-05T03:20:16Z

updated_atstring

Example:2018-04-05T12:14:06Z

canceled_atstring

Example:2018-04-05T12:14:06Z

customerobject
Show Child Parameters
planobject
Show Child Parameters
itemsarray[object]
Show Child Parameters
delete/subscriptions/{subscription_id}

Body

{}
 
application/json

Editar cartão da assinatura

Com o verbo HTTP PATCH, através do identificador da assinatura (subscription_id) é possível atualizar o cartão utilizado para pagamento da assinatura.

patch
https://api.stone.com.br/core/v5/subscriptions/{subscription_id}/card

Path Parameters

subscription_idstringrequired

Código da assinatura.
Formato: sub_XXXXXXXXXXXXXXXX.

Body

application/json
card_idstring

Código do cartão.
Formato: card_XXXXXXXXXXXXXXXX.

cardstring

Dados do novo cartão.Saiba mais sobre cartões

Response

application/json

200

idstring

Example:sub_WeEMlp2FXFMjVq3Q

codestring

Example:8YNU49TD4Z

start_atstring

Example:2018-04-05T00:00:00Z

intervalstring

Example:month

interval_countinteger

Default:0

Example:1

billing_typestring

Example:postpaid

boleto_due_daysinteger

Default:0

Example:5

current_cycleobject
Show Child Parameters
setupobject
Show Child Parameters
next_billing_atstring

Example:2018-05-05T00:00:00Z

payment_methodstring

Example:credit_card

currencystring

Example:BRL

statement_descriptorstring

Example:Spotify

installmentsinteger

Default:0

Example:1

statusstring

Example:active

created_atstring

Example:2018-04-05T03:20:16Z

updated_atstring

Example:2018-04-05T03:20:16Z

customerobject
Show Child Parameters
cardobject
Show Child Parameters
planobject
Show Child Parameters
itemsarray[object]
Show Child Parameters
patch/subscriptions/{subscription_id}/card

Body

{ "card": { "number": "4532912167490007", "holder_name": "Tony Stark", "exp_month": 6, "exp_year": 30, "cvv": "474", "billing_address": { "line_1": "375, Av. General Justo, Centro", "line_2": "8º andar", "zip_code": "20021130", "city": "Rio de Janeiro", "state": "RJ", "country": "BR" } } }
 
application/json

Editar data de faturamento da assinatura

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

patch
https://api.stone.com.br/core/v5/subscriptions/{subscription_id}/billing-date

Path Parameters

subscription_idstringrequired

Código da assinatura.
Formato: sub_XXXXXXXXXXXXXXXX.

Body

application/json
next_billing_atstringrequired

Próxima data de cobrança.

Response

application/json

200

idstring

Example:sub_lmxK4k0hPfJ5z58w

codestring

Example:9X8HROC4E0

start_atstring

Example:2017-04-03T00:00:00Z

intervalstring

Example:month

interval_countinteger

Default:0

Example:1

billing_typestring

Example:prepaid

gateway_affiliation_idstring

Example:C56A4180-65AA-42EC-A945-5FD21DEC0538

boleto_due_daysinteger

Default:0

Example:5

minimum_priceinteger

Default:0

Example:10000

current_cycleobject
Show Child Parameters
next_billing_atstring

Example:2017-04-05T00:00:00Z

payment_methodstring

Example:credit_card

currencystring

Example:BRL

statement_descriptorstring

Example:Spotify

installmentsinteger

Default:0

Example:1

statusstring

Example:active

created_atstring

Example:2017-04-03T19:04:24Z

updated_atstring

Example:2017-04-03T19:04:24Z

customerobject
Show Child Parameters
credit_cardobject
Show Child Parameters
planobject
Show Child Parameters
itemsarray[object]
Show Child Parameters
patch/subscriptions/{subscription_id}/billing-date

Body

{ "next_billing_at": "2020-04-03" }
 
application/json

Editar metadados da assinatura

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

patch
https://api.stone.com.br/core/v5/subscriptions/{subscription_id}/metadata

Path Parameters

subscription_idstringrequired

Código da assinatura.
Formato: sub_XXXXXXXXXXXXXXXX.

Body

application/json
metadatastringrequired

Objeto chave/valor utilizado para armazenar informações adicionais sobre a assinatura.
Saiba mais sobre metadata

Response

application/json

200

idstring

Example:sub_yOkq7oI03S7Wq741

codestring

Example:V9OMHENIK6

start_atstring

Example:2017-08-10T00:00:00Z

intervalstring

Example:month

interval_countinteger

Default:0

Example:1

billing_typestring

Example:postpaid

gateway_affiliation_idstring

Example:C56A4180-65AA-42EC-A945-5FD21DEC0538

boleto_due_daysinteger

Default:0

Example:5

minimum_priceinteger

Default:0

Example:10000

current_cycleobject
Show Child Parameters
setupobject
Show Child Parameters
next_billing_atstring

Example:2017-09-10T00:00:00Z

payment_methodstring

Example:credit_card

currencystring

Example:BRL

statement_descriptorstring

Example:Spotify

installmentsinteger

Default:0

Example:1

statusstring

Example:active

created_atstring

Example:2017-08-10T21:27:13Z

updated_atstring

Example:2017-08-10T21:27:29Z

customerobject
Show Child Parameters
cardobject
Show Child Parameters
planobject
Show Child Parameters
itemsarray[object]
Show Child Parameters
metadataobject
Show Child Parameters
patch/subscriptions/{subscription_id}/metadata

Body

{ "metadata": { "code": "1234", "company": "Avengers" } }
 
application/json

Editar afiliação da assinatura no gateway

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

patch
https://api.stone.com.br/core/v5/subscriptions/{subscription_id}/gateway-affiliation-id

Path Parameters

subscription_idstringrequired

Código da assinatura.
Formato: sub_XXXXXXXXXXXXXXXX.

Body

application/json
gateway_affiliation_idstringrequired

Código da afiliação no gateway.

Response

application/json

200

idstring

Example:sub_lmxK4k0hPfJ5z58w

codestring

Example:9X8HROC4E0

start_atstring

Example:2017-04-03T00:00:00Z

intervalstring

Example:month

interval_countinteger

Default:0

Example:1

billing_typestring

Example:prepaid

gateway_affiliation_idstring

Example:C56A4180-65AA-42EC-A945-5FD21DEC0538

boleto_due_daysinteger

Default:0

Example:5

minimum_priceinteger

Default:0

Example:10000

current_cycleobject
Show Child Parameters
next_billing_atstring

Example:2017-04-05T00:00:00Z

payment_methodstring

Example:credit_card

currencystring

Example:BRL

statement_descriptorstring

Example:Spotify

installmentsinteger

Default:0

Example:1

statusstring

Example:active

created_atstring

Example:2017-04-03T19:04:24Z

updated_atstring

Example:2017-04-03T19:04:24Z

customerobject
Show Child Parameters
credit_cardobject
Show Child Parameters
planobject
Show Child Parameters
itemsarray[object]
Show Child Parameters
patch/subscriptions/{subscription_id}/gateway-affiliation-id

Body

{ "gateway_affiliation_id": "C56A4180-65AA-42EC-A945-5FD21DEC0538" }
 
application/json