Eventos
Ao criar uma transação, você pode definir uma URL no campo postbackUrl para receber notificações sobre atualizações da transação em seu servidor. Os eventos serão enviados para essa URL no seguinte formato de payload:
{
"id": 987654,
"type": "transaction",
"objectId": "567",
"url": "https://example.com",
"data": {
"id": 567,
"amount": 25000,
"refundedAmount": 5000,
"installments": 6,
"paymentMethod": "pix",
"status": "pending",
"postbackUrl": "https://webhook.site/example",
"metadata": null,
"traceable": true,
"secureId": "b1234567-cd89-4fgh-90jk-5lm6789nopqr",
"secureUrl": "https://link.pay2w.com/b1234567-cd89-4fgh-90jk-5lm6789nopqr",
"createdAt": "2024-02-10T14:30:00.000Z",
"updatedAt": "2024-02-11T10:15:30.000Z",
"paidAt": null,
"ip": "192.168.1.100",
"externalRef": "EXT987654",
"customer": {
"id": 12,
"externalRef": "CUST12345",
"name": "Mariana Souza",
"email": "[email protected]",
"phone": "11987654321",
"birthdate": "1992-03-15",
"createdAt": "2023-11-20T08:45:00.000Z",
"document": {
"number": "98765432100",
"type": "cpf"
},
"address": {
"street": "Avenida Paulista",
"streetNumber": "1500",
"complement": "Apto 1203",
"zipCode": "01311000",
"neighborhood": "Bela Vista",
"city": "São Paulo",
"state": "SP",
"country": "BR"
}
},
"card": null,
"pix": {
"qrCode": "00020101021226830014BR.GOV.BCB.PIX0114+55119876543215204000053039865802BR5913MARIANA SOUZA6009SAO PAULO62070503***63041D3B",
"expirationDate": "2024-02-12T23:59:59.000Z"
},
"shipping": {
"method": "express",
"cost": 1500,
"estimatedDeliveryDate": "2024-02-15"
},
"refusedReason": null,
"items": [
{
"externalRef": "PROD001",
"title": "Smartphone XYZ",
"unitPrice": 25000,
"quantity": 1,
"tangible": true
}
],
"refunds": [
{
"amount": 5000,
"reason": "customer request",
"createdAt": "2024-02-11T09:00:00.000Z"
}
],
"delivery": {
"status": "shipped",
"trackingCode": "TRK987654321",
"carrier": "Correios",
"estimatedDelivery": "2024-02-15"
},
"fee": {
"fixedAmount": 500,
"spreadPercentage": 3,
"estimatedFee": 1000,
"netAmount": 23000
}
}
}