Webhook for recurring payments with Webpay OneClick

Kushki can send webhook events that notify your application when one of the following events occurs when trying to register recurring payment cards with the Webpay OneClick service:

  • The subscription of a card has been approved.
  • The subscription of a card has been rejected.
  • A card subscription is pending approval.

Structure

The webhooks sent by Kushki will contain the headers listed below.
These are the possible variables that are submitted in the webhook body:

Method: POST

Body: Object

VariableType
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

Examples

  • JSON
  • JSON
  • JSON
// Approved subscription
{
"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"
}
// Rejected subscription
{
"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"
}
// Subscription pending approval
{
"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"
}