Webhook para pagos únicos con tarjeta
15 diciembre 2023
Kushki puede enviar eventos vía webhook que notifican a tu aplicación cuando 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
Notificación de pago
Estructura
Los webhooks enviados por Kushki contendrán los encabezados (headers) aquí listados.
Estas son las posibles variables que se entregan en el cuerpo del webhook:
Método: POST
Body: Object
Variable | Tipo |
---|---|
ticket_number | string |
transaction_id | string |
transaction_reference | string |
amount | object |
amount.subtotalIva0 | number |
amount.subtotalIva | number |
amount.iva | number |
amount.ice | number |
amount.currency | string |
metadata | object |
metadata.key0 | string |
metadata.key1 | string |
metadata.key2 | string |
currency_code | string |
transaction_type | "SALE" |
transaction_status | "APPROVAL" "DECLINED" |
created | number (Unix Timestamp Format) |
sync_mode | string |
merchant_id | string |
processor_id | string |
processor_name | string |
last_four_digits | string |
approval_code | string |
request_amount | number |
approved_transaction_amount | number |
subtotal_iva0 | number |
subtotal_iva | number |
iva_value | number |
country | string |
processor_type | string |
response_code | string |
payment_brand | string |
fullResponse | number |
token_type | string |
maskedCardNumber | string |
tokenAlreadyUsed | boolean |
transactionCardHolderName | string |
transactionCardId | string |
transactionEmail | string |
transaction_details | object |
transaction_details.cardType | string |
transaction_details.binCard | string |
transaction_details.processorBankName | string |
transaction_details.isDeferred | string |
transaction_details.lastFourDigitsOfCard | string |
issuing_bank | string |
foreign_card | boolean |
response_text | string |
ip | string |
merchant_name | string |
acquirerBank | string |
card_type | string |
token | string |
credential_alias | string |
processor_bank_name | string |
bin_card | string |
ice_value | string |
credential_id | string |
processorCode | string |
processor | object |
processor.code | string |
processor.message | string |
channel | string |
interest_amount | string |
mccCode | string |
card_country | string |
ignoreWarnings | boolean |
bin_type | integer |
integration | string |
acquirer_bank | string |
processor_merchant_id | string |
security | object |
security.whitelist | boolean |
originalCommissionType | string |
commission | object |
commission.deferred | integer |
commission.country | string |
commission.iva | number |
commission.merchantId | string |
commission.fixAmount | number |
commission.variableAmount | number |
commission.type | string |
commission.merchantName | string |
parent_merchant_id | string |
parent_ticket_number | string |
plcc | boolean |
commissionType | string |
card_country_code | string |
processor_transaction_id | string |
KSH_LAMBDA_FUNCTION | string |
KSH_AWS_REQUEST_ID | string |
transactionReference | string |
contactDetails | object |
contactDetails.firstName | string |
contactDetails.lastName | string |
contactDetails.phoneNumber | string |
contactDetails.documentType | string |
contactDetails.documentNumber | string |
contactDetails.email | string |
publicMerchantId | string |
merchantId | string |
paymentMethod | string |
syncMetadata | string |
id | string |
status | string |
Ejemplos
- JSON
- JSON
- JSON
// Transacción aprobada{"country": "Colombia","metadata": {"contractID": "157AB"},"processor_type": "gateway","response_code": "000","transaction_status": "APPROVAL","card_holder_name": "TESTING","payment_brand": "Visa","request_amount": 16.98,"fullResponse": true,"merchant_id": "20000000XXXXXXXX2000","approved_transaction_amount": 16.98,"productDetails": {"product": [{"quantity": 1,"price": 6990000,"id": "198952AB","sku": "10101042","title": "eBook Digital Services"},{"quantity": 1,"price": 9990000,"id": "198953AB","sku": "004834GQ","title": "eBook Virtual Selling"}]},"token_type": "transaction-token","maskedCardNumber": "438626XXXXXX7714","currency_code": "USD","transaction_details": {"cardType": "Visa","binCard": "438626","processorBankName": "0032~BANCO INTERNACIONAL","isDeferred": "N"},"subtotal_iva": 0,"issuing_bank": null,"processor_id": "6000000000158776275865741143200","processor_name": "Credibanco Processor","foreign_card": true,"response_text": "Transacción aprobada","transaction_reference": "55d28261-c446-4592-a8d6-17c20aee3bb0","last_four_digits": "7714","user_agent": "Go-http-client/1.1","transaction_id": "781482485839103928","approval_code": "000000","amount": {"subtotalIva0": 16.98,"iva": 0,"subtotalIva": 0,"currency": "USD","ice": 0},"created": 1601587937000,"ip": "35.193.164.95","iva_value": 0,"merchant_name": "Tu Gran Empresa","contact_details": {"firstName": "Diego","lastName": "Cadena","phoneNumber": "0988734644","documentType": "CC","documentNumber": "1009283738","email": "test@test.com"},"acquirerBank": null,"card_type": null,"ticket_number": "992823152575262637","transaction_type": "SALE","token": "fca0fe160b5048aca584e30fbf652edf","sync_mode": "online","orderDetails": {"billingDetails": {"country": "Ecuador","zipCode": "170402","address": "Eloy Alfaro 139 y Catalina Aldaz","city": "Quito","phone": "0988734644","name": "Diego Cadena","region": "Pichincha"},"shippingDetails": {"country": "Ecuador","zipCode": "170402","address": "Eloy Alfaro 139 y Catalina Aldaz","city": "Quito","phone": "0988734644","name": "Diego Cadena","region": "Pichincha"},"siteDomain": "tuebook.com"},"credential_alias": "Kushki Test","processor_bank_name": "0032~BANCO INTERNACIONAL","bin_card": "438626","ice_value": 0,"credential_id": "b18653307844446bbfcb4783d2711a47","subtotal_iva0": 16.98,"transactionReference": "55d28261-c446-4592-a8d6-17c20aee3bb0"}
// Transacción declinada{"country": "Colombia","metadata": {"contractID": "157AB"},"processor_type": "gateway","response_code": "017","transaction_status": "DECLINED","card_holder_name": "TESTING","payment_brand": "Visa","request_amount": 16.98,"fullResponse": true,"merchant_id": "20000000XXXXXXXX2000","approved_transaction_amount": 0,"productDetails": {"product": [{"quantity": 1,"price": 6990000,"id": "198952AB","sku": "10101042","title": "eBook Digital Services"},{"quantity": 1,"price": 9990000,"id": "198953AB","sku": "004834GQ","title": "eBook Virtual Selling"}]},"maskedCardNumber": "434900XXXXXX7015","currency_code": "USD","transaction_details": {"cardType": "Visa","binCard": "434900","processorBankName": "0032~BANCO INTERNACIONAL","isDeferred": "N"},"subtotal_iva": 0,"issuing_bank": "BANCO DE LA PRODUCCION S.A. (PRODUBANCO)","processor_id": "6000000000XXXXXXXXXXXXXXXXX3200","processor_name": "Credibanco Processor","foreign_card": true,"response_text": "Tarjeta no válida","transaction_reference": "abe4a9a6-0a80-4156-aeb1-77efd422c3f7","last_four_digits": "7015","transaction_id": "398726433762481304","approval_code": null,"amount": {"subtotalIva0": 16.98,"iva": 0,"subtotalIva": 0,"currency": "USD","ice": 0},"created": 1601651651000,"ip": "1.1.1.1","iva_value": 0,"merchant_name": "Tu Gran Empresa","contact_details": {"firstName": "Diego","lastName": "Cadena","phoneNumber": "+593988734644","documentType": "CC","documentNumber": "1009283738","email": "test@test.com"},"acquirerBank": null,"card_type": "CREDIT","transaction_type": "SALE","processor": {"code": "K006","message": "Transacción declinada."},"token": "43764c2dca3042dda127ffe8f1194488","sync_mode": "online","orderDetails": {"billingDetails": {"country": "Ecuador","zipCode": "170402","address": "Eloy Alfaro 139 y Catalina Aldaz","city": "Quito","phone": "+593988734644","name": "Diego Cadena","region": "Pichincha"},"shippingDetails": {"country": "Ecuador","zipCode": "170402","address": "Eloy Alfaro 139 y Catalina Aldaz","city": "Quito","phone": "+593988734644","name": "Diego Cadena","region": "Pichincha"},"siteDomain": "tuebook.com"},"credential_alias": "Kushki Test","processor_bank_name": "0032~BANCO INTERNACIONAL","bin_card": "434900","ice_value": 0,"processorCode": null,"credential_id": "b18653307844446bbfcb4783d2711a47","subtotal_iva0": 16.98,"transactionReference": "abe4a9a6-0a80-4156-aeb1-77efd422c3f7"}
{"country": "Mexico","transaction_details": {"lastFourDigitsOfCard": "4242","cardType": "Visa","binCard": "424242","processorBankName": "ACCENDO","isDeferred": "N"},"interest_amount": "0.00","mccCode": "5399","subtotal_iva": 0,"card_country": "United States of America","processor_name": "Prosa Processor","response_text": "Transaccion aprobada","transaction_reference": "10151422-d25b-4a4b-aee4-ea20110ebd7a","transaction_id": "166751609816","ignoreWarnings": true,"created": 1667516495000,"iva_value": 0,"merchant_name": "Tu Comercio MX","transaction_type": "SALE","sync_mode": "online","bin_type": 6,"integration": "aurus","subtotal_iva0": 16.8,"processor_type": "aggregator_gateway","response_code": "000","transaction_status": "APPROVAL","card_holder_name": "John Doe","payment_brand": "Visa","acquirer_bank": "ACCENDO","request_amount": 16.8,"processor_merchant_id": "200000001040961","merchant_id": "20000000104096110000","approved_transaction_amount": 16.8,"token_type": "transaction","maskedCardNumber": "424242XXXXXX4242","currency_code": "USD","security": {"whitelist": false},"originalCommissionType": "TRANSACTION","issuing_bank": "BANCO NACIONAL (TEST)","processor_id": "6000000000163233373827093334","commission": {"deferred": 1,"country": "Mexico","iva": 0,"merchantId": "20000000104096110000","fixAmount": 0,"variableAmount": 15,"type": "DEFAULT","merchantName": "Tu Comercio MX"},"foreign_card": true,"parent_merchant_id": "20000000108850670000","last_four_digits": "4242","approval_code": "243829","amount": {"subtotalIva0": 16.8,"iva": 0,"subtotalIva": 0,"currency": "USD"},"parent_ticket_number": "003887944461301257","plcc": false,"card_type": "credit","ticket_number": "881667516402161497","commissionType": "TRANSACTION","card_country_code": "US","processor_transaction_id": "166751649316","processor_bank_name": "ACCENDO","KSH_LAMBDA_FUNCTION": "usrv-commission-uat-handleChargeCardTransactions","bin_card": "424242","KSH_AWS_REQUEST_ID": "ed7c85c1-237f-5bdd-b4ba-de1f6911e140","transactionReference": "10151422-d25b-4a4b-aee4-ea37d30ebd7a"}