Webhook for Recurring Payments Made with Card

Kushki can send events via webhook notifying your application at the time when one of the following events occurs:

  1. When a charge is successfully made (succesfullCharge)
  2. When a scheduled subscription charge retry failed (failedRetry)
  3. When all the scheduled subscription charge retries have failed (lastRetry)
  4. When a charge of a on-demand subscription is declined (declinedCharge)
  5. When a subscription is removed (subscriptionDelete)

Structure

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

Method: POST

Body: Object

VariableType
eventObject
event.metadataObject
event.metadata.key0string
event.metadata.key1string
event.metadata.key2string
event.endDatenumber (Unix Timestamp Format)
event.maxCountnumber
event.contactDetailsObject
event.contactDetails.firstNamestring
event.contactDetails.lastNamestring
event.contactDetails.emailstring
event.contactDetails.phoneNumberstring
event.contactDetails.documentTypestring
event.contactDetails.documentNumberstring
event.lastFourDigitsstring
event.subscriptionStatusstring
event.activeboolean
event.dayOfMonthnumber
event.tokenstring
event.binInfoObject
event.binInfo.bankstring
event.binInfo.typestring
event.binInfo.processorstring
event.binInfo.brandstring
event.binInfo.binstring
event.startDatenumber (Unix Timestamp Format)
event.providerstring
event.idstring
event.credentialAliasstring
event.subscriptionIdstring
event.creatednumber (Unix Timestamp Format)
event.credentialMetadatastring
event.ipstring
event.lastChargeDatenumber
event.paymentBrandstring
event.callbackUrlstring
event.cardTypestring
event.periodicitystring
event.countnumber
event.retryConfigurationobject
event.retryConfiguration.retryTypestring
event.retryConfiguration.valuearray
event.retryConfiguration.value.itemsinteger
event.monthstring
event.planNamestring
event.dayOfWeekstring
event.amountObject
event.amount.subtotalIvanumber
event.amount.subtotalIva0number
event.amount.ivanumber
event.amount.icenumber
event.amount.currencystring
event.amount.extraTaxesObject
event.tbkUserstring
event.credentialIdstring
event.publicCredentialIdstring
event.merchantIdstring
event.transactionMetadataObject
event.transactionReferencestring
event.convertedAmountObject
event.convertedAmount.totalAmountnumber
event.convertedAmount.amountObject
event.convertedAmount.amount.subtotalIvanumber
event.convertedAmount.amount.subtotalIva0number
event.convertedAmount.amount.ivanumber
event.convertedAmount.amount.icenumber
event.convertedAmount.amount.currencystring
event.convertedAmount.amount.extraTaxesObject
event.approvalCodestring
event.binCardstring
event.issuingBankstring
event.recapstring
event.ticketNumberstring
event.retry.typeObject
event.retry.attemptsnumber
event.retry.maxnumber
event.retry.firstAttemptDatenumber
event.retry.periodicitynumber
event.retry.daysLeftarray
event.retry.daysLeft.itemsinteger
event.retryCountnumber
event.expirationTimenumber
event.cardHolderNamestring
event.adjustmentobject
event.adjustment.amountobject
event.adjustment.amount.subtotalIvanumber
event.adjustment.amount.subtotalIva0number
event.adjustment.amount.ivanumber
event.adjustment.amount.icenumber
event.adjustment.amount.currencystring
event.adjustment.amount.extraTaxesobject
event.adjustment.amount.extraTaxes.agenciaDeViajenumber
event.adjustment.amount.extraTaxes.iacnumber
event.adjustment.amount.extraTaxes.propinanumber
event.adjustment.amount.extraTaxes.tasaAeroportuarianumber
event.adjustment.periodsnumber
event.nextAttemptDaynumber
event.lastRetryDatenumber
event.urlstring
name"succesfullCharge" "failedRetry" "lastRetry" "declinedCharge" "subscriptionDelete"

Examples

  • JSON
  • JSON
  • JSON
  • JSON
