Notificação desubscription
subscription
Em seguida, há um exemplo de Webhook que seria enviado no caso de um evento de pagamento recorrente. Os eventos podem variar. Para entender que eventos disparam notificações, acesse a página: Eventos de webhook
{
"env": "qa",
"event": "subscription.initial | .updated | .suspended | .activated | .recurrence | .expired | .canceled | .migrated",
"resource": {
"amount": {
"currency": "BRL",
"value": 10000
},
"coupon": {
"discount": {
"type": "PERCENT",
"value": 10000
},
"id": "COUP_FA8BE965-9264-443A-A148-38C70478A1C6"
},
"created_at": "2022-06-20T18:06:43.275-03:00",
"customer": {
"email": "[email protected]",
"id": "CUST_5226051F-77F5-4CF2-AAC0-F57F2A8582D2",
"name": "Bruno Silva"
},
"exp_at": "2030-09-20",
"id": "SUBS_5AAE1F81-29D3-41BC-F043-4BC69BA85D1C",
"next_invoice_at": "2022-07-20",
"payment_method": [
{
"card": {
"brand": "visa",
"exp_month": "11",
"exp_year": "2034",
"first_digits": "411111",
"holder": {
"name": "Bruno Silva"
},
"last_digits": "1111",
"token": "TOKE_EC40****************************77D0"
},
"type": "CREDIT_CARD"
}
],
"plan": {
"id": "PLAN_9DB0D197-137F-4BC4-BECB-C93EB226F34B",
"name": "Plano Teste"
},
"pro_rata": false,
"reference_id": "subscription-g",
"status": "OVERDUE",
"updated_at": "2022-06-20T18:06:44.809-03:00"
},
"links": [
{
"href": "https://sandbox.api.assinaturas.pagseguro.com/subscriptions",
"media": "application/json",
"rel": "SELF",
"type": "GET"
},
{
"href": "https://sandbox.api.assinaturas.pagseguro.com/subscriptions/SUBS_5AAE1F81-29D3-41BC-F043-4BC69BA85D1C",
"media": "application/json",
"rel": "SELF",
"type": "GET"
},
{
"href": "https://sandbox.api.assinaturas.pagseguro.com/subscriptions/SUBS_5AAE1F81-29D3-41BC-F043-4BC69BA85D1C/suspend",
"media": "application/json",
"rel": "SELF",
"type": "PUT"
},
{
"href": "https://sandbox.api.assinaturas.pagseguro.com/subscriptions/SUBS_5AAE1F81-29D3-41BC-F043-4BC69BA85D1C/cancel",
"media": "application/json",
"rel": "SELF",
"type": "PUT"
},
{
"href": "https://sandbox.api.assinaturas.pagseguro.com/subscriptions/SUBS_5AAE1F81-29D3-41BC-F043-4BC69BA85D1C/activate",
"media": "application/json",
"rel": "SELF",
"type": "PUT"
},
{
"href": "https://sandbox.api.assinaturas.pagseguro.com/subscriptions/SUBS_5AAE1F81-29D3-41BC-F043-4BC69BA85D1C",
"media": "application/json",
"rel": "SELF",
"type": "PUT"
},
{
"href": "https://sandbox.api.assinaturas.pagseguro.com/subscriptions/SUBS_5AAE1F81-29D3-41BC-F043-4BC69BA85D1C/coupons",
"media": "application/json",
"rel": "SELF",
"type": "DELETE"
},
{
"href": "https://sandbox.api.assinaturas.pagseguro.com/subscriptions/SUBS_5AAE1F81-29D3-41BC-F043-4BC69BA85D1C/invoices",
"media": "application/json",
"rel": "INVOICE",
"type": "GET"
},
{
"rel": "INVOICES.LAST",
"href": "http://sandbox.api.assinaturas.pagseguro.com/invoices/INVO_24AE3E79-809B-42C4-8A9F-3F7603B39BBC",
"media": "application/json",
"type": "GET"
}
]
}