Webhook para pagos recurrentes con transferencia bancaria

Kushki puede enviar eventos webhook que notifican a tú aplicación en cualquier momento que uno de los siguientes eventos ocurra:

  • Cuando se aprueba o rechaza una transacción con tarjeta de crédito o débito
  • Cuando una anulación o reembolso de tarjeta es aprobado

Verificación de la Suscripción

Éstas son las posibles variables que se entregan en el cuerpo del webhook.

Métodod: Post

Body: Object

VariableTipo
name"subscription"
eventobject
event.idstring
event.metadataobject
event.metadata.key0string
event.metadata.key1string
event.metadata.key2string
event.subscriptionIdnumber
event.maskedAccountNumberstring
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.contactDetails.documentTypestring
event.contactDetails.documentNumberstring
event.contactDetails.phoneNumerstring
event.tokenstring
event.merchantIdstring
event.startDatenumber (Unix Timestamp Format)
event.endDatenumber (Unix Timestamp Format)
event.creatednumber (Unix Timestamp Format)
event.planNamestring
event.tokenInfoobject
event.tokenInfo.namestring
event.tokenInfo.bankCodestring
event.tokenInfo.lastNamestring
event.tokenInfo.bankNamestring
event.tokenInfo.documentTypestring
event.tokenInfo.documentNumberstring
event.dayOfMonthnumber
event.monthstring
event.dayOfWeekstring
event.activeboolean
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.event.adjustment.amount.periodsnumber
event.urlstring
event.totalAmountnumber
event.accountNumberstring
event.accountTypestring
event.bancoBogotaId.string
event.merchantNamestring
event.processorNamestring
event.publicProcessorIdstring
event.privateProcessorIdstring
event.languagestring
event.sentToWebhookboolean
event.subscriptionStatus"VERIFIED" "DECLINED"

Ejemplos

  • JSON
  • JSON
// Suscripción verificada
{
"name": "subscription",
"event": {
"country": "Colombia",
"metadata": {
"key1": "value1",
"key2": "value2",
"key0": "value0"
},
"endDate": 1664409600000,
"sentToWebhook": false,
"planName": "Premium",
"language": "es",
"merchantName": "Tu Gran Empresa",
"dayOfWeek": "?",
"merchantId": "20000000XXXXXXX2000",
"subscriptionStatus": "VERIFIED",
"processorName": "Banco Bogota Transfer Processor",
"id": "160208335728362220000000XXXXXXX2000",
"publicProcessorId": "600000000016020000000XXXXXXX78",
"amount": {
"subtotalIva0": 1000,
"iva": 0,
"subtotalIva": 0,
"currency": "COP"
},
"created": 1602083357284,
"accountType": "01",
"active": true,
"accountNumber": "1234567890",
"contactDetails": {
"firstName": "Diego",
"lastName": "Cadena",
"documentType": "CC",
"documentNumber": "3664565777",
"phoneNumer": "0987465344",
"email": "[email protected]"
},
"maskedAccountNumber": "XXXXXXXX7890",
"tokenInfo": {
"bankCode": "1",
"lastName": "Cadena",
"documentType": "CC",
"documentNumber": "123456789",
"name": "Diego",
"bankName": "BANCO DE BOGOTA"
},
"url": null,
"token": "dc77f21688b04fb1bf01dcc3a9892ec7",
"totalAmount": 1000,
"month": "*",
"dayOfMonth": 7,
"periodicity": "Mensual",
"subscriptionId": "1602083357283622",
"bancoBogotaId": "2083357284",
"startDate": 1602028800000,
"privateProcessorId": "600000000016020000000XXXXXXX"
}
}
// Suscripción declinada
{
"event": {
"country": "Colombia",
"metadata": {
"key1": "value1",
"key2": "value2",
"key0": "value0"
},
"endDate": 1664409600000,
"sentToWebhook": false,
"planName": "Premium",
"language": "es",
"merchantName": "Tu Gran Empresa",
"dayOfWeek": "?",
"merchantId": "20000000XXXXXXX2000",
"subscriptionStatus": "DECLINED",
"processorName": "Banco Bogota Transfer Processor",
"id": "160208545228711820000000XXXXXXX2000",
"publicProcessorId": "600000000016020000000XXXXXXX78",
"amount": {
"subtotalIva0": 1000,
"iva": 0,
"subtotalIva": 0,
"currency": "COP"
},
"created": 1602085452288,
"accountType": "01",
"active": true,
"accountNumber": "123456789",
"contactDetails": {
"firstName": "Bryan",
"lastName": "Lema",
"documentType": "CC",
"documentNumber": "3664565777",
"phoneNumer": "0987465344",
"email": "[email protected]"
},
"maskedAccountNumber": "XXXXXXXX6789",
"tokenInfo": {
"bankCode": "1",
"lastName": "Lema",
"documentType": "CC",
"documentNumber": "100000002",
"name": "Bryan",
"bankName": "BANCO DE BOGOTA"
},
"url": null,
"token": "41614da06f164e18ad9cc23aec846e08",
"totalAmount": 1000,
"month": "*",
"dayOfMonth": 7,
"periodicity": "Mensual",
"subscriptionId": "1602085452287118",
"bancoBogotaId": "2085452288",
"startDate": 1602028800000,
"privateProcessorId": "600000000016020000000XXXXXXX"
},
"name": "subscription"
}