// Approved Transaction
{
"event": {
"metadata": {
"plan_url": "https://kushki.com/plans",
"plan_id": 231
},
"endDate": 1661985469,
"maxCount": 9,
"contactDetails": {
"firstName": "John",
"lastName": β€œDoe”,
"phoneNumber": "+5673839304",
"documentType": "RUT",
"email": "johndoe@test.com",
"documentNumber": "873939409-0"
},
"lastFourDigits": "7323",
"subscriptionStatus": "CONFIRMED",
"active": true,
"dayOfMonth": 27,
"token": "9827224051ac9a7c486b1f76a4f98dfa4b0e0c59a89e335b7ff16eb6c29ae6c3",
"binInfo": {
"bank": null,
"processor": null,
"brand": null,
"bin": null
},
"startDate": 1648766269,
"provider": β€œtransbankwebpay”,
"id": "1921607340879500020003638739107324744000",
"credentialAlias": "TEST",
"subscriptionId": "20678807210795000",
"created": 1648766269,
"credentialMetadata": null,
"ip": "23.345.222.297",
"lastChargeDate": 1653650144,
"paymentBrand": "RedCompra",
"callbackUrl": "https://kushki.com",
"cardType": "debit",
"periodicity": "weekly",
"count": 1,
"retryConfiguration": {
"value": [
2
],
"retryType": "scheduled"
},
"month": "*",
"planName": "Plan hogar",
"dayOfWeek": "?",
"amount": {
"subtotalIva0": 0,
"iva": 0.19,
"subtotalIva": 1,
"ice": 0,
"currency": "UF"
},
"tbkUser": "838d76cb-809b-45b8-88c7-67ff1e6e381d",
"credentialId": "879f2002a31b445f883c3c389bbe6ce3",
"publicCredentialId": "01f4cm986b1149dba3dd3544f20798ac",
"merchantId": "9000107313762000",
"transactionMetadata": {},
"transactionReference": "e3338f6d-23d0-6383-21bf-9395ccd9ba23",
"convertedAmount": {
"totalAmount": 48819,
"amount": {
"subtotalIva0": 0,
"iva": 6198,
"subtotalIva": 42621,
"currency": "CLP"
},
"currency": "CLP"
},
"approvalCode": "002021",
"binCard": null,
"issuingBank": null,
"recap": null,
"retryCount": 1,
"ticketNumber": "383838350144339370"
},
"name": "succesfullCharge"
}
// Declined Transaction
{
"name": "declinedCharge",
"event": {
"userAgent": "Go-http-client/1.1",
"metadata": {
"plan": {
"fitness": {
"pool": "include",
"rumba": "include",
"cardio": "include"
}
}
},
"subscriptionId": "1602024884332000",
"created": 1602024884,
"ip": "35.193.164.95",
"contactDetails": {
"firstName": "Diego",
"lastName": "Cadena",
"phoneNumber": "+593988734644",
"documentType": "CC",
"documentNumber": "1009283738",
"email": "test@test.com"
},
"periodicity": "monthly",
"lastFourDigits": "7015",
"active": true,
"dayOfMonth": 6,
"token": "1637f3a2be6849cbbf2095693f7367c1",
"binInfo": {
"bank": "BANCO DE LA PRODUCCION S.A. (PRODUBANCO)",
"brand": "VISA",
"processor": "NA",
"bin": "434900",
"info": {
"country": {
"emoji": "πŸ‡ͺπŸ‡¨",
"latitude": -2,
"alpha2": "EC",
"name": "Ecuador",
"numeric": "218",
"currency": "USD",
"longitude": -77.5
},
"number": {
"length": 16,
"luhn": true
},
"bank": {
"name": "BANCO DE LA PRODUCCION,S.A. (PRODUBANCO)"
},
"scheme": "visa",
"prepaid": false,
"type": "CREDIT",
"brand": "Traditional"
}
},
"cardHolderName": "Pruebas",
"maskedCardNumber": "434900XXXXXX7015",
"planName": "Premium",
"month": "*",
"dayOfWeek": "?",
"startDate": 1601942400,
"amount": {
"currency": "USD",
"ice": 0,
"subtotalIva0": 0,
"iva": 0.14,
"subtotalIva": 1
},
"plccMetadataId": "baae19a29bc64382b1cbdfd374cfaba6",
"id": "160202488433200020000000XXXXXXXX2000",
"merchantId": "20000000XXXXXXXX2000",
"transactionReference": "4eeec12b-6554-469e-87b8-a432ab9c3106"
}
}
// Unsuccessful collection attempt
{
"name": "failedRetry",
"event": {
"userAgent": "Go-http-client/1.1",
"metadata": {
"plan": {
"fitness": {
"pool": "include",
"rumba": "include",
"cardio": "include"
}
}
},
"subscriptionId": "1602024884332000",
"created": 1602024884,
"ip": "35.193.164.95",
"contactDetails": {
"firstName": "Diego",
"lastName": "Cadena",
"phoneNumber": "+593988734644",
"documentType": "CC",
"documentNumber": "1009283738",
"email": "test@test.com"
},
"periodicity": "monthly",
"lastFourDigits": "7015",
"active": true,
"dayOfMonth": 6,
"token": "1637f3a2be6849cbbf2095693f7367c1",
"binInfo": {
"bank": "BANCO DE LA PRODUCCION S.A. (PRODUBANCO)",
"brand": "VISA",
"processor": "NA",
"bin": "434900",
"info": {
"country": {
"emoji": "πŸ‡ͺπŸ‡¨",
"latitude": -2,
"alpha2": "EC",
"name": "Ecuador",
"numeric": "218",
"currency": "USD",
"longitude": -77.5
},
"number": {
"length": 16,
"luhn": true
},
"bank": {
"name": "BANCO DE LA PRODUCCION,S.A. (PRODUBANCO)"
},
"scheme": "visa",
"prepaid": false,
"type": "CREDIT",
"brand": "Traditional"
}
},
"cardHolderName": "Pruebas",
"maskedCardNumber": "434900XXXXXX7015",
"planName": "Premium",
"month": "*",
"dayOfWeek": "?",
"startDate": 1601942400,
"amount": {
"currency": "USD",
"ice": 0,
"subtotalIva0": 0,
"iva": 0.14,
"subtotalIva": 1
},
"plccMetadataId": "baae19a29bc64382b1cbdfd374cfaba6",
"id": "160202411352100020000000XXXXXXXX2000m",
"merchantId": "20000000XXXXXXXX2000",
"transactionReference": "9b85ba91-1a97-4964-bf6a-472a9b0cb813"
}
}
// Subscription Deleted
{
"name": "subscriptionDelete",
"event": {
"amount": {
"subtotalIva0": 0,
"iva": 0.14,
"subtotalIva": 1,
"currency": "USD",
"ice": 0
},
"metadata": {
"plan": {
"fitness": {
"rumba": "include",
"pool": "include",
"cardio": "include"
}
}
},
"cardHolderName": "Pruebas",
"deleteAt": 1602024462,
"created": 1602024113,
"plccMetadataId": "187169a42eed456a9964dab5e7ec9468",
"ip": "35.193.164.95",
"active": false,
"planName": "Premium",
"userAgent": "Go-http-client/1.1",
"contactDetails": {
"firstName": "Diego",
"lastName": "Cadena",
"phoneNumber": "+593988734644",
"documentType": "CC",
"documentNumber": "1009283738",
"email": "test@test.com"
},
"lastChargeDate": 1602024176,
"maskedCardNumber": "424242XXXXXX4242",
"token": "da44953475f74c02abca31c5371e1792",
"dayOfWeek": "?",
"month": "*",
"binInfo": {
"bank": null,
"bin": "424242",
"brand": "VISA",
"processor": "NA",
"info": {
"country": {
"emoji": "πŸ‡ΊπŸ‡Έ",
"latitude": 38,
"alpha2": "US",
"name": "United States of America",
"numeric": "840",
"currency": "USD",
"longitude": -97
},
"number": {},
"bank": {},
"scheme": "visa",
"type": "credit"
}
},
"dayOfMonth": 6,
"lastFourDigits": "4242",
"merchantId": "20000000XXXXXXXX2000",
"periodicity": "monthly",
"id": "160202411352100020000000XXXXXXXX2000m",
"subscriptionId": "1602024113521000",
"startDate": 1601942400
}
}