Webhook para pagos con Webpay Plus
03 agosto 2023
Kushki puede enviar eventos webhook que notifican a tu aplicación cuando uno de los siguientes eventos ocurre al realizar un cobro con el servicio de Webpay Plus:
- Cuando una transacción ha sido aprobada.
- Cuando una transacción ha sido declinada.
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 |
---|---|
country | string |
processor_type | string |
response_code | string |
transaction_status | "APPROVAL" "DECLINED" |
request_amount | number |
channel | string |
merchant_id | string |
approved_transaction_amount | number |
buy_order | string |
currency_code | string |
subtotal_iva | number |
processor_id | string |
processor_name | string |
response_text | string |
transaction_reference | string |
last_four_digits | string |
transaction_id | string |
approval_code | string |
amount | object |
subtotalIva0 | number |
iva | number |
subtotalIva | number |
created | number (Unix Timestamp Format) |
iva_value | number |
integration_method | string |
merchant_name | string |
card_type | string |
ticket_number | string |
transaction_type | "SALE" |
token | string |
sync_mode | string |
subtotal_iva0 | number |
transactionReference | string |
Ejemplos
- JSON
- JSON
// Transacción aprobada{"country": "Chile","processor_type": "aggregator_formal","response_code": "000","transaction_status": "APPROVAL","request_amount": 2500,"channel": "webpay","merchant_id": "20000000105045623000","approved_transaction_amount": 2500,"buy_order": "20220604230551990","currency_code": "CLP","subtotal_iva": 0,"processor_id": "1000001057834855117416546432453","processor_name": "Transbank Processor","response_text": "Transacción aprobada","transaction_reference": "46a1ff25-51a4-409f-84b8-155fd4732f98","last_four_digits": "7763","transaction_id": "46a1ff25-51a4-409f-84b8-155fd4732f98","approval_code": "1415","amount": {"subtotalIva0": 2500,"iva": 0,"subtotalIva": 0},"created": 1656025541039,"iva_value": 0,"integration_method": "rest","merchant_name": "Tu Gran Empresa","card_type": "debit","ticket_number": "446025551863514017","transaction_type": "SALE","token": "24d63081656c464694987036e120d6e0","sync_mode": "api","subtotal_iva0": 2500,"transactionReference": "46a1ff25-51a4-409f-84b8-155fd4732f98"}
// Transacción declinada{"country": "Chile","processor_type": "aggregator_formal","response_code": "006","transaction_status": "DECLINED","request_amount": 2500,"channel": "webpay","merchant_id": "20000000105045623000","approved_transaction_amount": 0,"buy_order": "20220604230846991","currency_code": "CLP","subtotal_iva": 0,"processor_id": "1000001057834855117416546432453","processor_name": "Transbank Processor","response_text": "Rechazo de transacción","transaction_reference": "87388bdd-4e96-4861-96c7-3545af633f65","last_four_digits": "0568","transaction_id": "87388bdd-4e96-4861-96c7-3545af633f65","approval_code": "000000","amount": {"subtotalIva0": 2500,"iva": 0,"subtotalIva": 0},"created": 1656025723299,"iva_value": 0,"integration_method": "rest","merchant_name": "Tu Gran Empresa","card_type": "credit","ticket_number": "446025727023609160","transaction_type": "SALE","token": "821877490cfa451db9df7e948c52055f","sync_mode": "api","subtotal_iva0": 2500,"transactionReference": "87388bdd-4e96-4861-96c7-3545af633f65"}