Cancel a subscription without a fee; a canceled one is answered as it is
POST /v1/subscriptions/{id}/cancel
Cancel a subscription without a fee; a canceled one is answered as it is
POST/v1/subscriptions/{id}/cancel
Autenticação
- Chave secretask_…, só no seu servidor
Envie a chave no cabeçalho Authorization: Bearer <chave>.
Parâmetros
idstring · pathobrigatório`sub_<uuid>`.
Resposta
200OK
idstringobrigatório`sub_` + the id of the charge that opened it.
objectstringobrigatórioValores:
subscriptionstatusstringobrigatórioValores:
pendingprocessingactivepast_duecanceledfinishedchargestring (uuid)obrigatórioThe charge that opened it, readable at `GET /v1/charges/{id}`.
payment_methodstringpode ser nullobrigatórioValores:
cardpixboletoamountintegerpode ser nullobrigatórioInteger cents of the next charge, net of any discount; only while `active`.
interval_daysintegerpode ser nullobrigatóriocurrent_period_endstringpode ser nullobrigatórioDue date of the next charge; only while `active`.
canceled_atstringpode ser nullobrigatórioISO 8601, UTC.
Erros
| 400 | The request path could not be decoded (`malformed_path`). |
| 401 | Missing or invalid key, or a public key (`secret_key_required`). |
| 404 | Not found, not yours, declined, or not a well-formed id (`subscription_not_found`). |
| 409 | It cannot be canceled (`subscription_not_cancelable`), or a cancellation fee is being charged (`cancellation_pending`). |
| 422 | A body was sent (`unknown_parameter`). |
| 429 | Rate limited. |
| 500 | Unexpected error, or `api_unavailable`. |
| 503 | The subscription could not be reached right now (`api_unavailable`); retry. |
Todo erro vem no mesmo envelope: error.type, error.code, error.message e error.request_id, também devolvido no cabeçalho X-Request-Id.