Webhook for Recurring Payments Made with Card

Kushki can send events to your 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
name"succesfullCharge" "failedRetry" "lastRetry" "declinedCharge" "subscriptionDelete"
eventObject
event.idstring
event.metadataObject
event.metadata.key0string
event.metadata.key1string
event.metadata.key2string
event.subscriptionIdnumber
event.cardHolderNamestring
event.amountObject
event.amount.subtotalIvanumber
event.amount.subtotalIva0number
event.amount.ivanumber
event.amount.icenumber
event.amount.currencystring
event.amount.extraTaxesObject
event.amount.extraTaxes.agenciaDeViajenumber
event.amount.extraTaxes.iacnumber
event.amount.extraTaxes.propinanumber
event.amount.extraTaxes.tasaAeroportuarianumber
event.periodicitystring
event.contactDetailsObject
event.contactDetails.firstNamestring
event.contactDetails.lastNamestring
event.contactDetails.emailstring
event.tokenstring
event.merchantIdstring
event.startDatenumber (Unix Timestamp Format)
event.endDatenumber (Unix Timestamp Format)
event.creatednumber (Unix Timestamp Format)
event.planNamestring
event.binInfoObject
event.binInfo.bankstring
event.binInfo.typestring
event.binInfo.processorstring
event.binInfo.brandstring
event.dayOfMonthnumber
event.monthstring
event.dayOfWeekstring
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.activeboolean
event.lastFourDigitsstring
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.retryConfigurationobject
event.retryConfiguration.retryTypestring
event.retryConfiguration.valuearray
event.retryConfiguration.value.itemsinteger
event.nextAttemptDaynumber
event.lastRetryDatenumber
event.urlstring
event.approvalCodestring
event.ticketNumberstring
event.lastChargeDatenumber

Examples

  • JSON
  • JSON
  • JSON
  • JSON
// Approved Transaction
{
"name": "succesfullCharge",
"event": {
"userAgent": "Go-http-client/1.1",
"metadata": {
"plan": {
"fitness": {
"pool": "include",
"rumba": "include",
"cardio": "include"
}
}
},
"subscriptionId": "1602024113521000",
"created": 1602024113,
"ip": "35.193.164.95",
"lastChargeDate": 1602024176,
"contactDetails": {
"firstName": "Diego",
"lastName": "Cadena",
"phoneNumber": "+593988734644",
"documentType": "CC",
"documentNumber": "1009283738",
"email": "test@test.com"
},
"periodicity": "monthly",
"lastFourDigits": "4242",
"active": true,
"dayOfMonth": 6,
"token": "da44953475f74c02abca31c5371e1792",
"binInfo": {
"bank": null,
"brand": "VISA",
"processor": "NA",
"bin": "424242",
"info": {
"country": {
"emoji": "πŸ‡ΊπŸ‡Έ",
"latitude": 38,
"alpha2": "US",
"name": "United States of America",
"numeric": "840",
"currency": "USD",
"longitude": -97
},
"number": {},
"bank": {},
"scheme": "visa",
"type": "credit"
}
},
"cardHolderName": "Pruebas",
"maskedCardNumber": "424242XXXXXX4242",
"month": "*",
"planName": "Premium",
"dayOfWeek": "?",
"startDate": 1601942400,
"amount": {
"currency": "USD",
"ice": 0,
"subtotalIva0": 0,
"iva": 0.14,
"subtotalIva": 1
},
"id": "160202411352100020000000XXXXXXXX2000",
"plccMetadataId": "187169a42eed456a9964dab5e7ec9468",
"merchantId": "20000000XXXXXXXX2000",
"transactionReference": "9eb4ec3d-5e83-4450-8d90-5047121bddbf",
"approvalCode": "000000",
"binCard": "424242",
"issuingBank": null,
"ticketNumber": "646245907500066871"
}
}
// 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
}
}