Webhook for recurring payments with Webpay OneClick
August 03, 2023
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
Variable | Type |
---|---|
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 |
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"}