Notificación de Pago

Éstas son las posibles variables que se entregan en el cuerpo del webhook.

Métodod: Post

Body: Object

VariableTipo
name"transaction"
eventobject
event.idstring
event.subscriptionMetadataobject
event.subscriptionMetadata.key0string
event.subscriptionMetadata.key1string
event.subscriptionMetadata.key2string
event.subscriptionIdnumber
event.maskedAccountNumberstring
event.string
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.periodicity
event.contactDetailsobject
event.contactDetails.firstNamestring“
event.contactDetails.lastNamestring
event.contactDetails.emailstring
event.contactDetails.documentTypestring
event.contactDetails.documentNumberstring
event.contactDetails.phoneNumerstring
event.merchantIdstring
event.creatednumber (Timestamp format)
event.totalAmountnumber
event.bancoBogotaIdstring
event.merchantNamestring
event.publicProcessorIdstring
event.privateProcessorIdstring
event.sentToWebhookboolean
event.transactionStatus"APPROVED" "DECLINED"
event.paymentMethodstring
event.currencyCodestring
event.paymentBrandstring
event.bankNamestring
event.transactionTypestring
event.approvalCodestring
event.responseCodestring
event.requestAmountnumber
event.subtotalIva0number
event.subtotalIvanumber
event.ivaValuenumber
event.responseTextstring
event.subscriptionTriggerstring
event.ticketNumberstring

Ejemplos

  • JSON
  • JSON
// Transacción aprobada
{
"name": "transaction",
"event": {
"country": "Colombia",
"ticketNumber": "551602083994076",
"approvalCode": "000000",
"subtotalIva0": 1000,
"processorType": "gateway",
"responseText": "Transacción aprobada",
"sentToWebhook": false,
"bankName": "BANCO DE BOGOTA",
"subscriptionTrigger": "onDemand",
"requestAmount": 1000,
"merchantName": "Tu Gran Empresa",
"responseCode": "000",
"processorId": "600000000016020000000XXXXXXX78",
"merchantId": "20000000XXXXXXX2000",
"ivaValue": 0,
"subscriptionMetadata": {
"key1": "value1",
"key2": "value2",
"key0": "value0"
},
"processorName": "Banco Bogota Transfer Processor",
"id": "cdf7542d-e1b2-43bf-8690-909911edd36e",
"amount": {
"subtotalIva0": 1000,
"iva": 0,
"subtotalIva": 0,
"extraTaxes": {
"agenciaDeViaje": 0,
"iac": 0,
"propina": 0,
"tasaAeroportuaria": 0
},
"currency": "COP",
"ice": 0
},
"transactionStatus": "APPROVAL",
"created": 1602083994074,
"paymentBrand": "BancoBogota",
"subtotalIva": 1000,
"accountOwner": "Bryan Lema",
"contactDetails": {
"firstName": "Bryan",
"lastName": "Lema",
"documentType": "CC",
"documentNumber": "3664565777",
"phoneNumer": "0987465344",
"email": "[email protected]"
},
"maskedAccountNumber": "123xxxxxx890",
"transactionType": "SALE",
"paymentMethod": "Transfer",
"subscriptionId": "1602083357283622",
"currencyCode": "COP",
"bancoBogotaId": "2083994074",
"privateProcessorId": "600000000016020000000XXXXXXX",
"transactionReference": "cdf7542d-e1b2-43bf-8690-909911edd36e"
}
}
// Transacción declinada
{
"name": "transaction",
"event": {
"country": "Colombia",
"ticketNumber": "551602085976659",
"approvalCode": "000000",
"subtotalIva0": 3999,
"processorType": "gateway",
"responseText": "Transacción aprobada",
"sentToWebhook": false,
"bankName": "BANCO DE BOGOTA",
"subscriptionTrigger": "onDemand",
"requestAmount": 3999,
"merchantName": "Tu Gran Empresa",
"responseCode": "000",
"processorId": "600000000016020000000XXXXXXX78",
"merchantId": "20000000XXXXXXX2000",
"ivaValue": 0,
"subscriptionMetadata": {
"key1": "value1",
"key2": "value2",
"key0": "value0"
},
"processorName": "Banco Bogota Transfer Processor",
"id": "5c4d73a7-c2a0-40ba-959d-7f0175915346",
"amount": {
"subtotalIva0": 3999,
"iva": 0,
"subtotalIva": 0,
"extraTaxes": {
"agenciaDeViaje": 0,
"iac": 0,
"propina": 0,
"tasaAeroportuaria": 0
},
"currency": "COP",
"ice": 0
},
"transactionStatus": "DECLINED",
"created": 1602085976659,
"paymentBrand": "BancoBogota",
"subtotalIva": 3999,
"accountOwner": "Bryan Lema",
"contactDetails": {
"firstName": "Bryan",
"lastName": "Lema",
"documentType": "CC",
"documentNumber": "3664565777",
"phoneNumer": "0987465344",
"email": "[email protected]"
},
"maskedAccountNumber": "123xxxxxx789",
"transactionType": "SALE",
"paymentMethod": "Transfer",
"subscriptionId": "1602085909268642",
"currencyCode": "COP",
"bancoBogotaId": "2085976659",
"privateProcessorId": "600000000016020000000XXXXXXX",
"transactionReference": "5c4d73a7-c2a0-40ba-959d-7f0175915346"
}
}