As assinaturas vão ter os status da tanto da assinatura quanto os status das transações. Segue um exemplo de notificação de assinatura:
json
{
"code": 200,
"data": [
{
"id": 1,
"type": "subscription",
"custom_id": null,
"status": {
"current": "new",
"previous": null
},
"identifiers": {
"subscription_id": 11976
},
"created_at": "2021-07-20 00:20:16"
},
{
"id": 2,
"type": "subscription_charge",
"custom_id": null,
"status": {
"current": "new",
"previous": null
},
"identifiers": {
"subscription_id": 11976,
"charge_id": 2396478
},
"created_at": "2021-07-20 00:20:16"
},
{
"id": 3,
"type": "subscription_charge",
"custom_id": null,
"status": {
"current": "waiting",
"previous": "new"
},
"identifiers": {
"subscription_id": 11976,
"charge_id": 2396478
},
"created_at": "2021-07-20 00:20:27"
},
{
"id": 4,
"type": "subscription",
"custom_id": null,
"status": {
"current": "active",
"previous": "new"
},
"identifiers": {
"subscription_id": 11976
},
"created_at": "2021-07-20 00:20:28"
},
{
"id": 5,
"type": "subscription_charge",
"custom_id": null,
"status": {
"current": "paid",
"previous": "waiting"
},
"identifiers": {
"subscription_id": 11976,
"charge_id": 2396478
},
"created_at": "2021-07-22 03:19:17",
"value": 12390,
"received_by_bank_at": "2022-03-28" // data do pagamento da cobrança
},
{
"id": 6,
"type": "subscription_charge",
"custom_id": null,
"status": {
"current": "new",
"previous": null
},
"identifiers": {
"subscription_id": 11976,
"charge_id": 2688053
},
"created_at": "2021-08-20 00:30:09"
},
{
"id": 7,
"type": "subscription_charge",
"custom_id": null,
"status": {
"current": "waiting",
"previous": "new"
},
"identifiers": {
"subscription_id": 11976,
"charge_id": 2688053
},
"created_at": "2021-08-20 00:30:09"
},
{
"id": 8,
"type": "subscription_charge",
"custom_id": null,
"status": {
"current": "unpaid",
"previous": "waiting"
},
"identifiers": {
"subscription_id": 11976,
"charge_id": 2688053
},
"created_at": "2021-08-25 01:32:38"
},
{
"id": 9,
"type": "subscription",
"custom_id": null,
"status": {
"current": "canceled",
"previous": "active"
},
"identifiers": {
"subscription_id": 11976
},
"created_at": "2021-08-28 23:26:58"
}
]
}
Você vai sempre verificar o
"type": "subscription", e o status da assinatura.
E quando for
"type": "subscription_charge", você verá o status de uma transação