Ao criar uma transação, você pode passar uma URL para receber eventos em seu servidor quando uma transação for atualizada, através do campo postbackUrl. O formato do payload que você receberá nessa URL segue o formato abaixo:
Transação
{
"id": 243,
"type": "transaction",
"objectId": "637",
"url": "https://sua-api.com.br/webhooks",
"data": {
"id": 637,
"paymentMethod": "credit_card",
"installments": 1,
"amount": 1000,
"status": "refunded",
"acquirerType": "getnet",
"externalId": "e2758740-6a76-4741-b9df-a4afee7ffd42",
"postbackUrl": "https://sua-api.com.br/webhooks",
"secureId": "bbabfe1f-b594-4089-8e00-ec2eb3af5df0",
"secureUrl": "https://link.sandbox.001pay.com.br/pagar/bbabfe1f-b594-4089-8e00-ec2eb3af5df0",
"createdAt": "2022-01-19T20:03:45.000Z",
"updatedAt": "2022-01-19T20:03:45.000Z",
"items": [
{
"title": "Camiseta Branca",
"quantity": 1,
"tangible": true,
"unitPrice": 990,
"externalRef": null
}
],
"customer": {
"id": 27,
"name": "Barry Allen",
"email": "[email protected]",
"phone": "11999999999",
"address": {
"id": 825,
"city": "São Paulo",
"state": "SP",
"street": "Avenida Paulista",
"country": "br",
"zipCode": "01311941",
"complement": null,
"neighborhood": "Bela Vista",
"streetNumber": "807"
},
"revenue": {
"pixCount": 0,
"cardCount": 35,
"createdAt": "2021-12-31T04:45:28.000Z",
"pixAmount": 0,
"cardAmount": 71577,
"totalCount": 35,
"boletoCount": 0,
"refundCount": 10,
"totalAmount": 71577,
"boletoAmount": 0,
"refundAmount": 34057,
"chargebackCount": 0,
"chargebackAmount": 0
},
"document": {
"id": 72,
"type": "cpf",
"number": "12345678901"
},
"birthdate": null,
"createdAt": "2021-12-31T04:45:29.000Z",
"externalRef": null,
"acquirersKeys": {
"id": 68,
"iugu": null,
"moip": null,
"getnet": null,
"pagarme": null,
"mundi_pagarme": null
}
},
"shipping": {
"id": 350,
"fee": 0,
"address": {
"id": 826,
"city": "São Paulo",
"state": "SP",
"street": "Avenida Paulista",
"country": "br",
"zipCode": "01311941",
"complement": null,
"neighborhood": "Bela Vista",
"streetNumber": "807"
}
},
"card": {
"id": 133,
"brand": "mastercard",
"createdAt": "2022-01-17T19:47:21.000Z",
"holderName": "BARRY ALLEN",
"lastDigits": "0001",
"acquirerType": "getnet",
"expirationDate": "03/28"
},
"pix": null,
"boleto": null,
"fee": {
"fixedAmount": 202,
"estimatedFee": 237,
"estimatedProfit": 763,
"spreadPercentage": 3.5
},
"ip": null,
"refunds": [
{
"amount": 1000,
"createdAt": "2022-01-19T20:04:10.000Z"
}
],
"sendEmail": false,
"traceable": false,
"delivery": null,
"metadata": null,
"billingId": null,
"companyId": 34,
"refusedReason": null,
"subscriptionId": null
}
}
Checkout
{
"id": 270,
"type": "checkout",
"objectId": "13",
"url": "https://suaapi.com.br",
"data": {
"id": 13,
"amount": 5000,
"secureId": "82da9cff-32e3-42b4-a883-fa13c9a3a81f",
"secureUrl": "https://link.sandbox.001pay.com.br/checkout/82da9cff-32e3-42b4-a883-fa13c9a3a81f",
"items": [
{
"title": "Sanduíche",
"quantity": 3,
"tangible": true,
"unitPrice": 1300,
"externalRef": null
},
{
"title": "Coca-Cola 350ml",
"quantity": 2,
"tangible": true,
"unitPrice": 550,
"externalRef": null
}
],
"settings": {
"pix": {
"enabled": true,
"expiresInDays": 2
},
"card": {
"enabled": true,
"maxInstallments": 3,
"freeInstallments": 1
},
"boleto": {
"enabled": false,
"expiresInDays": 2
},
"traceable": false,
"requestPhone": false,
"requestAddress": false,
"requestDocument": false,
"defaultPaymentMethod": "credit_card"
},
"companyId": 67,
"createdAt": "2022-03-12T03:36:50.000Z",
"description": null,
"postbackUrl": "https://suaapi.com.br",
"transaction": {
"id": 805,
"amount": 5000,
"paymentMethod": "pix",
"status": "waiting_payment",
"installments": 1,
"metadata": null,
"secureId": "677688c8-2c7e-489d-9db8-ad2662514fec",
"secureUrl": "https://link.sandbox.001pay.com.br/pagar/677688c8-2c7e-489d-9db8-ad2662514fec",
"checkoutId": 13,
"tenantId": 29,
"billingId": null,
"companyId": 67,
"createdAt": "2022-03-12T03:37:11.000Z",
"sendEmail": true,
"traceable": false,
"updatedAt": "2022-03-12T03:37:11.000Z",
"externalId": "16388150",
"postbackUrl": null,
"acquirerType": "pagarme",
"acquirerStatus": "waiting_payment",
"subscriptionId": null,
"ip": null
}
}
}