[2025-07-01 04:41:00] [INFO] === NEW SAMPLE ORDER REQUEST STARTED === [2025-07-01 04:41:00] [DEBUG] Request method: POST [2025-07-01 04:41:00] [DEBUG] Request time: 2025-07-01 04:41:00 [2025-07-01 04:41:00] [SUCCESS] Order data validation passed [2025-07-01 04:41:01] [INFO] === STARTING KLAVIYO PRE-REGISTRATION STEP === [2025-07-01 04:41:01] [INFO] === KLAVIYO PRE-REGISTRATION STARTED === [2025-07-01 04:41:01] [INFO] Pre-registering provider in Klaviyo... [2025-07-01 04:41:01] [DEBUG] Email: appsettle.testing@gmail.com [2025-07-01 04:41:01] [DEBUG] NPI: 1003002809 [2025-07-01 04:41:01] [DEBUG] Debug mode: OFF [2025-07-01 04:41:01] [DEBUG] Calling sendToKlaviyoDirect function... [2025-07-01 04:41:01] [DEBUG] Searching for existing profile with email: appsettle.testing@gmail.com [2025-07-01 04:41:01] [INFO] Profile already exists for email: appsettle.testing@gmail.com (ID: 01JZ24BSJBHJZ2T7EYRHD9R5R3) [2025-07-01 04:41:01] [DEBUG] Updating profile: 01JZ24BSJBHJZ2T7EYRHD9R5R3 [2025-07-01 04:41:01] [SUCCESS] Successfully updated existing profile for NPI: 1003002809 [2025-07-01 04:41:01] [DEBUG] Adding profile to list: UDxLYa [2025-07-01 04:41:01] [SUCCESS] Successfully added profile to list [2025-07-01 04:41:01] [INFO] Subscribing profile 01JZ24BSJBHJZ2T7EYRHD9R5R3 for email marketing on list UDxLYa [2025-07-01 04:41:01] [SUCCESS] Successfully subscribed profile 01JZ24BSJBHJZ2T7EYRHD9R5R3 for email marketing (HTTP 202) [2025-07-01 04:41:01] [INFO] Klaviyo Pre-Registration Step Result: {"success":true,"message":"Provider pre-registered in Klaviyo successfully","profile_created":true} [2025-07-01 04:41:01] [SUCCESS] Klaviyo pre-registration completed successfully [2025-07-01 04:41:01] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 04:41:01] [DEBUG] Input phone: '525548220939' [2025-07-01 04:41:01] [DEBUG] Cleaned phone (digits only): '525548220939' [2025-07-01 04:41:01] [DEBUG] Testing phone formatting patterns for: 525548220939 (length: 12) [2025-07-01 04:41:01] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 04:41:01] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 04:41:01] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-01 04:41:01] [DEBUG] Pattern matched! Formatted result: +525548220939 [2025-07-01 04:41:01] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 04:41:01] [DEBUG] Input phone: '525548220939' [2025-07-01 04:41:01] [DEBUG] Cleaned phone (digits only): '525548220939' [2025-07-01 04:41:01] [DEBUG] Testing phone formatting patterns for: 525548220939 (length: 12) [2025-07-01 04:41:01] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 04:41:01] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 04:41:01] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-01 04:41:01] [DEBUG] Pattern matched! Formatted result: +525548220939 [2025-07-01 04:41:01] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 04:41:01] [DEBUG] Input phone: '525548220939' [2025-07-01 04:41:01] [DEBUG] Cleaned phone (digits only): '525548220939' [2025-07-01 04:41:01] [DEBUG] Testing phone formatting patterns for: 525548220939 (length: 12) [2025-07-01 04:41:01] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 04:41:01] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 04:41:01] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-01 04:41:01] [DEBUG] Pattern matched! Formatted result: +525548220939 [2025-07-01 04:41:02] [ERROR] === CRITICAL ERROR IN MAIN FLOW === [2025-07-01 04:41:02] [ERROR] Exception: Failed to create Shopify order: Shopify API error: HTTP 422 - customer: Phone number has already been taken [2025-07-01 04:41:02] [ERROR] Stack trace: #0 {main} [2025-07-01 04:41:02] [DEBUG] Extracting user-friendly error from: Failed to create Shopify order: Shopify API error: HTTP 422 - customer: Phone number has already been taken [2025-07-01 04:41:56] [INFO] === NEW SAMPLE ORDER REQUEST STARTED === [2025-07-01 04:41:56] [DEBUG] Request method: POST [2025-07-01 04:41:56] [DEBUG] Request time: 2025-07-01 04:41:56 [2025-07-01 04:41:56] [SUCCESS] Order data validation passed [2025-07-01 04:41:56] [INFO] === STARTING KLAVIYO PRE-REGISTRATION STEP === [2025-07-01 04:41:56] [INFO] === KLAVIYO PRE-REGISTRATION STARTED === [2025-07-01 04:41:56] [INFO] Pre-registering provider in Klaviyo... [2025-07-01 04:41:56] [DEBUG] Email: appsettle.testing@gmail.com [2025-07-01 04:41:56] [DEBUG] NPI: 1003002809 [2025-07-01 04:41:56] [DEBUG] Debug mode: OFF [2025-07-01 04:41:56] [DEBUG] Calling sendToKlaviyoDirect function... [2025-07-01 04:41:56] [DEBUG] Searching for existing profile with email: appsettle.testing@gmail.com [2025-07-01 04:41:56] [INFO] Profile already exists for email: appsettle.testing@gmail.com (ID: 01JZ24BSJBHJZ2T7EYRHD9R5R3) [2025-07-01 04:41:56] [DEBUG] Updating profile: 01JZ24BSJBHJZ2T7EYRHD9R5R3 [2025-07-01 04:41:56] [SUCCESS] Successfully updated existing profile for NPI: 1003002809 [2025-07-01 04:41:56] [DEBUG] Adding profile to list: UDxLYa [2025-07-01 04:41:56] [SUCCESS] Successfully added profile to list [2025-07-01 04:41:56] [INFO] Subscribing profile 01JZ24BSJBHJZ2T7EYRHD9R5R3 for email marketing on list UDxLYa [2025-07-01 04:41:56] [SUCCESS] Successfully subscribed profile 01JZ24BSJBHJZ2T7EYRHD9R5R3 for email marketing (HTTP 202) [2025-07-01 04:41:56] [INFO] Klaviyo Pre-Registration Step Result: {"success":true,"message":"Provider pre-registered in Klaviyo successfully","profile_created":true} [2025-07-01 04:41:56] [SUCCESS] Klaviyo pre-registration completed successfully [2025-07-01 04:41:56] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 04:41:56] [DEBUG] Input phone: '525548220939' [2025-07-01 04:41:56] [DEBUG] Cleaned phone (digits only): '525548220939' [2025-07-01 04:41:56] [DEBUG] Testing phone formatting patterns for: 525548220939 (length: 12) [2025-07-01 04:41:56] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 04:41:56] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 04:41:56] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-01 04:41:56] [DEBUG] Pattern matched! Formatted result: +525548220939 [2025-07-01 04:41:56] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 04:41:56] [DEBUG] Input phone: '525548220939' [2025-07-01 04:41:56] [DEBUG] Cleaned phone (digits only): '525548220939' [2025-07-01 04:41:56] [DEBUG] Testing phone formatting patterns for: 525548220939 (length: 12) [2025-07-01 04:41:56] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 04:41:56] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 04:41:56] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-01 04:41:56] [DEBUG] Pattern matched! Formatted result: +525548220939 [2025-07-01 04:41:56] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 04:41:56] [DEBUG] Input phone: '525548220939' [2025-07-01 04:41:56] [DEBUG] Cleaned phone (digits only): '525548220939' [2025-07-01 04:41:56] [DEBUG] Testing phone formatting patterns for: 525548220939 (length: 12) [2025-07-01 04:41:56] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 04:41:56] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 04:41:56] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-01 04:41:56] [DEBUG] Pattern matched! Formatted result: +525548220939 [2025-07-01 04:41:57] [ERROR] === CRITICAL ERROR IN MAIN FLOW === [2025-07-01 04:41:57] [ERROR] Exception: Failed to create Shopify order: Shopify API error: HTTP 422 - customer: Phone number has already been taken [2025-07-01 04:41:57] [ERROR] Stack trace: #0 {main} [2025-07-01 04:41:57] [DEBUG] Extracting user-friendly error from: Failed to create Shopify order: Shopify API error: HTTP 422 - customer: Phone number has already been taken [2025-07-01 04:42:10] [INFO] === NEW SAMPLE ORDER REQUEST STARTED === [2025-07-01 04:42:10] [DEBUG] Request method: POST [2025-07-01 04:42:10] [DEBUG] Request time: 2025-07-01 04:42:10 [2025-07-01 04:42:10] [SUCCESS] Order data validation passed [2025-07-01 04:42:10] [INFO] === STARTING KLAVIYO PRE-REGISTRATION STEP === [2025-07-01 04:42:10] [INFO] === KLAVIYO PRE-REGISTRATION STARTED === [2025-07-01 04:42:10] [INFO] Pre-registering provider in Klaviyo... [2025-07-01 04:42:10] [DEBUG] Email: appsettle.testing@gmail.com [2025-07-01 04:42:10] [DEBUG] NPI: 1003002809 [2025-07-01 04:42:10] [DEBUG] Debug mode: OFF [2025-07-01 04:42:10] [DEBUG] Calling sendToKlaviyoDirect function... [2025-07-01 04:42:10] [DEBUG] Searching for existing profile with email: appsettle.testing@gmail.com [2025-07-01 04:42:10] [INFO] Profile already exists for email: appsettle.testing@gmail.com (ID: 01JZ24BSJBHJZ2T7EYRHD9R5R3) [2025-07-01 04:42:10] [DEBUG] Updating profile: 01JZ24BSJBHJZ2T7EYRHD9R5R3 [2025-07-01 04:42:11] [SUCCESS] Successfully updated existing profile for NPI: 1003002809 [2025-07-01 04:42:11] [DEBUG] Adding profile to list: UDxLYa [2025-07-01 04:42:11] [SUCCESS] Successfully added profile to list [2025-07-01 04:42:11] [INFO] Subscribing profile 01JZ24BSJBHJZ2T7EYRHD9R5R3 for email marketing on list UDxLYa [2025-07-01 04:42:11] [SUCCESS] Successfully subscribed profile 01JZ24BSJBHJZ2T7EYRHD9R5R3 for email marketing (HTTP 202) [2025-07-01 04:42:11] [INFO] Klaviyo Pre-Registration Step Result: {"success":true,"message":"Provider pre-registered in Klaviyo successfully","profile_created":true} [2025-07-01 04:42:11] [SUCCESS] Klaviyo pre-registration completed successfully [2025-07-01 04:42:11] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 04:42:11] [DEBUG] Input phone: '525548220944' [2025-07-01 04:42:11] [DEBUG] Cleaned phone (digits only): '525548220944' [2025-07-01 04:42:11] [DEBUG] Testing phone formatting patterns for: 525548220944 (length: 12) [2025-07-01 04:42:11] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 04:42:11] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 04:42:11] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-01 04:42:11] [DEBUG] Pattern matched! Formatted result: +525548220944 [2025-07-01 04:42:11] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 04:42:11] [DEBUG] Input phone: '525548220944' [2025-07-01 04:42:11] [DEBUG] Cleaned phone (digits only): '525548220944' [2025-07-01 04:42:11] [DEBUG] Testing phone formatting patterns for: 525548220944 (length: 12) [2025-07-01 04:42:11] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 04:42:11] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 04:42:11] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-01 04:42:11] [DEBUG] Pattern matched! Formatted result: +525548220944 [2025-07-01 04:42:11] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 04:42:11] [DEBUG] Input phone: '525548220944' [2025-07-01 04:42:11] [DEBUG] Cleaned phone (digits only): '525548220944' [2025-07-01 04:42:11] [DEBUG] Testing phone formatting patterns for: 525548220944 (length: 12) [2025-07-01 04:42:11] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 04:42:11] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 04:42:11] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-01 04:42:11] [DEBUG] Pattern matched! Formatted result: +525548220944 [2025-07-01 04:42:12] [INFO] === APPSTLE REGISTRATION STARTED === [2025-07-01 04:42:12] [INFO] Registering sample order in Appstle... [2025-07-01 04:42:12] [DEBUG] Order Type: One-time [2025-07-01 04:42:12] [DEBUG] Appstle payload: { "shop": "c0a52c-4.myshopify.com", "order_id": 6338102919456, "order_number": 1649, "customer_email": "appsettle.testing@gmail.com", "npi_number": "1003002809", "practice_name": "test", "provider_type": "PEDI", "order_type": "sample_request", "subscription_plan_id": null, "metadata": { "source": "Eosera Sample Checkout", "npi_verified": true, "free_samples": true, "subscription_enabled": false, "order_date": "2025-06-30T23:42:11-05:00", "products_requested": { "epmd": true, "eimd": false, "ewmd": true } } } [2025-07-01 04:42:12] [DEBUG] Appstle API Response: HTTP 401 [2025-07-01 04:42:12] [DEBUG] Appstle Response Body: {"type":"https://www.jhipster.tech/problem/problem-with-message","title":"Unauthorized","status":401,"detail":"Full authentication is required to access this resource","path":"/api/v1/sample-orders","message":"error.http.401"} [2025-07-01 04:42:12] [ERROR] Appstle authentication failed - check API key [2025-07-01 04:42:12] [INFO] Updating Klaviyo profile with order information... [2025-07-01 04:42:12] [DEBUG] Searching for existing profile with email: appsettle.testing@gmail.com [2025-07-01 04:42:12] [INFO] Profile already exists for email: appsettle.testing@gmail.com (ID: 01JZ24BSJBHJZ2T7EYRHD9R5R3) [2025-07-01 04:42:12] [DEBUG] Updating profile: 01JZ24BSJBHJZ2T7EYRHD9R5R3 [2025-07-01 04:42:13] [SUCCESS] Successfully updated existing profile for NPI: 1003002809 [2025-07-01 04:42:13] [DEBUG] Adding profile to list: UDxLYa [2025-07-01 04:42:13] [SUCCESS] Successfully added profile to list [2025-07-01 04:42:13] [INFO] Subscribing profile 01JZ24BSJBHJZ2T7EYRHD9R5R3 for email marketing on list UDxLYa [2025-07-01 04:42:13] [SUCCESS] Successfully subscribed profile 01JZ24BSJBHJZ2T7EYRHD9R5R3 for email marketing (HTTP 202) [2025-07-01 04:42:13] [INFO] === PREPARING FINAL RESPONSE === [2025-07-01 04:42:13] [SUCCESS] Order created successfully - Order ID: 6338102919456 [2025-07-01 04:42:13] [INFO] Final integration results: [2025-07-01 04:42:13] [INFO] Klaviyo pre-registered: YES [2025-07-01 04:42:13] [INFO] Appstle registered: NO [2025-07-01 04:42:13] [INFO] Klaviyo order updated: YES [2025-07-01 04:42:13] [DEBUG] Final response: {"success":true,"message":"Sample order created successfully","order_number":1649,"order_id":6338102919456,"npi_verification":{"valid":true,"provider_info":{"created_epoch":"1189867560000","enumeration_type":"NPI-1","last_updated_epoch":"1630339761000","number":"1003002809","addresses":[{"country_code":"US","country_name":"United States","address_purpose":"MAILING","address_type":"DOM","address_1":"45 W 11TH ST","address_2":"APT 1A","city":"NEW YORK","state":"NY","postal_code":"100118664"},{"country_code":"US","country_name":"United States","address_purpose":"LOCATION","address_type":"DOM","address_1":"45 W 11TH ST","address_2":"APT 1A","city":"NEW YORK","state":"NY","postal_code":"100118664","telephone_number":"646-407-2044"}],"practiceLocations":[],"basic":{"first_name":"VINCENT","last_name":"GRAZIANO","credential":"MD","sole_proprietor":"YES","sex":"M","enumeration_date":"2007-09-15","last_updated":"2021-08-30","certification_date":"2021-08-30","status":"A","name_prefix":"Dr."},"taxonomies":[{"code":"2085R0202X","taxonomy_group":"","desc":"Radiology, Diagnostic Radiology","state":"NJ","license":"25MA08712100","primary":false},{"code":"2085R0202X","taxonomy_group":"","desc":"Radiology, Diagnostic Radiology","state":"NY","license":"00243641","primary":true}],"identifiers":[],"endpoints":[],"other_names":[]}},"klaviyo_pre_registered":true,"appstle_registered":false,"klaviyo_order_updated":true} [2025-07-01 14:05:32] [INFO] === NEW SAMPLE ORDER REQUEST STARTED === [2025-07-01 14:05:32] [DEBUG] Request method: POST [2025-07-01 14:05:32] [DEBUG] Request time: 2025-07-01 14:05:32 [2025-07-01 14:05:32] [SUCCESS] Order data validation passed [2025-07-01 14:05:32] [INFO] === STARTING KLAVIYO PRE-REGISTRATION STEP === [2025-07-01 14:05:32] [INFO] === KLAVIYO PRE-REGISTRATION STARTED === [2025-07-01 14:05:32] [INFO] Pre-registering provider in Klaviyo... [2025-07-01 14:05:32] [DEBUG] Email: kimberlyfoli@gmail.com [2025-07-01 14:05:32] [DEBUG] NPI: 1003002809 [2025-07-01 14:05:32] [DEBUG] Debug mode: OFF [2025-07-01 14:05:32] [DEBUG] Calling sendToKlaviyoDirect function... [2025-07-01 14:05:32] [DEBUG] Searching for existing profile with email: kimberlyfoli@gmail.com [2025-07-01 14:05:32] [INFO] Profile already exists for email: kimberlyfoli@gmail.com (ID: 01JWCMF6QZ0EWQBQ9KAEQR5RZ6) [2025-07-01 14:05:32] [DEBUG] Updating profile: 01JWCMF6QZ0EWQBQ9KAEQR5RZ6 [2025-07-01 14:05:32] [SUCCESS] Successfully updated existing profile for NPI: 1003002809 [2025-07-01 14:05:32] [DEBUG] Adding profile to list: UDxLYa [2025-07-01 14:05:32] [SUCCESS] Successfully added profile to list [2025-07-01 14:05:32] [INFO] Subscribing profile 01JWCMF6QZ0EWQBQ9KAEQR5RZ6 for email marketing on list UDxLYa [2025-07-01 14:05:33] [SUCCESS] Successfully subscribed profile 01JWCMF6QZ0EWQBQ9KAEQR5RZ6 for email marketing (HTTP 202) [2025-07-01 14:05:33] [INFO] Klaviyo Pre-Registration Step Result: {"success":true,"message":"Provider pre-registered in Klaviyo successfully","profile_created":true} [2025-07-01 14:05:33] [SUCCESS] Klaviyo pre-registration completed successfully [2025-07-01 14:05:33] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 14:05:33] [DEBUG] Input phone: '8658505995' [2025-07-01 14:05:33] [DEBUG] Cleaned phone (digits only): '8658505995' [2025-07-01 14:05:33] [DEBUG] Testing phone formatting patterns for: 8658505995 (length: 10) [2025-07-01 14:05:33] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 14:05:33] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 14:05:33] [DEBUG] Pattern matched! Formatted result: +18658505995 [2025-07-01 14:05:33] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 14:05:33] [DEBUG] Input phone: '8658505995' [2025-07-01 14:05:33] [DEBUG] Cleaned phone (digits only): '8658505995' [2025-07-01 14:05:33] [DEBUG] Testing phone formatting patterns for: 8658505995 (length: 10) [2025-07-01 14:05:33] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 14:05:33] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 14:05:33] [DEBUG] Pattern matched! Formatted result: +18658505995 [2025-07-01 14:05:33] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-01 14:05:33] [DEBUG] Input phone: '8658505995' [2025-07-01 14:05:33] [DEBUG] Cleaned phone (digits only): '8658505995' [2025-07-01 14:05:33] [DEBUG] Testing phone formatting patterns for: 8658505995 (length: 10) [2025-07-01 14:05:33] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-01 14:05:33] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-01 14:05:33] [DEBUG] Pattern matched! Formatted result: +18658505995 [2025-07-01 14:05:34] [INFO] === APPSTLE REGISTRATION STARTED === [2025-07-01 14:05:34] [INFO] Registering sample order in Appstle... [2025-07-01 14:05:34] [DEBUG] Order Type: One-time [2025-07-01 14:05:34] [DEBUG] Appstle payload: { "shop": "c0a52c-4.myshopify.com", "order_id": 6338621669664, "order_number": 1651, "customer_email": "kimberlyfoli@gmail.com", "npi_number": "1003002809", "practice_name": "hi", "provider_type": "Other", "order_type": "sample_request", "subscription_plan_id": null, "metadata": { "source": "Eosera Sample Checkout", "npi_verified": true, "free_samples": true, "subscription_enabled": false, "order_date": "2025-07-01T09:05:33-05:00", "products_requested": { "epmd": true, "eimd": false, "ewmd": false } } } [2025-07-01 14:05:34] [DEBUG] Appstle API Response: HTTP 401 [2025-07-01 14:05:34] [DEBUG] Appstle Response Body: {"type":"https://www.jhipster.tech/problem/problem-with-message","title":"Unauthorized","status":401,"detail":"Full authentication is required to access this resource","path":"/api/v1/sample-orders","message":"error.http.401"} [2025-07-01 14:05:34] [ERROR] Appstle authentication failed - check API key [2025-07-01 14:05:34] [INFO] Updating Klaviyo profile with order information... [2025-07-01 14:05:34] [DEBUG] Searching for existing profile with email: kimberlyfoli@gmail.com [2025-07-01 14:05:34] [INFO] Profile already exists for email: kimberlyfoli@gmail.com (ID: 01JWCMF6QZ0EWQBQ9KAEQR5RZ6) [2025-07-01 14:05:34] [DEBUG] Updating profile: 01JWCMF6QZ0EWQBQ9KAEQR5RZ6 [2025-07-01 14:05:34] [SUCCESS] Successfully updated existing profile for NPI: 1003002809 [2025-07-01 14:05:34] [DEBUG] Adding profile to list: UDxLYa [2025-07-01 14:05:34] [SUCCESS] Successfully added profile to list [2025-07-01 14:05:34] [INFO] Subscribing profile 01JWCMF6QZ0EWQBQ9KAEQR5RZ6 for email marketing on list UDxLYa [2025-07-01 14:05:35] [SUCCESS] Successfully subscribed profile 01JWCMF6QZ0EWQBQ9KAEQR5RZ6 for email marketing (HTTP 202) [2025-07-01 14:05:35] [INFO] === PREPARING FINAL RESPONSE === [2025-07-01 14:05:35] [SUCCESS] Order created successfully - Order ID: 6338621669664 [2025-07-01 14:05:35] [INFO] Final integration results: [2025-07-01 14:05:35] [INFO] Klaviyo pre-registered: YES [2025-07-01 14:05:35] [INFO] Appstle registered: NO [2025-07-01 14:05:35] [INFO] Klaviyo order updated: YES [2025-07-01 14:05:35] [DEBUG] Final response: {"success":true,"message":"Sample order created successfully","order_number":1651,"order_id":6338621669664,"npi_verification":{"valid":true,"provider_info":{"created_epoch":"1189867560000","enumeration_type":"NPI-1","last_updated_epoch":"1630339761000","number":"1003002809","addresses":[{"country_code":"US","country_name":"United States","address_purpose":"MAILING","address_type":"DOM","address_1":"45 W 11TH ST","address_2":"APT 1A","city":"NEW YORK","state":"NY","postal_code":"100118664"},{"country_code":"US","country_name":"United States","address_purpose":"LOCATION","address_type":"DOM","address_1":"45 W 11TH ST","address_2":"APT 1A","city":"NEW YORK","state":"NY","postal_code":"100118664","telephone_number":"646-407-2044"}],"practiceLocations":[],"basic":{"first_name":"VINCENT","last_name":"GRAZIANO","credential":"MD","sole_proprietor":"YES","sex":"M","enumeration_date":"2007-09-15","last_updated":"2021-08-30","certification_date":"2021-08-30","status":"A","name_prefix":"Dr."},"taxonomies":[{"code":"2085R0202X","taxonomy_group":"","desc":"Radiology, Diagnostic Radiology","state":"NJ","license":"25MA08712100","primary":false},{"code":"2085R0202X","taxonomy_group":"","desc":"Radiology, Diagnostic Radiology","state":"NY","license":"00243641","primary":true}],"identifiers":[],"endpoints":[],"other_names":[]}},"klaviyo_pre_registered":true,"appstle_registered":false,"klaviyo_order_updated":true} [2025-07-02 03:04:59] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-02 03:04:59] [INFO] Debug mode: OFF [2025-07-02 03:04:59] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-02 03:04:59] [INFO] Klaviyo List ID: UDxLYa [2025-07-02 03:04:59] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-02 03:04:59] [INFO] Teléfono de prueba: +15255492291 [2025-07-02 03:04:59] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-02 03:04:59] [DEBUG] API Response - HTTP Code: 200 [2025-07-02 03:04:59] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-01T03:33:03+00:00","last_event_date":"2025-07-01T03:32:53+00:00","location":{"address1":null,"country":null,"address2":null,"latitude":null,"city":null,"region":null [2025-07-02 03:04:59] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-02 03:04:59] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-02 03:04:59] [INFO] Agregando perfil a lista: UDxLYa [2025-07-02 03:05:00] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-02 03:05:00] [DEBUG] Agregar a lista - Response: [2025-07-02 03:05:00] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-02 03:05:00] [INFO] Probando suscripción de email simplificada... [2025-07-02 03:05:00] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-02 03:05:00] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-02 03:05:00] [DEBUG] Suscripción email - Response: [2025-07-02 03:05:00] [SUCCESS] Suscripción de email exitosa [2025-07-02 03:05:00] [INFO] === RESUMEN DEL TEST === [2025-07-02 03:05:00] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-02 03:05:00] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-02 03:05:00] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-03 09:58:55] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-03 09:58:55] [INFO] Debug mode: OFF [2025-07-03 09:58:55] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-03 09:58:55] [INFO] Klaviyo List ID: UDxLYa [2025-07-03 09:58:55] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-03 09:58:55] [INFO] Teléfono de prueba: +15255492291 [2025-07-03 09:58:55] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-03 09:58:55] [DEBUG] API Response - HTTP Code: 200 [2025-07-03 09:58:55] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-02T03:05:01+00:00","last_event_date":"2025-07-02T03:05:00+00:00","location":{"region":null,"city":null,"country":null,"latitude":null,"longitude":null,"address2":nul [2025-07-03 09:58:55] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-03 09:58:55] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-03 09:58:55] [INFO] Agregando perfil a lista: UDxLYa [2025-07-03 09:58:55] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-03 09:58:55] [DEBUG] Agregar a lista - Response: [2025-07-03 09:58:55] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-03 09:58:55] [INFO] Probando suscripción de email simplificada... [2025-07-03 09:58:55] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-03 09:58:55] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-03 09:58:55] [DEBUG] Suscripción email - Response: [2025-07-03 09:58:55] [SUCCESS] Suscripción de email exitosa [2025-07-03 09:58:55] [INFO] === RESUMEN DEL TEST === [2025-07-03 09:58:55] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-03 09:58:55] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-03 09:58:55] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-03 16:32:20] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-03 16:32:20] [INFO] Debug mode: OFF [2025-07-03 16:32:20] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-03 16:32:20] [INFO] Klaviyo List ID: UDxLYa [2025-07-03 16:32:20] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-03 16:32:20] [INFO] Teléfono de prueba: +15255492291 [2025-07-03 16:32:20] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-03 16:32:20] [DEBUG] API Response - HTTP Code: 200 [2025-07-03 16:32:20] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-03T09:58:56+00:00","last_event_date":"2025-07-03T09:58:56+00:00","location":{"country":null,"address2":null,"address1":null,"city":null,"zip":null,"latitude":null,"l [2025-07-03 16:32:20] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-03 16:32:20] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-03 16:32:20] [INFO] Agregando perfil a lista: UDxLYa [2025-07-03 16:32:21] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-03 16:32:21] [DEBUG] Agregar a lista - Response: [2025-07-03 16:32:21] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-03 16:32:21] [INFO] Probando suscripción de email simplificada... [2025-07-03 16:32:21] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-03 16:32:21] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-03 16:32:21] [DEBUG] Suscripción email - Response: [2025-07-03 16:32:21] [SUCCESS] Suscripción de email exitosa [2025-07-03 16:32:21] [INFO] === RESUMEN DEL TEST === [2025-07-03 16:32:21] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-03 16:32:21] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-03 16:32:21] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-03 17:32:21] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-03 17:32:21] [INFO] Debug mode: OFF [2025-07-03 17:32:21] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-03 17:32:21] [INFO] Klaviyo List ID: UDxLYa [2025-07-03 17:32:21] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-03 17:32:21] [INFO] Teléfono de prueba: +15255492291 [2025-07-03 17:32:21] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-03 17:32:21] [DEBUG] API Response - HTTP Code: 200 [2025-07-03 17:32:21] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-03T16:32:21+00:00","last_event_date":"2025-07-03T16:32:21+00:00","location":{"city":null,"region":null,"country":null,"address1":null,"address2":null,"latitude":null [2025-07-03 17:32:21] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-03 17:32:21] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-03 17:32:21] [INFO] Agregando perfil a lista: UDxLYa [2025-07-03 17:32:21] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-03 17:32:21] [DEBUG] Agregar a lista - Response: [2025-07-03 17:32:21] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-03 17:32:21] [INFO] Probando suscripción de email simplificada... [2025-07-03 17:32:21] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-03 17:32:21] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-03 17:32:21] [DEBUG] Suscripción email - Response: [2025-07-03 17:32:21] [SUCCESS] Suscripción de email exitosa [2025-07-03 17:32:21] [INFO] === RESUMEN DEL TEST === [2025-07-03 17:32:21] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-03 17:32:21] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-03 17:32:21] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-04 12:54:52] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-04 12:54:52] [INFO] Debug mode: OFF [2025-07-04 12:54:52] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-04 12:54:52] [INFO] Klaviyo List ID: UDxLYa [2025-07-04 12:54:52] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 12:54:52] [INFO] Teléfono de prueba: +15255492291 [2025-07-04 12:54:52] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-04 12:54:52] [DEBUG] API Response - HTTP Code: 200 [2025-07-04 12:54:52] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-03T17:32:22+00:00","last_event_date":"2025-07-03T17:32:22+00:00","location":{"zip":null,"address1":null,"region":null,"city":null,"country":null,"address2":null,"lon [2025-07-04 12:54:52] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 12:54:52] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 12:54:52] [INFO] Agregando perfil a lista: UDxLYa [2025-07-04 12:54:52] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-04 12:54:52] [DEBUG] Agregar a lista - Response: [2025-07-04 12:54:52] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-04 12:54:52] [INFO] Probando suscripción de email simplificada... [2025-07-04 12:54:52] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-04 12:54:52] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-04 12:54:52] [DEBUG] Suscripción email - Response: [2025-07-04 12:54:52] [SUCCESS] Suscripción de email exitosa [2025-07-04 12:54:52] [INFO] === RESUMEN DEL TEST === [2025-07-04 12:54:52] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 12:54:52] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-04 12:54:52] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-04 15:18:09] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-04 15:18:09] [INFO] Debug mode: OFF [2025-07-04 15:18:09] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-04 15:18:09] [INFO] Klaviyo List ID: UDxLYa [2025-07-04 15:18:09] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 15:18:09] [INFO] Teléfono de prueba: +15255492291 [2025-07-04 15:18:09] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-04 15:18:09] [DEBUG] API Response - HTTP Code: 200 [2025-07-04 15:18:09] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-04T12:54:53+00:00","last_event_date":"2025-07-04T12:54:53+00:00","location":{"address2":null,"zip":null,"city":null,"country":null,"address1":null,"region":null,"lon [2025-07-04 15:18:09] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 15:18:09] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 15:18:09] [INFO] Agregando perfil a lista: UDxLYa [2025-07-04 15:18:09] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-04 15:18:09] [DEBUG] Agregar a lista - Response: [2025-07-04 15:18:09] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-04 15:18:09] [INFO] Probando suscripción de email simplificada... [2025-07-04 15:18:09] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-04 15:18:10] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-04 15:18:10] [DEBUG] Suscripción email - Response: [2025-07-04 15:18:10] [SUCCESS] Suscripción de email exitosa [2025-07-04 15:18:10] [INFO] === RESUMEN DEL TEST === [2025-07-04 15:18:10] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 15:18:10] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-04 15:18:10] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-04 15:18:17] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-04 15:18:17] [INFO] Debug mode: OFF [2025-07-04 15:18:17] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-04 15:18:17] [INFO] Klaviyo List ID: UDxLYa [2025-07-04 15:18:17] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 15:18:17] [INFO] Teléfono de prueba: +15255492291 [2025-07-04 15:18:17] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-04 15:18:17] [DEBUG] API Response - HTTP Code: 200 [2025-07-04 15:18:17] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-04T15:18:11+00:00","last_event_date":"2025-07-04T15:18:10+00:00","location":{"country":null,"region":null,"zip":null,"address1":null,"longitude":null,"latitude":null [2025-07-04 15:18:17] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 15:18:17] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 15:18:17] [INFO] Agregando perfil a lista: UDxLYa [2025-07-04 15:18:17] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-04 15:18:17] [DEBUG] Agregar a lista - Response: [2025-07-04 15:18:17] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-04 15:18:17] [INFO] Probando suscripción de email simplificada... [2025-07-04 15:18:17] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-04 15:18:17] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-04 15:18:17] [DEBUG] Suscripción email - Response: [2025-07-04 15:18:17] [SUCCESS] Suscripción de email exitosa [2025-07-04 15:18:17] [INFO] === RESUMEN DEL TEST === [2025-07-04 15:18:17] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 15:18:17] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-04 15:18:17] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-04 16:15:19] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-04 16:15:19] [INFO] Debug mode: OFF [2025-07-04 16:15:19] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-04 16:15:19] [INFO] Klaviyo List ID: UDxLYa [2025-07-04 16:15:19] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 16:15:19] [INFO] Teléfono de prueba: +15255492291 [2025-07-04 16:15:19] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-04 16:15:19] [DEBUG] API Response - HTTP Code: 200 [2025-07-04 16:15:19] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-04T15:18:18+00:00","last_event_date":"2025-07-04T15:18:18+00:00","location":{"region":null,"city":null,"country":null,"address2":null,"latitude":null,"longitude":nul [2025-07-04 16:15:19] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 16:15:19] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 16:15:19] [INFO] Agregando perfil a lista: UDxLYa [2025-07-04 16:15:19] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-04 16:15:19] [DEBUG] Agregar a lista - Response: [2025-07-04 16:15:19] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-04 16:15:19] [INFO] Probando suscripción de email simplificada... [2025-07-04 16:15:19] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-04 16:15:19] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-04 16:15:19] [DEBUG] Suscripción email - Response: [2025-07-04 16:15:19] [SUCCESS] Suscripción de email exitosa [2025-07-04 16:15:19] [INFO] === RESUMEN DEL TEST === [2025-07-04 16:15:19] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 16:15:19] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-04 16:15:19] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-04 17:08:50] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-04 17:08:50] [INFO] Debug mode: OFF [2025-07-04 17:08:50] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-04 17:08:50] [INFO] Klaviyo List ID: UDxLYa [2025-07-04 17:08:50] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 17:08:50] [INFO] Teléfono de prueba: +15255492291 [2025-07-04 17:08:50] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-04 17:08:50] [DEBUG] API Response - HTTP Code: 200 [2025-07-04 17:08:50] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-04T16:15:20+00:00","last_event_date":"2025-07-04T16:15:20+00:00","location":{"address2":null,"longitude":null,"city":null,"region":null,"latitude":null,"zip":null,"c [2025-07-04 17:08:50] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 17:08:50] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 17:08:50] [INFO] Agregando perfil a lista: UDxLYa [2025-07-04 17:08:51] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-04 17:08:51] [DEBUG] Agregar a lista - Response: [2025-07-04 17:08:51] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-04 17:08:51] [INFO] Probando suscripción de email simplificada... [2025-07-04 17:08:51] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-04 17:08:51] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-04 17:08:51] [DEBUG] Suscripción email - Response: [2025-07-04 17:08:51] [SUCCESS] Suscripción de email exitosa [2025-07-04 17:08:51] [INFO] === RESUMEN DEL TEST === [2025-07-04 17:08:51] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 17:08:51] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-04 17:08:51] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-04 17:08:58] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-04 17:08:58] [INFO] Debug mode: OFF [2025-07-04 17:08:58] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-04 17:08:58] [INFO] Klaviyo List ID: UDxLYa [2025-07-04 17:08:58] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 17:08:58] [INFO] Teléfono de prueba: +15255492291 [2025-07-04 17:08:58] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-04 17:08:58] [DEBUG] API Response - HTTP Code: 200 [2025-07-04 17:08:58] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-04T17:08:51+00:00","last_event_date":"2025-07-04T17:08:51+00:00","location":{"address1":null,"city":null,"country":null,"longitude":null,"latitude":null,"region":nul [2025-07-04 17:08:58] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 17:08:58] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-04 17:08:58] [INFO] Agregando perfil a lista: UDxLYa [2025-07-04 17:08:58] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-04 17:08:58] [DEBUG] Agregar a lista - Response: [2025-07-04 17:08:58] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-04 17:08:58] [INFO] Probando suscripción de email simplificada... [2025-07-04 17:08:58] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-04 17:08:58] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-04 17:08:58] [DEBUG] Suscripción email - Response: [2025-07-04 17:08:58] [SUCCESS] Suscripción de email exitosa [2025-07-04 17:08:58] [INFO] === RESUMEN DEL TEST === [2025-07-04 17:08:58] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-04 17:08:58] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-04 17:08:58] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-06 03:45:08] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-06 03:45:08] [INFO] Debug mode: OFF [2025-07-06 03:45:08] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-06 03:45:08] [INFO] Klaviyo List ID: UDxLYa [2025-07-06 03:45:08] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-06 03:45:08] [INFO] Teléfono de prueba: +15255492291 [2025-07-06 03:45:08] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-06 03:45:08] [DEBUG] API Response - HTTP Code: 200 [2025-07-06 03:45:08] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-04T17:08:59+00:00","last_event_date":"2025-07-04T17:08:59+00:00","location":{"zip":null,"latitude":null,"address1":null,"country":null,"address2":null,"city":null,"l [2025-07-06 03:45:08] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-06 03:45:08] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-06 03:45:08] [INFO] Agregando perfil a lista: UDxLYa [2025-07-06 03:45:09] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-06 03:45:09] [DEBUG] Agregar a lista - Response: [2025-07-06 03:45:09] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-06 03:45:09] [INFO] Probando suscripción de email simplificada... [2025-07-06 03:45:09] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-06 03:45:09] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-06 03:45:09] [DEBUG] Suscripción email - Response: [2025-07-06 03:45:09] [SUCCESS] Suscripción de email exitosa [2025-07-06 03:45:09] [INFO] === RESUMEN DEL TEST === [2025-07-06 03:45:09] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-06 03:45:09] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-06 03:45:09] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-08 00:02:13] [INFO] Iniciando test de funciones Klaviyo directas [2025-07-08 00:02:13] [INFO] Debug mode: OFF [2025-07-08 00:02:13] [INFO] Klaviyo API Key: Configurada (37 chars) [2025-07-08 00:02:13] [INFO] Klaviyo List ID: UDxLYa [2025-07-08 00:02:13] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-08 00:02:13] [INFO] Teléfono de prueba: +15255492291 [2025-07-08 00:02:13] [DEBUG] Buscando perfil para email: luigi.test.klaviyo@gmail.com [2025-07-08 00:02:13] [DEBUG] API Response - HTTP Code: 200 [2025-07-08 00:02:13] [DEBUG] API Response - Body: {"data":[{"type":"profile","id":"01JZ20PVDCX491KMTVW1R7M1YT","attributes":{"email":"luigi.test.klaviyo@gmail.com","phone_number":"+15255492291","external_id":null,"anonymous_id":null,"first_name":null,"last_name":null,"organization":null,"locale":"en","title":null,"image":null,"created":"2025-07-01T03:32:53+00:00","updated":"2025-07-06T03:45:09+00:00","last_event_date":"2025-07-06T03:45:09+00:00","location":{"longitude":null,"region":null,"address1":null,"zip":null,"address2":null,"latitude":nul [2025-07-08 00:02:13] [SUCCESS] Perfil encontrado: ID = 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-08 00:02:13] [INFO] Perfil ya existe, usando ID: 01JZ20PVDCX491KMTVW1R7M1YT [2025-07-08 00:02:13] [INFO] Agregando perfil a lista: UDxLYa [2025-07-08 00:02:13] [DEBUG] Agregar a lista - HTTP Code: 204 [2025-07-08 00:02:13] [DEBUG] Agregar a lista - Response: [2025-07-08 00:02:13] [SUCCESS] Perfil agregado a lista exitosamente [2025-07-08 00:02:13] [INFO] Probando suscripción de email simplificada... [2025-07-08 00:02:13] [DEBUG] Payload de suscripción: { "data": { "type": "profile-subscription-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "luigi.test.klaviyo@gmail.com", "subscriptions": { "email": { "marketing": { "consent": "SUBSCRIBED" } } } } } ] } }, "relationships": { "list": { "data": { "type": "list", "id": "UDxLYa" } } } } } [2025-07-08 00:02:14] [DEBUG] Suscripción email - HTTP Code: 202 [2025-07-08 00:02:14] [DEBUG] Suscripción email - Response: [2025-07-08 00:02:14] [SUCCESS] Suscripción de email exitosa [2025-07-08 00:02:14] [INFO] === RESUMEN DEL TEST === [2025-07-08 00:02:14] [INFO] Email de prueba: luigi.test.klaviyo@gmail.com [2025-07-08 00:02:14] [SUCCESS] Perfil encontrado/creado: SÍ (ID: 01JZ20PVDCX491KMTVW1R7M1YT) [2025-07-08 00:02:14] [SUCCESS] Configuración Klaviyo: COMPLETA [2025-07-10 19:03:50] [INFO] === NEW SAMPLE ORDER REQUEST STARTED === [2025-07-10 19:03:50] [DEBUG] Request method: POST [2025-07-10 19:03:50] [DEBUG] Request time: 2025-07-10 19:03:50 [2025-07-10 19:03:50] [SUCCESS] Order data validation passed [2025-07-10 19:03:50] [INFO] === STARTING KLAVIYO PRE-REGISTRATION STEP === [2025-07-10 19:03:50] [INFO] === KLAVIYO PRE-REGISTRATION STARTED === [2025-07-10 19:03:50] [INFO] Pre-registering provider in Klaviyo... [2025-07-10 19:03:50] [DEBUG] Email: luigi@icepick.co [2025-07-10 19:03:50] [DEBUG] NPI: 1003002809 [2025-07-10 19:03:50] [DEBUG] Debug mode: OFF [2025-07-10 19:03:50] [DEBUG] Calling sendToKlaviyoDirect function... [2025-07-10 19:03:50] [DEBUG] Selected products from order data: ["EAR PAIN MD","EAR WAX MD"] [2025-07-10 19:03:50] [DEBUG] Product selection - EPMD: Yes, EIMD: No, EWMD: Yes [2025-07-10 19:03:50] [DEBUG] Searching for existing profile with email: luigi@icepick.co [2025-07-10 19:03:50] [INFO] Profile already exists for email: luigi@icepick.co (ID: 01JZ223EGF907PXJBDQEAQXRVG) [2025-07-10 19:03:50] [DEBUG] Updating profile: 01JZ223EGF907PXJBDQEAQXRVG [2025-07-10 19:03:50] [SUCCESS] Successfully updated existing profile for NPI: 1003002809 [2025-07-10 19:03:50] [DEBUG] Adding profile to list: UDxLYa [2025-07-10 19:03:50] [SUCCESS] Successfully added profile to list [2025-07-10 19:03:50] [INFO] Subscribing profile 01JZ223EGF907PXJBDQEAQXRVG for email marketing on list UDxLYa [2025-07-10 19:03:51] [SUCCESS] Successfully subscribed profile 01JZ223EGF907PXJBDQEAQXRVG for email marketing (HTTP 202) [2025-07-10 19:03:51] [INFO] Klaviyo Pre-Registration Step Result: {"success":true,"message":"Provider pre-registered in Klaviyo successfully","profile_created":true} [2025-07-10 19:03:51] [SUCCESS] Klaviyo pre-registration completed successfully [2025-07-10 19:03:51] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-10 19:03:51] [DEBUG] Input phone: '525548220939' [2025-07-10 19:03:51] [DEBUG] Cleaned phone (digits only): '525548220939' [2025-07-10 19:03:51] [DEBUG] Testing phone formatting patterns for: 525548220939 (length: 12) [2025-07-10 19:03:51] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-10 19:03:51] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-10 19:03:51] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-10 19:03:51] [DEBUG] Pattern matched! Formatted result: +525548220939 [2025-07-10 19:03:51] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-10 19:03:51] [DEBUG] Input phone: '525548220939' [2025-07-10 19:03:51] [DEBUG] Cleaned phone (digits only): '525548220939' [2025-07-10 19:03:51] [DEBUG] Testing phone formatting patterns for: 525548220939 (length: 12) [2025-07-10 19:03:51] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-10 19:03:51] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-10 19:03:51] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-10 19:03:51] [DEBUG] Pattern matched! Formatted result: +525548220939 [2025-07-10 19:03:51] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-10 19:03:51] [DEBUG] Input phone: '525548220939' [2025-07-10 19:03:51] [DEBUG] Cleaned phone (digits only): '525548220939' [2025-07-10 19:03:51] [DEBUG] Testing phone formatting patterns for: 525548220939 (length: 12) [2025-07-10 19:03:51] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-10 19:03:51] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-10 19:03:51] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-10 19:03:51] [DEBUG] Pattern matched! Formatted result: +525548220939 [2025-07-10 19:03:51] [ERROR] === CRITICAL ERROR IN MAIN FLOW === [2025-07-10 19:03:51] [ERROR] Exception: Failed to create Shopify order: Shopify API error: HTTP 422 - customer: Phone number has already been taken [2025-07-10 19:03:51] [ERROR] Stack trace: #0 {main} [2025-07-10 19:03:51] [DEBUG] Extracting user-friendly error from: Failed to create Shopify order: Shopify API error: HTTP 422 - customer: Phone number has already been taken [2025-07-10 19:04:07] [INFO] === NEW SAMPLE ORDER REQUEST STARTED === [2025-07-10 19:04:07] [DEBUG] Request method: POST [2025-07-10 19:04:07] [DEBUG] Request time: 2025-07-10 19:04:07 [2025-07-10 19:04:07] [SUCCESS] Order data validation passed [2025-07-10 19:04:07] [INFO] === STARTING KLAVIYO PRE-REGISTRATION STEP === [2025-07-10 19:04:07] [INFO] === KLAVIYO PRE-REGISTRATION STARTED === [2025-07-10 19:04:07] [INFO] Pre-registering provider in Klaviyo... [2025-07-10 19:04:07] [DEBUG] Email: luigi@icepick.co [2025-07-10 19:04:07] [DEBUG] NPI: 1003002809 [2025-07-10 19:04:07] [DEBUG] Debug mode: OFF [2025-07-10 19:04:07] [DEBUG] Calling sendToKlaviyoDirect function... [2025-07-10 19:04:07] [DEBUG] Selected products from order data: ["EAR PAIN MD","EAR WAX MD"] [2025-07-10 19:04:07] [DEBUG] Product selection - EPMD: Yes, EIMD: No, EWMD: Yes [2025-07-10 19:04:07] [DEBUG] Searching for existing profile with email: luigi@icepick.co [2025-07-10 19:04:07] [INFO] Profile already exists for email: luigi@icepick.co (ID: 01JZ223EGF907PXJBDQEAQXRVG) [2025-07-10 19:04:07] [DEBUG] Updating profile: 01JZ223EGF907PXJBDQEAQXRVG [2025-07-10 19:04:07] [SUCCESS] Successfully updated existing profile for NPI: 1003002809 [2025-07-10 19:04:07] [DEBUG] Adding profile to list: UDxLYa [2025-07-10 19:04:07] [SUCCESS] Successfully added profile to list [2025-07-10 19:04:07] [INFO] Subscribing profile 01JZ223EGF907PXJBDQEAQXRVG for email marketing on list UDxLYa [2025-07-10 19:04:07] [SUCCESS] Successfully subscribed profile 01JZ223EGF907PXJBDQEAQXRVG for email marketing (HTTP 202) [2025-07-10 19:04:07] [INFO] Klaviyo Pre-Registration Step Result: {"success":true,"message":"Provider pre-registered in Klaviyo successfully","profile_created":true} [2025-07-10 19:04:07] [SUCCESS] Klaviyo pre-registration completed successfully [2025-07-10 19:04:07] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-10 19:04:07] [DEBUG] Input phone: '525548220901' [2025-07-10 19:04:07] [DEBUG] Cleaned phone (digits only): '525548220901' [2025-07-10 19:04:07] [DEBUG] Testing phone formatting patterns for: 525548220901 (length: 12) [2025-07-10 19:04:07] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-10 19:04:07] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-10 19:04:07] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-10 19:04:07] [DEBUG] Pattern matched! Formatted result: +525548220901 [2025-07-10 19:04:07] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-10 19:04:07] [DEBUG] Input phone: '525548220901' [2025-07-10 19:04:07] [DEBUG] Cleaned phone (digits only): '525548220901' [2025-07-10 19:04:07] [DEBUG] Testing phone formatting patterns for: 525548220901 (length: 12) [2025-07-10 19:04:07] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-10 19:04:07] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-10 19:04:07] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-10 19:04:07] [DEBUG] Pattern matched! Formatted result: +525548220901 [2025-07-10 19:04:07] [DEBUG] === formatPhoneNumber FUNCTION STARTED === [2025-07-10 19:04:07] [DEBUG] Input phone: '525548220901' [2025-07-10 19:04:07] [DEBUG] Cleaned phone (digits only): '525548220901' [2025-07-10 19:04:07] [DEBUG] Testing phone formatting patterns for: 525548220901 (length: 12) [2025-07-10 19:04:07] [DEBUG] Testing pattern: /^1(\d{10})$/ [2025-07-10 19:04:07] [DEBUG] Testing pattern: /^(\d{10})$/ [2025-07-10 19:04:07] [DEBUG] Testing pattern: /^52(\d{10})$/ [2025-07-10 19:04:07] [DEBUG] Pattern matched! Formatted result: +525548220901 [2025-07-10 19:04:08] [INFO] === APPSTLE REGISTRATION STARTED === [2025-07-10 19:04:08] [INFO] Registering sample order in Appstle using official endpoints... [2025-07-10 19:04:08] [DEBUG] Order Type: Subscription [2025-07-10 19:04:08] [DEBUG] Selling Plan ID: 7060062496 [2025-07-10 19:04:08] [INFO] Creating subscription contract for selling plan: 7060062496 [2025-07-10 19:04:08] [INFO] Creating Appstle subscription contract... [2025-07-10 19:04:09] [DEBUG] Subscription creation response: HTTP 405 [2025-07-10 19:04:09] [DEBUG] Response body: {"type":"https://www.jhipster.tech/problem/problem-with-message","title":"Method Not Allowed","status":405,"detail":"Request method 'POST' not supported","path":"/api/external/v2/subscription-contracts","message":"error.http.405"} [2025-07-10 19:04:09] [ERROR] ❌ Failed to create subscription: HTTP 405 - {"type":"https://www.jhipster.tech/problem/problem-with-message","title":"Method Not Allowed","status":405,"detail":"Request method 'POST' not supported","path":"/api/external/v2/subscription-contracts","message":"error.http.405"} [2025-07-10 19:04:09] [DEBUG] Appstle metadata (for tracking): { "shop": "c0a52c-4.myshopify.com", "order_id": 6352030728480, "order_number": 1679, "customer_email": "luigi@icepick.co", "npi_number": "1003002809", "practice_name": "Testing", "provider_type": "PEDI", "order_type": "subscription_sample", "subscription_plan_id": "7060062496", "metadata": { "source": "Eosera Sample Checkout", "npi_verified": true, "free_samples": true, "subscription_enabled": true, "order_date": "2025-07-10T14:04:08-05:00", "products_requested": { "epmd": true, "eimd": false, "ewmd": true } } } [2025-07-10 19:04:09] [INFO] Testing official Appstle endpoint: subscription-contract-details [2025-07-10 19:04:09] [DEBUG] 📡 Making API call to Official API v2 - Subscription Contracts: https://subscription-admin.appstle.com/api/external/v2/subscription-contract-details?page=0&size=20 [2025-07-10 19:04:09] [DEBUG] Auth Method: X-API-Key: Wh99U1CnCXNPKcWMhFwsQF9i9ccDnje3 [2025-07-10 19:04:09] [DEBUG] HTTP Method: GET [2025-07-10 19:04:09] [DEBUG] 📨 Official API v2 - Subscription Contracts Response: [2025-07-10 19:04:09] [DEBUG] HTTP Code: 200 [2025-07-10 19:04:09] [DEBUG] Response Body: [] [2025-07-10 19:04:09] [SUCCESS] ✅ SUCCESS: Official API v2 - Subscription Contracts - Endpoint accessible [2025-07-10 19:04:09] [INFO] Testing official Appstle endpoint: customer-subscriptions [2025-07-10 19:04:09] [DEBUG] 📡 Making API call to Official API v2 - Customer Subscriptions (Test): https://subscription-admin.appstle.com/api/external/v2/customer-subscriptions?customerId=test-customer [2025-07-10 19:04:09] [DEBUG] Auth Method: X-API-Key: Wh99U1CnCXNPKcWMhFwsQF9i9ccDnje3 [2025-07-10 19:04:09] [DEBUG] HTTP Method: GET [2025-07-10 19:04:09] [DEBUG] 📨 Official API v2 - Customer Subscriptions (Test) Response: [2025-07-10 19:04:09] [DEBUG] HTTP Code: 404 [2025-07-10 19:04:09] [DEBUG] Response Body: {"timestamp":"2025-07-10T19:04:09.420+00:00","status":404,"error":"Not Found","path":"/"} [2025-07-10 19:04:09] [ERROR] ❌ FAILED: Official API v2 - Customer Subscriptions (Test) - HTTP 404 [2025-07-10 19:04:09] [INFO] Appstle endpoint testing completed. Successful tests: 1/2 [2025-07-10 19:04:09] [INFO] Updating Klaviyo profile with order information... [2025-07-10 19:04:09] [DEBUG] Searching for existing profile with email: luigi@icepick.co [2025-07-10 19:04:09] [INFO] Profile already exists for email: luigi@icepick.co (ID: 01JZ223EGF907PXJBDQEAQXRVG) [2025-07-10 19:04:09] [DEBUG] Updating profile: 01JZ223EGF907PXJBDQEAQXRVG [2025-07-10 19:04:10] [SUCCESS] Successfully updated existing profile for NPI: 1003002809 [2025-07-10 19:04:10] [DEBUG] Adding profile to list: UDxLYa [2025-07-10 19:04:10] [SUCCESS] Successfully added profile to list [2025-07-10 19:04:10] [INFO] Subscribing profile 01JZ223EGF907PXJBDQEAQXRVG for email marketing on list UDxLYa [2025-07-10 19:04:10] [SUCCESS] Successfully subscribed profile 01JZ223EGF907PXJBDQEAQXRVG for email marketing (HTTP 202) [2025-07-10 19:04:10] [INFO] === PREPARING FINAL RESPONSE === [2025-07-10 19:04:10] [SUCCESS] Order created successfully - Order ID: 6352030728480 [2025-07-10 19:04:10] [INFO] Final integration results: [2025-07-10 19:04:10] [INFO] Klaviyo pre-registered: YES [2025-07-10 19:04:10] [INFO] Appstle registered: YES [2025-07-10 19:04:10] [INFO] Klaviyo order updated: YES [2025-07-10 19:04:10] [DEBUG] Final response: {"success":true,"message":"Sample order created successfully","order_number":1679,"order_id":6352030728480,"npi_verification":{"valid":true,"provider_info":{"created_epoch":"1189867560000","enumeration_type":"NPI-1","last_updated_epoch":"1630339761000","number":"1003002809","addresses":[{"country_code":"US","country_name":"United States","address_purpose":"MAILING","address_type":"DOM","address_1":"45 W 11TH ST","address_2":"APT 1A","city":"NEW YORK","state":"NY","postal_code":"100118664"},{"country_code":"US","country_name":"United States","address_purpose":"LOCATION","address_type":"DOM","address_1":"45 W 11TH ST","address_2":"APT 1A","city":"NEW YORK","state":"NY","postal_code":"100118664","telephone_number":"646-407-2044"}],"practiceLocations":[],"basic":{"first_name":"VINCENT","last_name":"GRAZIANO","credential":"MD","sole_proprietor":"YES","sex":"M","enumeration_date":"2007-09-15","last_updated":"2021-08-30","certification_date":"2021-08-30","status":"A","name_prefix":"Dr."},"taxonomies":[{"code":"2085R0202X","taxonomy_group":"","desc":"Radiology, Diagnostic Radiology","state":"NJ","license":"25MA08712100","primary":false},{"code":"2085R0202X","taxonomy_group":"","desc":"Radiology, Diagnostic Radiology","state":"NY","license":"00243641","primary":true}],"identifiers":[],"endpoints":[],"other_names":[]}},"klaviyo_pre_registered":true,"appstle_registered":true,"klaviyo_order_updated":true}