Triggers de Shopify
OneChat ahora admite integración nativa de webhooks con Shopify. Ahora ya no es necesario usar webhooks entrantes, ya que esta integración nativa no solo evita las limitaciones de los webhooks, sino que también previene otros problemas, como la eliminación de webhooks de la tienda de Shopify, cargas útiles vacías o sin respuesta, etc.
Restablecer la conexión con Shopify
Restablecer la conexión con Shopify es un paso importante para que esta actualización comience a funcionar. Sigue los pasos a continuación para establecer la conexión:
En el panel del Workspace, haz clic en Integrations y luego en shopify. Después, haz clic en el botón Save y tu conexión se restablecerá.
Encontrar y seleccionar los triggers de Shopify
Una vez dentro de tu bot, sigue los pasos a continuación para encontrar y usar los triggers.
Haz clic en Automation en el lado izquierdo de la barra de desplazamiento y luego selecciona Triggers en la parte superior.
Haz clic en "New Trigger" y desplázate hacia abajo hasta que veas Shopify Webhook; selecciónalo.
Acciones nativas de Webhook
OneChat admite las siguientes acciones nativas por ahora.
Cómo usar los triggers
Sigue la guía visual a continuación para usar los triggers.
Después de agregar los detalles y mapear la variable, adjunta el trigger a un subflow de la siguiente manera:
Ahora estamos listos para usar los triggers.
Triggers y payloads de respuesta
Carrito abandonado
Cart Abandoned se activa desde Shopify cada vez que un cliente ingresa sus datos de facturación pero no continúa a la página de pago o no completa el pago.
El payload de respuesta devuelve información sobre los artículos del carrito, el monto, la URL de la página de checkout, etc.
El payload de respuesta devuelve el siguiente JSON.
| {
"id": 31436486049858,
"token": "5f47abde83b5d4a079cd5489c9bc6fa2",
"buyer_accepts_marketing": false,
"buyer_accepts_sms_marketing": false,
"created_at": "2023-03-28T04:56:22+00:00",
"updated_at": "2023-03-28T00:57:03-04:00",
"note": "f12372u15376836",
"taxes_included": false,
"total_weight": 0,
"currency": "AUD",
"phone": "+923032320964",
"customer_locale": "en",
"line_items": [
{
"key": "12535578755138",
"fulfillment_service": "manual",
"gift_card": false,
"grams": 0,
"presentment_variant_title": "Black",
"product_id": 1413103583298,
"quantity": 1,
"requires_shipping": true,
"sku": "11797017-1",
"taxable": false,
"title": "Pink Leather Quartz Watch",
"variant_id": 12535578755138,
"variant_title": "Black",
"variant_price": "14.99",
"vendor": "hapans",
"line_price": "14.99",
"price": "14.99"
}
],
"name": "#31436486049858",
"source_name": "5092638721",
"total_line_items_price": "14.99",
"total_tax": "0.00",
"total_discounts": "0.00",
"subtotal_price": "14.99",
"total_price": "34.99",
"total_duties": "0.00",
"billing_address": {
"address1": "test",
"city": "test",
"zip": "78601",
"country": "Pakistan",
"last_name": "Siddiqui",
"name": "Siddiqui",
"country_code": "PK"
},
"customer": {
"id": 5969354489922,
"accepts_marketing": false,
"last_name": "Siddiqui",
"orders_count": 6,
"state": "disabled",
"total_spent": "204.59",
"last_order_id": 4862145101890,
"verified_email": true,
"tax_exempt": false,
"phone": "+923032320964",
"currency": "AUD",
"default_address": {
"customer_id": 5969354489922,
"last_name": "Siddiqui",
"address1": "test",
"city": "test",
"country": "Pakistan",
"zip": "78601",
"name": "Siddiqui",
"country_code": "PK",
"country_name": "Pakistan",
"default": true
}
}
} |
Nota: El tiempo mínimo predeterminado antes de que se active el webhook de carrito abandonado es de 30 minutos.
Creación de pedido (Cash On Delivery y tarjeta de crédito)
Este webhook se activa cada vez que alguien completa el proceso de checkout y realiza un pedido. La única diferencia entre ambos triggers es que, al usar Cash on Delivery, el pedido se marca por defecto como no pagado, y al usar tarjeta de crédito, el pedido se marca por defecto como pagado.
El payload de respuesta devuelve el siguiente JSON.
| {
"id": 4862145101890,
"app_id": 5092638721,
"browser_ip": "119.160.34.14",
"buyer_accepts_marketing": false,
"checkout_id": 31435950030914,
"checkout_token": "3b34065898c1c679e0283b3c8c7d5da0",
"confirmed": true,
"created_at": "2023-03-27T23:16:50-04:00",
"currency": "AUD",
"current_subtotal_price": "24.87",
"current_total_discounts": "0.00",
"current_total_price": "44.87",
"current_total_tax": "0.00",
"customer_locale": "en",
"estimated_taxes": false,
"financial_status": "pending",
"gateway": "Cash on Delivery (COD)",
"location_id": 5833621570,
"name": "#1044",
"note": "f12372u15376836",
"number": 44,
"order_number": 1044,
"order_status_url": "Thank you! - CONNECTDOTS DEMO STORE - Checkout ",
"payment_gateway_names": [
"Cash on Delivery (COD)"
],
"phone": "+923032320964",
"processed_at": "2023-03-27T23:16:49-04:00",
"processing_method": "manual",
"reference": "a05cd2354ac4540796e3fe1e3c161553",
"source_identifier": "a05cd2354ac4540796e3fe1e3c161553",
"source_name": "5092638721",
"subtotal_price": "24.87",
"taxes_included": false,
"test": false,
"token": "de745afb0f9e4ce033d41035ddd1f58c",
"total_discounts": "0.00",
"total_line_items_price": "24.87",
"total_outstanding": "44.87",
"total_price": "44.87",
"total_price_usd": "29.86",
"total_tax": "0.00",
"total_tip_received": "0.00",
"total_weight": 0,
"updated_at": "2023-03-27T23:16:50-04:00",
"billing_address": {
"address1": "test",
"city": "test",
"zip": "78601",
"country": "Pakistan",
"last_name": "Siddiqui",
"name": "Siddiqui",
"country_code": "PK"
},
"customer": {
"id": 5969354489922,
"accepts_marketing": false,
"created_at": "2023-03-27T18:09:49-04:00",
"updated_at": "2023-03-27T23:16:50-04:00",
"last_name": "Siddiqui",
"state": "disabled",
"verified_email": true,
"tax_exempt": false,
"phone": "+923032320964",
"sms_marketing_consent": {
"state": "not_subscribed",
"opt_in_level": "single_opt_in",
"consent_collected_from": "SHOPIFY"
},
"currency": "AUD",
"accepts_marketing_updated_at": "2023-03-27T23:16:50-04:00",
"default_address": {
"id": 7363751346242,
"customer_id": 5969354489922,
"last_name": "Siddiqui",
"address1": "test",
"city": "test",
"country": "Pakistan",
"zip": "78601",
"name": "Siddiqui",
"country_code": "PK",
"country_name": "Pakistan",
"default": true
}
},
"line_items": [
{
"id": 12241816059970,
"fulfillable_quantity": 1,
"fulfillment_service": "manual",
"gift_card": false,
"grams": 0,
"name": "Classic Nato Strap Watch - CH 0221",
"price": "24.87",
"product_exists": true,
"product_id": 1413102731330,
"quantity": 1,
"requires_shipping": true,
"sku": "1097285-ch-0221",
"taxable": false,
"title": "Classic Nato Strap Watch",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "AUD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "AUD"
}
},
"variant_id": 12535576723522,
"variant_inventory_management": "shopify",
"variant_title": "CH 0221",
"vendor": "hapans"
}
],
"shipping_address": {
"address1": "test",
"city": "test",
"zip": "78601",
"country": "Pakistan",
"last_name": "Siddiqui",
"name": "Siddiqui",
"country_code": "PK"
}
} |
Pedido cancelado
Este webhook se activa cada vez que el pedido se cancela desde la consola de administración de Shopify.
El payload de respuesta devuelve el siguiente JSON.
| {
"id": 4862123409474,
"app_id": 5092638721,
"browser_ip": "119.160.34.14",
"buyer_accepts_marketing": false,
"cancel_reason": "customer",
"cancelled_at": "2023-03-28T00:50:11-04:00",
"checkout_id": 31435774623810,
"checkout_token": "d30a2d9c71d12d4ff8a154b4b140774e",
"closed_at": "2023-03-28T00:50:10-04:00",
"confirmed": true,
"created_at": "2023-03-27T22:46:04-04:00",
"currency": "AUD",
"current_subtotal_price": "0.00",
"current_total_discounts": "0.00",
"current_total_price": "0.00",
"current_total_tax": "0.00",
"customer_locale": "en",
"estimated_taxes": false,
"financial_status": "voided",
"gateway": "Cash on Delivery (COD)",
"location_id": 5833621570,
"name": "#1041",
"note": "f12372u15376836",
"number": 41,
"order_number": 1041,
"order_status_url": "Thank you! - CONNECTDOTS DEMO STORE - Checkout ",
"payment_gateway_names": [
"Cash on Delivery (COD)"
],
"phone": "+923032320964",
"processed_at": "2023-03-27T22:46:02-04:00",
"processing_method": "manual",
"reference": "934715d25490a701d19d0afb46e2e73a",
"source_identifier": "934715d25490a701d19d0afb46e2e73a",
"source_name": "5092638721",
"subtotal_price": "24.87",
"taxes_included": false,
"test": false,
"token": "3e7b990cb48fb3908681618fdfd11cb8",
"total_discounts": "0.00",
"total_line_items_price": "24.87",
"total_outstanding": "0.00",
"total_price": "44.87",
"total_price_usd": "29.86",
"total_tax": "0.00",
"total_tip_received": "0.00",
"total_weight": 0,
"updated_at": "2023-03-28T00:50:11-04:00",
"billing_address": {
"address1": "test",
"city": "test",
"zip": "78601",
"country": "Pakistan",
"last_name": "Siddiqui",
"name": "Siddiqui",
"country_code": "PK"
},
"customer": {
"id": 5969354489922,
"accepts_marketing": false,
"created_at": "2023-03-27T18:09:49-04:00",
"updated_at": "2023-03-27T23:16:50-04:00",
"last_name": "Siddiqui",
"state": "disabled",
"verified_email": true,
"tax_exempt": false,
"phone": "+923032320964",
"sms_marketing_consent": {
"state": "not_subscribed",
"opt_in_level": "single_opt_in",
"consent_collected_from": "SHOPIFY"
},
"currency": "AUD",
"accepts_marketing_updated_at": "2023-03-27T23:16:50-04:00",
"default_address": {
"id": 7363751346242,
"customer_id": 5969354489922,
"last_name": "Siddiqui",
"address1": "test",
"city": "test",
"country": "Pakistan",
"zip": "78601",
"name": "Siddiqui",
"country_code": "PK",
"country_name": "Pakistan",
"default": true
}
},
"line_items": [
{
"id": 12241758912578,
"fulfillable_quantity": 0,
"fulfillment_service": "manual",
"gift_card": false,
"grams": 0,
"name": "Classic Nato Strap Watch - CH 0222",
"price": "24.87",
"product_exists": true,
"product_id": 1413102731330,
"quantity": 1,
"requires_shipping": true,
"sku": "1097285-ch-0222",
"taxable": false,
"title": "Classic Nato Strap Watch",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "AUD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "AUD"
}
},
"variant_id": 12535576133698,
"variant_inventory_management": "shopify",
"variant_title": "CH 0222",
"vendor": "hapans"
}
],
"shipping_address": {
"address1": "test",
"city": "test",
"zip": "78601",
"country": "Pakistan",
"last_name": "Siddiqui",
"name": "Siddiqui",
"country_code": "PK"
}
} |
Pedido pagado
Este webhook se activa cada vez que el pedido se marca desde la consola de administración de Shopify.
El payload de respuesta devuelve el siguiente JSON.
| {
"id": 4862145101890,
"app_id": 5092638721,
"browser_ip": "119.160.34.14",
"buyer_accepts_marketing": false,
"checkout_id": 31435950030914,
"checkout_token": "3b34065898c1c679e0283b3c8c7d5da0",
"confirmed": true,
"created_at": "2023-03-27T23:16:50-04:00",
"currency": "AUD",
"current_subtotal_price": "24.87",
"current_total_discounts": "0.00",
"current_total_price": "44.87",
"current_total_tax": "0.00",
"customer_locale": "en",
"estimated_taxes": false,
"financial_status": "paid",
"gateway": "Cash on Delivery (COD)",
"location_id": 5833621570,
"name": "#1044",
"note": "f12372u15376836",
"number": 44,
"order_number": 1044,
"order_status_url": "Thank you! - CONNECTDOTS DEMO STORE - Checkout ",
"payment_gateway_names": [
"Cash on Delivery (COD)"
],
"phone": "+923032320964",
"processed_at": "2023-03-27T23:16:49-04:00",
"processing_method": "manual",
"reference": "a05cd2354ac4540796e3fe1e3c161553",
"source_identifier": "a05cd2354ac4540796e3fe1e3c161553",
"source_name": "5092638721",
"subtotal_price": "24.87",
"taxes_included": false,
"test": false,
"token": "de745afb0f9e4ce033d41035ddd1f58c",
"total_discounts": "0.00",
"total_line_items_price": "24.87",
"total_outstanding": "0.00",
"total_price": "44.87",
"total_price_usd": "29.86",
"total_tax": "0.00",
"total_tip_received": "0.00",
"total_weight": 0,
"updated_at": "2023-03-28T00:42:02-04:00",
"billing_address": {
"address1": "test",
"city": "test",
"zip": "78601",
"country": "Pakistan",
"last_name": "Siddiqui",
"name": "Siddiqui",
"country_code": "PK"
},
"customer": {
"id": 5969354489922,
"accepts_marketing": false,
"created_at": "2023-03-27T18:09:49-04:00",
"updated_at": "2023-03-27T23:16:50-04:00",
"last_name": "Siddiqui",
"state": "disabled",
"verified_email": true,
"tax_exempt": false,
"phone": "+923032320964",
"sms_marketing_consent": {
"state": "not_subscribed",
"opt_in_level": "single_opt_in",
"consent_collected_from": "SHOPIFY"
},
"currency": "AUD",
"accepts_marketing_updated_at": "2023-03-27T23:16:50-04:00",
"default_address": {
"id": 7363751346242,
"customer_id": 5969354489922,
"last_name": "Siddiqui",
"address1": "test",
"city": "test",
"country": "Pakistan",
"zip": "78601",
"name": "Siddiqui",
"country_code": "PK",
"country_name": "Pakistan",
"default": true
}
},
"line_items": [
{
"id": 12241816059970,
"fulfillable_quantity": 1,
"fulfillment_service": "manual",
"gift_card": false,
"grams": 0,
"name": "Classic Nato Strap Watch - CH 0221",
"price": "24.87",
"product_exists": true,
"product_id": 1413102731330,
"quantity": 1,
"requires_shipping": true,
"sku": "1097285-ch-0221",
"taxable": false,
"title": "Classic Nato Strap Watch",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "AUD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "AUD"
}
},
"variant_id": 12535576723522,
"variant_inventory_management": "shopify",
"variant_title": "CH 0221",
"vendor": "hapans"
}
],
"shipping_address": {
"address1": "test",
"city": "test",
"zip": "78601",
"country": "Pakistan",
"last_name": "Siddiqui",
"name": "Siddiqui",
"country_code": "PK"
}
} |
Pedido completado
Este webhook se activa cada vez que el pedido se completa desde la consola de administración de Shopify. Devuelve información como los detalles del pedido y el seguimiento del envío de los comerciantes, etc.
El payload de respuesta devuelve el siguiente JSON.
| {
"id": 4862145101890,
"app_id": 5092638721,
"browser_ip": "119.160.34.14",
"buyer_accepts_marketing": false,
"checkout_id": 31435950030914,
"checkout_token": "3b34065898c1c679e0283b3c8c7d5da0",
"closed_at": "2023-03-28T00:47:58-04:00",
"confirmed": true,
"created_at": "2023-03-27T23:16:50-04:00",
"currency": "AUD",
"current_subtotal_price": "24.87",
"current_total_discounts": "0.00",
"current_total_price": "44.87",
"current_total_tax": "0.00",
"customer_locale": "en",
"estimated_taxes": false,
"financial_status": "paid",
"fulfillment_status": "fulfilled",
"gateway": "Cash on Delivery (COD)",
"location_id": 5833621570,
"name": "#1044",
"note": "f12372u15376836",
"number": 44,
"order_number": 1044,
"order_status_url": "Thank you! - CONNECTDOTS DEMO STORE - Checkout ",
"payment_gateway_names": [
"Cash on Delivery (COD)"
],
"phone": "+923032320964",
"processed_at": "2023-03-27T23:16:49-04:00",
"processing_method": "manual",
"reference": "a05cd2354ac4540796e3fe1e3c161553",
"source_identifier": "a05cd2354ac4540796e3fe1e3c161553",
"source_name": "5092638721",
"subtotal_price": "24.87",
"taxes_included": false,
"test": false,
"token": "de745afb0f9e4ce033d41035ddd1f58c",
"total_discounts": "0.00",
"total_line_items_price": "24.87",
"total_outstanding": "0.00",
"total_price": "44.87",
"total_price_usd": "29.86",
"total_tax": "0.00",
"total_tip_received": "0.00",
"total_weight": 0,
"updated_at": "2023-03-28T00:47:58-04:00",
"billing_address": {
"address1": "test",
"city": "test",
"zip": "78601",
"country": "Pakistan",
"last_name": "Siddiqui",
"name": "Siddiqui",
"country_code": "PK"
},
"customer": {
"id": 5969354489922,
"accepts_marketing": false,
"created_at": "2023-03-27T18:09:49-04:00",
"updated_at": "2023-03-27T23:16:50-04:00",
"last_name": "Siddiqui",
"state": "disabled",
"verified_email": true,
"tax_exempt": false,
"phone": "+923032320964",
"sms_marketing_consent": {
"state": "not_subscribed",
"opt_in_level": "single_opt_in",
"consent_collected_from": "SHOPIFY"
},
"currency": "AUD",
"accepts_marketing_updated_at": "2023-03-27T23:16:50-04:00",
"default_address": {
"id": 7363751346242,
"customer_id": 5969354489922,
"last_name": "Siddiqui",
"address1": "test",
"city": "test",
"country": "Pakistan",
"zip": "78601",
"name": "Siddiqui",
"country_code": "PK",
"country_name": "Pakistan",
"default": true
}
},
"fulfillments": [
{
"id": 4365623230530,
"created_at": "2023-03-28T00:47:58-04:00",
"location_id": 5833621570,
"name": "#1044.1",
"order_id": 4862145101890,
"service": "manual",
"status": "success",
"tracking_company": "Bonds",
"tracking_number": "23123123",
"tracking_numbers": [
"23123123"
],
"tracking_url": "Bonds Express Couriers ",
"tracking_urls": [
"Bonds Express Couriers "
],
"updated_at": "2023-03-28T00:47:58-04:00",
"line_items": [
{
"id": 12241816059970,
"fulfillable_quantity": 0,
"fulfillment_service": "manual",
"fulfillment_status": "fulfilled",
"gift_card": false,
"grams": 0,
"name": "Classic Nato Strap Watch - CH 0221",
"price": "24.87",
"product_exists": true,
"product_id": 1413102731330,
"quantity": 1,
"requires_shipping": true,
"sku": "1097285-ch-0221",
"taxable": false,
"title": "Classic Nato Strap Watch",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "AUD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "AUD"
}
},
"variant_id": 12535576723522,
"variant_inventory_management": "shopify",
"variant_title": "CH 0221",
"vendor": "hapans"
}
]
}
],
"line_items": [
{
"id": 12241816059970,
"fulfillable_quantity": 0,
"fulfillment_service": "manual",
"fulfillment_status": "fulfilled",
"gift_card": false,
"grams": 0,
"name": "Classic Nato Strap Watch - CH 0221",
"price": "24.87",
"product_exists": true,
"product_id": 1413102731330,
"quantity": 1,
"requires_shipping": true,
"sku": "1097285-ch-0221",
"taxable": false,
"title": "Classic Nato Strap Watch",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "AUD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "AUD"
}
},
"variant_id": 12535576723522,
"variant_inventory_management": "shopify",
"variant_title": "CH 0221",
"vendor": "hapans"
}
],
"shipping_address": {
"address1": "test",
"city": "test",
"zip": "78601",
"country": "Pakistan",
"last_name": "Siddiqui",
"name": "Siddiqui",
"country_code": "PK"
}
} |
Creación de pedido borrador
El webhook se activa cada vez que se crea un pedido borrador, ya sea mediante una llamada API a través del bot o directamente desde la consola de administración de Shopify.
Un punto importante aquí es que el trigger usa la información personal proporcionada por Shopify al crear el pedido borrador para hacer coincidir al usuario del bot dentro de OneChat. Si la información proporcionada en el payload es incorrecta o no existe, el payload simplemente se desperdicia sin que el trigger se active.
Se recibe el siguiente payload de respuesta cada vez que el trigger se activa correctamente.
| {
"id": 932436770882,
"taxes_included": false,
"currency": "AUD",
"created_at": "2023-04-10T12:51:09-04:00",
"updated_at": "2023-04-10T12:51:09-04:00",
"tax_exempt": false,
"name": "#D142",
"status": "open",
"line_items": [
{
"id": 57423868919874,
"variant_id": 12535571710018,
"product_id": 1413101748290,
"title": "Tetris Console iPhone Case",
"variant_title": "White / For IP 6 6s",
"sku": "12686347-white-for-ip-6-6s",
"vendor": "hapans",
"quantity": 1,
"requires_shipping": true,
"taxable": false,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 0,
"name": "Tetris Console iPhone Case - White / For IP 6 6s",
"custom": false,
"price": "25.60"
}
],
"shipping_address": {
"address1": "test",
"city": "test",
"country": "Pakistan",
"last_name": "Siddiqui",
"latitude": 30.375321,
"longitude": 69.34511599999999,
"name": "Siddiqui",
"country_code": "PK"
},
"billing_address": {
"address1": "test",
"city": "test",
"country": "Pakistan",
"last_name": "Siddiqui",
"latitude": 30.375321,
"longitude": 69.34511599999999,
"name": "Siddiqui",
"country_code": "PK"
},
"invoice_url": "https://connectdots-demo-store.myshopify.com/1763672130/invoices/ba420962c10eb92c52c0d933afae8d19",
"total_price": "25.60",
"subtotal_price": "25.60",
"total_tax": "0.00",
"payment_terms": {
"id": 5674041410,
"payment_terms_name": "Due on receipt",
"payment_terms_type": "receipt",
"created_at": "2023-04-10T12:51:09-04:00",
"updated_at": "2023-04-10T12:51:09-04:00"
},
"customer": {
"id": 5969354489922,
"accepts_marketing": false,
"created_at": "2023-03-27T18:09:49-04:00",
"updated_at": "2023-04-09T22:08:00-04:00",
"last_name": "Siddiqui",
"orders_count": 23,
"state": "disabled",
"total_spent": "1322.87",
"last_order_id": 4881087299650,
"verified_email": true,
"tax_exempt": false,
"last_order_name": "#1065",
"currency": "AUD",
"phone": "+923032320964",
"accepts_marketing_updated_at": "2023-04-09T22:08:00-04:00",
"sms_marketing_consent": {
"state": "not_subscribed",
"opt_in_level": "single_opt_in",
"consent_collected_from": "SHOPIFY"
},
"default_address": {
"id": 7364628021314,
"customer_id": 5969354489922,
"last_name": "Siddiqui",
"address1": "test",
"city": "test",
"country": "Pakistan",
"name": "Siddiqui",
"country_code": "PK",
"country_name": "Pakistan",
"default": true
}
}
} |
Creación de usuarios con triggers
El webhook identifica a los usuarios usando el número de teléfono y la dirección de correo electrónico, y luego los compara con los usuarios del bot ya existentes. Si no se encuentran usuarios del bot, entonces se usa el número de teléfono para crear al usuario. Si el número de teléfono se devuelve como null, entonces se usa el correo electrónico para crear al usuario. Cuando los usuarios se crean usando números de teléfono, se crean por defecto en el canal de WhatsApp, y cuando se crean usando correo electrónico, se crean en el canal web.