Webhook para pagos recurrentes con Webpay OneClick

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

VariableTipo
amountobject
amount.subtotalIva0number
amount.ivanumber
amount.subtotalIvanumber
amount.icenumber
amount.currencystring
metadataobject
metadata.contractIDstring
creatednumber (Unix Timestamp Format)
ipstring
activeboolean
planNamestring
contactDetailsobject
contactDetails.firstNamestring
contactDetails.lastNamestring
contactDetails.phoneNumbernumber
contactDetails.documentTypestring
contactDetails.documentNumbernumber
contactDetails.emailstring
tokenstring
dayOfWeekstring
monthnumber
binInfoobject
binInfo.bankstring
binInfo.binnumber
binInfo.processorstring
binInfo.brandstring
dayOfMonthnumber
merchantIdnumber
providerstring
periodicitystring
subscriptionStatus"CONFIRMED" "DECLINED" "PENDING"
callbackUrlstring
idnumber
subscriptionIdnumber
startDatenumber
statusstring

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"
}