¿Cuales son todos los webhooks que podría inscribir?
Los eventos que pueden registrarse son:
'interaction.incoming'
: Interaction entrante desde un Customer hacia Toku.'interaction.outgoing'
: Interaction saliente desde Toku hacia un Customer.'payment_method_inscription_intent.failed'
: Intento de inscripción de un método de pago fallido'payment_intent.succeeded'
: Intento de pago exitoso de un Invoice.'payment_intent.payment_failed'
: Intento de pago fallido de un Invoice.'payment_intent.succeeded_batch'
: Resumen de pagos exitosos para una lista de Invoices. Se utiliza en procesos de cobro automático masivos'payment_intent.payment_failed_batch'
: Resumen de intentos de pagos fallidos para una lista de Invoices. Se utiliza en procesos de cobro automático masivos'payment_intent.payment_pending_batch'
: Resumen de intentos de pagos que se encuentran pendientes para una lista de Invoices. Se utiliza en procesos de cobro automático masivos'payment.succeeded'
: Pago realizado exitosamente de un Invoice. Esto aplica solo para pagos ejecutados manualmente a través de Toku. Si quieres escuchar los pagos procesados a través de Toku, debes utilizar payment_intent.succeeded.'activation.created'
: Creación y actualización de una activación de transferencia. Esto se realiza mediante el proceso de la transferencia de $1.000 CLP por parte de un customer y el webhook se gatilla tanto en el minuto que se realiza la transferencia, como también cuando el customer queda activo.'bank_account_verification.result'
: Respuesta de la validación de una cuenta CLABE. Notifica la información que se obtuvo producto de una validación. Se puede utilizar un endpoint de prueba para simular una respuesta, la documentación se encuentra en este link.'payout.done'
: Actualización de las liquidaciones efectuadas por parte de Toku hacia la organización. Entrega información sobre los pagos, la conciliación de estos y sus Invoices'payout_mx.success'
: Actualización de las liquidaciones de México efectuadas por parte de Toku hacia la organización. Entrega información sobre la cuenta, la liquidación y las Transactions involucradas.
Para registrar un **Webhook Endpoint, debes poseer un endpoint que pueda recibir datos a través de una request POST, y que confirme su recepción retornando un status code HTTP 2xx
.
Solo es necesario inscribir una vez el endpoint. Después de inscrito, notificará los eventos inscritos.
Si ya tienes todo instalado puedes probar webhook de prueba aquí
Ejemplos de todos los webhooks que tiene habilitados Toku
interaction.outgoing
interaction.outgoing
{
"id": "eve_ARC6o7o3xEHvYTw8o7fq74r2tLq-2tAS",
"event_type": "interaction.outgoing",
"interaction": {
"id": "inter_tgK-vdZo8J8UH7E9Ng_K7Jejn_PYykch",
"customer": "cus_lq1wGjwgFyqQm4ACZx0QjE84qKm8fffa",
"created_at": "2022-01-01 20:03:07.963677",
"channel": "wsp",
"type": "outgoing",
"sender_contact": "+15614186678",
"customer_contact": "+56989934148",
"message": "test outgoing",
"subject": null
}
}
interaction.incoming
interaction.incoming
{
"id": "eve_dDWgyidyo3so0yPhHc-Wyx27xOfXxnQc",
"event_type": "interaction.incoming",
"interaction": {
"id": "inter_XUc55FMipFh3-kucknWQR_1rv_AR942L",
"customer": "cus_lq1wGjwgFyqQm4ACZx0QjE84qKm8fffa",
"created_at": "2022-01-01 20:16:29.648457",
"channel": "wsp",
"type": "outgoing",
"sender_contact": "+15614186678",
"customer_contact": "+56989934148",
"message": "test incoming",
"subject": null
}
}
Los campos institution_name
e institution_id
pueden tomar los siguientes valores:
institution_name | institution_id |
---|---|
Banco BCI | cl_banco_bci |
Banco de Chile | cl_banco_de_chile |
Banco Estado | cl_banco_estado |
Banco Falabella | cl_banco_falabella |
Banco Itaú | cl_banco_itau |
Banco Santander | cl_banco_santander |
Banco Scotiabank | cl_banco_scotiabank |
payment_method.attached_products
Transbank
payment_method.attached_products
Transbank{
"id": "eve_NFMjlWEFasu7MTBm_bAFUz9ZmD5Cm1Pw",
"event_type": "payment_method.attached_products",
"payment_method": {
"id": "pm_dfs54g5sr4dv5sf",
"customer": "cus_dfs54g5sr4dv5sf",
"gateway": "transbank_oneclick",
"card_type": "Visa",
"card_number": "XXXXXXXXX1234",
"status": "chargeable",
"additional": {},
"product_ids": ["product-id-1"]
}
}
payment_method.attached_products
Cards PSP
payment_method.attached_products
Cards PSP{
"id": "wheve_MkPZQrwEAVF0E1UdB-8IkdzRQS7IKO-W",
"event_type": "payment_method.attached_products",
"payment_method": {
"id": "pm_rSXZ3Vp1urLI8Ta-_gXF0urdJlt44LK_",
"customer": "cus_8CHZ-w3GdJ_1AtDxhMzT_MgT_cxYBwQb",
"gateway": "internal_psp",
"card_type": null,
"card_number": "XXXXXXXXXXXX8477",
"status": "chargeable",
"additional": {
"holder_id": null,
"account_type": null,
"account_number": null,
"institution_id": null,
"institution_name": null,
"institution_country": null,
"limit_uf": null,
"mandate_id": null,
"voucher_url": null,
"voucher": null
},
"product_ids": [
"123"
],
"id_account": "acc_5pe6OvW_pWp8qEB16cMs96J-lS95E1sC"
}
}
payment_method.attached_products
PAC
payment_method.attached_products
PAC{
"id": "wheve_BIo3CxB5mtKuTpx-pG0EJprjQYYjUjFm",
"event_type": "payment_method.attached_products",
"payment_method": {
"id": "pm_OZJz903dBIZOvCa7Mt7pnNAVyBUEQPwY",
"customer": "cus_aEB980lWMwLSq4Sevbx19A4TWWPM5SMX",
"gateway": "toku_pac",
"card_type": null,
"card_number": null,
"status": "chargeable",
"additional": {
"holder_id": "136026933",
"account_type": "checking_account",
"account_number": "000064657380",
"institution_id": "cl_banco_santander",
"institution_name": "Banco Santander",
"institution_country": "cl",
"limit_uf": 1000,
"mandate_id": "2480269",
"voucher_url": "https://storage.googleapis.com/pac-vouchers-prod/ce19b959b238/c0713e7b987b6/1682708492124_2480269.pdf?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=350256473195-compute%40developer.gserviceaccount.com%2F20230428%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20230428T190133Z&X-Goog-Expires=604800&X-Goog-SignedHeaders=host&X-Goog-Signature=942a15f8206af470c01027c93d3c066e47853169933ef6fa0a0bd9c4ed6b506cacda5fbfc7e4852834ef3343ad97ed4fe20fe7ac4e0310f03cd01985320fc74c2950f3ea57ee6139a98662651c27960c81aa1b8fcc2f96b4a5c6d4fd4c7d467feb86b45a5505197b9f8b96b8f16ed0150ecfeb5922f798a9b8ead54e5af0c1e25f55a11f3ac0e9411471eff213a9dd9315616275d846ab311416f624dc176d4f56cc87b374f853e80cbcc9fcbecc7a1924f0163c67f290413cf4f45a401f39eb8c7c561f076107f73c4b8d4eae70bdee3a7e40a8f0f6b596c1782d63b4a31454af9d1536b0732c8a8a20802f988f3ebbc67497ed6feea404f1663aad4e4da58d"
},
"product_ids": [
"2480269"
],
"id_account": "acc_t7s74wKbR59koKc7J5mapDvcuPISgZJc"
}
},
payment_method_inscription_intent.failed
PAC
payment_method_inscription_intent.failed
PAC{
"id": "wheve_cPl1OgwiqhA6oKMPMhnSHAWzGPuiJ7LA",
"event_type": "payment_method_inscription_intent.failed",
"payment_method_inscription_intent": {
"id_payment_method_inscription_intent":"pmii_AM4LvUGcqfxzgiUgxMocVuR-MD3xjb4N",
"id_payment_method":null,
"external_id": "yQOl1CGnHY",
"customer": "cus_KrXCkhN-hLWLrpljz_9uieZYnN_uS3iG",
"gateway": "toku_pac",
"status": "inscription_failed",
"toku_response_code": "PEBCH1003",
"additional": {
"holder_id": "194543905",
"account_type": null,
"account_number": null,
"institution_id": "cl_banco_de_chile",
"institution_name": "Banco de Chile",
"institution_country": "cl",
"limit_uf": 100,
"mandate_id": "123123",
"voucher_url": null
},
"id_account": "acc_bMMbOmVpAlsgRxl5H461TtHv929Xn2_T"
}
}
payment_method_inscription_intent.failed
Cards PSP, Transbank, Payment Orchestration
payment_method_inscription_intent.failed
Cards PSP, Transbank, Payment Orchestration{
"id": "wheve_cPl1OgwiqhA6oKMPMhnSHAWzGPuiJ7LA",
"event_type": "payment_method_inscription_intent.failed",
"payment_method_inscription_intent": {
"id_payment_method_inscription_intent":"pmii_AM4LvUGcqfxzgiUgxMocVuR-MD3xjb4N",
"id_payment_method":"pm_AM4LvUGcqfxzgiUgxMocVuR-MD3xjb4N",
"external_id": null,
"customer": "cus_KrXCkhN-hLWLrpljz_9uieZYnN_uS3iG",
"gateway": "internal_psp",
"status": "inscription_failed",
"toku_response_code": "PEPSP2106",
"additional": {},
"id_account": "acc_bMMbOmVpAlsgRxl5H461TtHv929Xn2_T"
}
}
payment_intent.succeeded
Transferencia
payment_intent.succeeded
Transferencia{
"id": "eve_zwr5c8Ddcu0sW2zl57aTTeTFmovcysl-",
"event_type": "payment_intent.succeeded",
"payment_intent": {
"id": "pi_cGuAf-JSoTrg7QhQlabJTsuhQaGborN4",
"invoice": "in_poaFZEY8fgpxXhwhOYj4KBk1tjLQA-wa",
"customer": "cus_HpnoeQFzNB-pOiAobqFrccfk7Kpwin_b",
"id_account": "acc_l8ojrji3k8SC7iLbVBxxgwVeOLRRbkEc",
"gateway": "khipu_transfer",
"amount": "10000.0000",
"status": "AUTHORIZED",
"payment_method": "pm_AM4LvUGcqfxzgiUgxMocVuR-MD3xjb4N",
"transaction_date": "2022-04-07 21:39:28.344703",
"card_detail": null,
"buy_order": "156967510939",
"child_buy_order": null,
"authorization_code": null,
"payment_type_code": null,
"response_code": null,
"toku_response_code": null,
"installments_number": null,
"mc_order_id": null
}
}
payment_intent.succeeded
Cards PSP
payment_intent.succeeded
Cards PSP{
"id": "wheve_EmGFwPP-hdS_2gRzt-NLlfimMEFLFvcp",
"event_type": "payment_intent.succeeded",
"payment_intent": {
"id": "pi_db3_j8jlempd9Of2JVc65Vupqt_KurLb",
"invoice": "in_ilEtjHa-IpBP1HsAPEDcgVmHGAgizFnC",
"customer": "cus_8CHZ-w3GdJ_1AtDxhMzT_MgT_cxYBwQb",
"gateway": "internal_psp",
"amount": "1500.0000",
"status": "AUTHORIZED",
"payment_method": "pm_OjTv9N9lYsHlm_qOjS9ZX_iMEFpcejzv",
"transaction_date": "2023-06-29 15:37:51.769414",
"card_detail": null,
"buy_order": null,
"child_buy_order": null,
"authorization_code": null,
"payment_type_code": null,
"response_code": null,
"toku_response_code": "SUPSP0000",
"installments_number": null,
"mc_order_id": null,
"id_account": "acc_5pe6OvW_pWp8qEB16cMs96J-lS95E1sC"
}
}
payment_intent.payment_failed
payment_intent.payment_failed
{
"id": "eve_NFMjlWEFasu7MTBm_bAFUz9ZmD5Cm1Pw",
"event_type": "payment_intent.payment_failed",
"payment_intent": {
"id": "pi_dsQ5-sNZPwxBYf6hnLsstaqG9JAZK432",
"invoice": "in_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"customer": "cus_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"gateway": "toku_pac",
"amount": "1000",
"status": "FAILED",
"payment_method": "pm_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"transaction_date": "2021-04-22 14:03:39.410000",
"card_detail": "1234",
"buy_order": "bo-2-609bf894",
"child_buy_order": "cbo-2-609bf894",
"authorization_code": "1213",
"payment_type_code": "VN",
"response_code": -4,
"toku_response_code": "SU0000",
"installments_number": 0,
"mc_order_id": "1234567"
}
}
payment.succeeded
payment.succeeded
{
"id": "eve_nsHM-5paB_ZTGGhWni49URhW1JEpQADW",
"event_type": "payment.succeeded",
"payment": {
"id": "pay_JHjBcHZysyBj6dPDtt5OxFNydEtjw8L7",
"invoice": "in_5tswGjwgAxrQm4ACZx0QjE84qKm8fgsw",
"customer": "cus_lq1wGjwgFyqQm4ACZx0QjE84qKm8fffa",
"id_account": "acc_l8ojrji3k8SC7iLbVBxxgwVeOLRRbkEc",
"gateway": "transbank_oneclick",
"due_date": "2021-03-04",
"product_id": "92792",
"payment_amount": "1000.0000",
"payment_date": "2021-07-26 20:28:00.717000",
"payment_intent": "pi_JHjBcHZysyBj6dPDtt5OxFNydEtjw8L7",
"buy_order": "1931280",
"receipt": "rpt_JHjBcHZysyBj6dPDtt5OxFNydEtjw8L7",
}
}
payment_intent.succeeded_batch
payment_intent.succeeded_batch
{
"id": "eve_dDWgyidyo3so0yPhHc-Wyx27xOfXxnQc",
"event_type": "payment_intent.succeeded_batch",
"payment_intent":{
"id_account": "acc_l8ojrji3k8SC7iLbVBxxgwVeOLRRbkEc",
"payment_intents": [
{
"id": "pi_dsQ5-sNZPwxBYf6hnLsstaqG9JAZK432",
"invoice": "in_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"customer": "cus_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"gateway": "klap_oneclick",
"amount": "1000.0000",
"payment_method": "pm_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"transaction_date": "2021-04-22 14:03:39.410000",
"toku_response_code": "SU0000",
"status": "AUTHORIZED"
},
...
]
}
}
payment_intent.payment_failed_batch
payment_intent.payment_failed_batch
{
"id": "eve_dDWgyidyo3so0yPhHc-Wyx27xOfXxnQc",
"event_type": "payment_intent.payment_failed_batch",
"payment_intent":{
"id_account": "acc_l8ojrji3k8SC7iLbVBxxgwVeOLRRbkEc",
"payment_intents": [
{
"id": "pi_dsQ5-sNZPwxBYf6hnLsstaqG9JAZK432",
"invoice": "in_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"customer": "cus_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"gateway": "klap_oneclick",
"amount": "1000.0000",
"payment_method": "pm_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"transaction_date": "2021-04-22 14:03:39.410000",
"toku_response_code": "SU0000",
"status": "FAILED"
},
...
]
}
}
payment_intent.payment_pending_batch
payment_intent.payment_pending_batch
{
"id": "eve_dDWgyidyo3so0yPhHc-Wyx27xOfXxnQc",
"event_type": "payment_intent.payment_pending_batch",
"payment_intent":{
"id_account": "acc_l8ojrji3k8SC7iLbVBxxgwVeOLRRbkEc",
"payment_intents": [
{
"id": "pi_dsQ5-sNZPwxBYf6hnLsstaqG9JAZK432",
"invoice": "in_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"customer": "cus_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"gateway": "klap_oneclick",
"amount": "1000.0000",
"payment_method": "pm_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"transaction_date": "2021-04-22 14:03:39.410000",
"toku_response_code": "SU0000",
"status": "PAC_PENDING"
},
...
]
}
}
activation.created
activation.created
{
"id": "eve_Yc1aFFgyEtEa3sjWn2jiYh8GBsKHHcrZ",
"event_type": "activation.created",
"activation": {
"id_account": "acc_l8ojrji3k8SC7iLbVBxxgwVeOLRRbkEc",
"id_customer": "cus_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"government_id": "416148503",
"payer_name": "Francisco Besoain",
"payer_email": "[email protected]",
"institution": "Banco de Chile",
"bank_account_number": "746326042",
"status": "activated"
}
}
bank_account_verification.result
bank_account_verification.result
{
"status": "DONE",
"validation": "failed",
"reason": null,
"voucher_url": {
"pdf": "https://storage.googleapis.com/domiciliation-validation/bav_rNaGT3DOzVYgfU9TpFLZ9CNjEx9Jtest.B.pdf",
"xml": "https://storage.googleapis.com/domiciliation-validation/bav_rNaGT3DOzVYgfU9TpFLZ9CNjEx9Jtest.B.xml"
},
"account_number": "111111111111111111",
"customer_identifier": "111111111111",
"voucher_information": {
"account_number": "111111111111111111",
"customer_identifier": "1111111111111",
"receiver_institution": "BANORTE",
"receiver_name": "TEST TEST",
"receiver_account_type": "40",
"operation_date": "2022-10-14",
"operation_time": "14:41:31",
"spei_id": "11111",
"signature": "mYfEz2/nPaTmKjG1LsVcXsFg/QoDpWYb0qoB4dULelSYCfNzI8iU6RkH7JhATvx9+3aP5tKjG1LsVcXsFg/QoDpWYb0qoB4dULel\n SYCfNzI8iU6RkH7JhATvx9+3aP5tFzLb9/eDUGhQorY6nTEbxyZwca8sGVKQ2aLqpEuRSsLsVcXsFg/QoDpWYb0qoB4dULelSYCfNzI8iU6RkH7JhATv\n x9+3aP5tKjG1LsVcXsFg/QoDpWYb0qoB4dULelSYCfNzI8iU6RkH7JhATvx9+3aP5tFzLb9/eDUGhQorY6nTEbxyZvhitQ==",
"certificate_number": "00001000000501111111",
"cda_chain": "||1|14102022|14102022|144131|11111|STP|TESTING S DE RL DE CV|40|111111111111111111|TEST220304U60\n |BANORTE|TEST TEST|40|111111111111111111|1111111111111|Validation transfer|0.00|0.01|NA|NA|0|0|NA|0\n |0.00|00001000000501732145||mYfEz2/nPaTmKjG1LsVcXsFg/QoDpWYb0qoB4dULelSYCfNzI8iU6RkH7JhATvx9+3aP5tKjG1LsVcXsFg/QoDpWYb0qoB4dULel\n SYCfNzI8iU6RkH7JhATvx9+3aP5tFzLb9/eDUGhQorY6nTEbxyZwca8sGVKQ2aLqpEuRSsLsVcXsFg/QoDpWYb0qoB4dULelSYCfNzI8iU6RkH7JhATv\n x9+3aP5tKjG1LsVcXsFg/QoDpWYb0qoB4dULelSYCfNzI8iU6RkH7JhATvx9+3aP5tFzLb9/eDUGhQorY6nTEbxyZvhitQ==",
"tracking_id": "2022101411111BNRT1939536CAMTT"
}
}
payout.done
payout.done
{
"id": "eve_dDWgyidyo3so0yPhHc-Wyx27xOfXxnQc",
"event_type": "payout.done",
"payout": {
"id": "pyt_JHjBcHZysyBj6dPDtt5OxFNydEtjw8L7",
"account": "acc_l8ojrji3k8SC7iLbVBxxgwVeOLRRbkEc",
"payout_amount": 1090,
"transaction_amount": 1100,
"fee": 10,
"paid_invoices": [
"in_1YPKc-NZPwxBYf6hnLsstaqG9JAZKxX9",
"in_1YLPW-NSPwxLYp1ssLlntaqG9JAZKx10",
],
"refunded_invoices": ["in_8MAPE-SSrWaLap9kkLlatwqq9JAZKx11"],
},
}
payout_mx.success
payout_mx.success
{
"id": "pyt_ZY3MEoRd4Q4KIDqoYnW981YKTBOPO0fm",
"id_account": "acc_LO53Ak2oa4qNTGrfv0vqJYbMzSVjdsEd",
"account_number": "638180010185142505",
"deposit_date": "2024-04-22T14:03:39.410000",
"status": "success",
"payout_amount": "1950.0000",
"transactions_amount": "2000.0000",
"fees_amount": "50.0000",
"transactions": {
"PAYMENT": [
{
"id": "trs_GcpTamnd7FBmnQ62u_tG8PJ08fasOeyI",
"transaction_amount": "5000.0000",
"transaction_amount_in_payout": "3000.0000",
"transaction_fee_in_payout": "75.0000",
},
{
"id": "trs_DVI9F0_PdANT0baaxOykTlxb9dwCwsJl",
"transaction_amount": "2000.0000",
"transaction_amount_in_payout": "2000.0000",
"transaction_fee_in_payout": "50.0000",
},
],
"REVERSED": [
{
"id": "trs_oppTamnd7FBmnQ62u_tG8PJ08fasOeyI",
"transaction_amount": "2000.0000",
"transaction_amount_in_payout": "2000.0000",
"transaction_fee_in_payout": "50.0000",
},
{
"id": "trs_dfs9F0_PdANT0baaxOykTlxb9dwCwsJl",
"transaction_amount": "2000.0000",
"transaction_amount_in_payout": "1000.0000",
"transaction_fee_in_payout": "25.0000",
},
],
"VOID": [],
"CHARGEBACK": [],
},
"voucher": "base64_encoded_string_with_voucher",
}
Descripción de los campos enviados:
Campo | Descripción |
---|---|
id | ID interno del objeto Payout |
id_account | ID interno del objeto Account |
account_number | Clabe a la que se deposita la liquidación. |
deposit_date | Fecha en que se depositó la liquidación. |
status | Estado de la liquidación. |
payout_amount | Monto de la liquidación. Es el monto de las Transactions menos la comisión descontada, es decir, transactions_amount - fees_amount . |
transactions_amount | Monto de las Transactions involucradas en la liquidación. |
fees_amount | Monto de las comisiones descontadas en la liquidación. |
transactions | Listado de las Transactions involucradas en la liquidación, desagregadas según tipo. Pueden ser del tipo PAYMENT , REVERSED , VOID o CHARGEBACK . |
transaction_amount | Monto total de una Transaction en particular. |
transaction_amount_in_payout | Monto de una Transaction en particular que fue considerado en el monto de la liquidación. Puede ser distinto al monto total transaction_amount en caso de que la Transaction contenga dinero de distintas cuentas. |
transaction_fee_in_payout | Monto de la comisión descontada de una Transaction en particular. Se calcula sobre el monto que aparece en el campo transaction_amount_in_payout . |
voucher | String en base64 con el CEP de comprobante de pago. |
Updated 7 months ago