If a valid notificationUrl is previously sent in the request, the system will send notifications to this url when the payment status is changed.
Key2Pay makes POST request to notificationUrl parameter which includes your shop credentials (ApiKey
and SecretKey
) in Authorization Header Base64 encoded and a JSON body that contains information about the payment.
To avoid receiving wrong payments we recommend that you always check the credentials received.
Payment Notification Example
{
"uid": "pm_ZckjNjIuckOGP7R21CTQaA",
"status": "PAID",
"createdAt": "2023-11-14T11:23:28.293763Z",
"updatedStatusAt": "2023-11-14T11:23:28.297199Z",
"description": "Test",
"currency": "USD",
"amount": 100,
"language": "ES",
"orderId": "my-unique-order-id",
"notificationUrl": "https://notify.com",
"returnUrl": "https://mydomain.com/return",
"cancelUrl": "https://mydomain.com/cancel",
"customer": {
"personalId": "01889461288",
"address": "John Doe Address",
"city": "My City",
"country": "BR",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"phone": "432423444",
"postcode": "68950000",
"number": null,
"state": null,
"neighborhood": null,
"ip": "127.0.0.1"
},
"paymentMethod": {
"uid": "1000",
"name": "Pix",
"country": "BR",
"channel": "CASH"
},
"merchantDiscountRate": {
"fixed": 0,
"percentage": 2,
"rateDiscount": 2,
"minRateDiscount": 0,
"totalDiscount": 2,
"applyToCustomer": false
},
"voucherInfo": {
"amount": 510.65,
"currency": "BRL"
}
}