Webhook para pagos recurrentes con Webpay OneClick
03 agosto 2023
Kushki puede enviar eventos webhook que notifican a tu aplicación cuando uno de los siguientes eventos ocurre al tratar de inscribir tarjetas para pagos recurrentes con el servicio de Webpay OneClick:
- La suscripción de una tarjeta ha sido aprobada.
- La suscripción de una tarjeta ha sido rechazada.
- La suscripción de una tarjeta está pendiente de aprobación.
Estructura
Los webhooks enviados por Kushki contendrán los encabezados (headers) aquí listados.
Estas son las posibles variables que se entregan en el cuerpo del webhook:
Método: POST
Body: Object
Variable | Tipo |
---|---|
amount | object |
amount.subtotalIva0 | number |
amount.iva | number |
amount.subtotalIva | number |
amount.ice | number |
amount.currency | string |
metadata | object |
metadata.contractID | string |
created | number (Unix Timestamp Format) |
ip | string |
active | boolean |
planName | string |
contactDetails | object |
contactDetails.firstName | string |
contactDetails.lastName | string |
contactDetails.phoneNumber | number |
contactDetails.documentType | string |
contactDetails.documentNumber | number |
contactDetails.email | string |
token | string |
dayOfWeek | string |
month | number |
binInfo | object |
binInfo.bank | string |
binInfo.bin | number |
binInfo.processor | string |
binInfo.brand | string |
dayOfMonth | number |
merchantId | number |
provider | string |
periodicity | string |
subscriptionStatus | "CONFIRMED" "DECLINED" "PENDING" |
callbackUrl | string |
id | number |
subscriptionId | number |
startDate | number |
status | string |
Ejemplos
- JSON
- JSON
- JSON
// Suscripción aprobada{"amount": {"subtotalIva0": 0,"iva": 0,"subtotalIva": 0,"ice": 0,"currency": "CLP"},"metadata": {"contractID": "157AB"},"created": 1631724854,"ip": "xxx.xxx.xxx.xxx","active": false,"planName": "Premium","contactDetails": {"firstName": "Diego","lastName": "Cadena","phoneNumber": "+593988734644","documentType": "{{doctype_cl}}","documentNumber": "1001001001","email": "xxxxxxxxx.xxxxx@hotmail.com"},"token": "11316ea1ab5fe24d5ad9310396bbdfe542ce809bc2229e88efa78b5fab7389aa","dayOfWeek": "-","month": "-","binInfo": {"bank": null,"bin": null,"processor": null,"brand": null},"dayOfMonth": 2,"merchantId": "20000000101167010000","provider": "transbankwebpay","periodicity": "custom","subscriptionStatus": "CONFIRMED","callbackUrl": "https://www.kushki.com","id": "163172484706300020000000101167010000","subscriptionId": "1631724847063000","startDate": 1631750400,"status": "subscriptionApproved"}
// Suscripción rechazada{"amount": {"subtotalIva0": 0,"iva": 0,"subtotalIva": 0,"ice": 0,"currency": "CLP"},"metadata": {"contractID": "157AB"},"created": 1631724854,"ip": "xx.xx.xx.xx","active": false,"planName": "Premium","contactDetails": {"firstName": "Diego","lastName": "Cadena","phoneNumber": "+593988734644","documentType": "{{doctype_cl}}","documentNumber": "1001001001","email": "xxxxxxxx.xxxxxxx@hotmail.com"},"token": "11316ea1ab5fe24d5ad9010396bbdfe542ce809bc2229e88efa78b5fab7389aa","dayOfWeek": "-","month": "-","binInfo": {"bank": null,"bin": null,"processor": null,"brand": null},"dayOfMonth": 2,"merchantId": "20000000101167010000","provider": "transbankwebpay","periodicity": "custom","subscriptionStatus": "DECLINED","callbackUrl": "https://www.kushki.com","id": "163172484706300020000000101167010000","subscriptionId": "1631724847063000","startDate": 1631750400,"status": "subscriptionDeclined"}
// Suscripción pendiente de aprobación{"amount": {"subtotalIva0": 0,"iva": 0,"subtotalIva": 0,"ice": 0,"currency": "CLP"},"metadata": {"contractID": "157AB"},"created": 1631724854,"ip": "xxx.xxx.xxx.xxx","active": false,"planName": "Premium","contactDetails": {"firstName": "Diego","lastName": "Cadena","phoneNumber": "+593988734644","documentType": "{{doctype_cl}}","documentNumber": "1001001001","email": "xxxxxxxxx.xxxxx@hotmail.com"},"token": "11316ea1ab5fe24d5ad9310396bbdfe542ce809bc2229e88efa78b5fab7389aa","dayOfWeek": "-","month": "-","binInfo": {"bank": null,"bin": null,"processor": null,"brand": null},"dayOfMonth": 2,"merchantId": "20000000101167010000","provider": "transbankwebpay","periodicity": "custom","subscriptionStatus": "PENDING","callbackUrl": "https://www.kushki.com","id": "163172484706300020000000101167010000","subscriptionId": "1631724847063000","startDate": 1631750400,"status": "subscriptionApproved"}