Skip to main content

API Communication Logging

Overview​

Shopify Connect includes comprehensive logging of all API communications between Business Central and Shopify. This helps troubleshoot integration issues, audit data exchanges, and monitor API usage.

Prerequisites​

None - logging functionality is available immediately after installation.

Configuration​

Task 1: Configure Logging Mode​

  1. Choose the 🔎 icon, enter Shopify Setup, and then choose the related link.

  2. On the General fastTab, set Logging Mode:

    • Error Only - Log only API errors (recommended for production)

    • All - Log all API requests and responses (use for troubleshooting)

    • Disabled - No logging (not recommended)

      image-20251021-174335.png

  3. Press OK to save.

Recommendations:

  • Use All during initial setup and testing

  • Switch to Error Only for production to reduce database growth

  • Use All temporarily when troubleshooting issues

Viewing Log Entries​

Task 1: Open Log Entries List​

  1. Choose the 🔎 icon, enter Shopify Log Entries, and then choose the related link.

  2. The list shows:

    • Entry No. - Unique log entry number

    • Created - Date and time of API call

    • User ID - User who triggered the action

    • Request Type - HTTP method (POST, PATCH, DELETE)

    • Type - Message (success) or Error

    • Request Data - Shows "(BLOB)" if contains request JSON

    • Response Data - Shows "(BLOB)" if contains response JSON

      image-20251021-174416.png

  3. Filter entries by:

    • Date range using Created field

    • Type = Error to see only errors

    • User ID to see logs for specific user

    • Request Type to see specific operations

Task 2: View Log Entry Details​

  1. In Shopify Log Entries list, select an entry and press Enter or double-click.

  2. The Shopify Log Entry Card opens showing:

    • Header information (Entry No., Created, User ID, Request Type, Type)

    • Request Viewer factbox - Formatted JSON request sent to Shopify

    • Response Viewer factbox - Formatted JSON response received from Shopify

      image-20251021-174505.png

  3. Use the JSON viewers to:

    • Expand/collapse JSON nodes

    • Copy specific values

    • Analyze request parameters

    • Review error messages

Task 3: Download Request/Response​

  1. In Shopify Log Entry Card, press Actions → Functions

  2. Select:

    • Download Request - Save request JSON as text file

    • Download Response - Save response JSON as text file

      image-20251021-174542.png

  3. Choose location and filename to save.

  4. Open file in text editor or JSON viewer for detailed analysis.

Understanding Log Entries​

Successful API Calls​

Type: Message

Characteristics:

  • Response Data contains valid JSON

  • HTTP status code 200-299 (not shown, but implied by success)

Example Request Types:

  • POST - Creating data (products, customers, fulfillments)

  • PATCH - Updating data

  • DELETE - Deleting data

Failed API Calls​

Type: Error

Common Error Scenarios:

Authentication Error​

Symptoms: Response contains "Unauthorized" or "401"

Solutions:

  • Verify API Token is correct

  • Check Shopify custom app is installed

  • Verify API scopes are configured

Rate Limiting​

Symptoms: Response contains "429" or "Throttled"

Solutions:

  • System automatically retries after delay

  • Reduce Job Queue frequency

  • Spread operations over time

Invalid Data​

Symptoms: Response contains "422" or validation errors

Solutions:

  • Review Request Data for invalid values

  • Check field mappings

  • Ensure required Shopify fields are populated

Connection Error​

Symptoms: Response is empty or contains timeout message

Solutions:

  • Check internet connectivity

  • Verify API Url is correct

  • Check firewall settings

Log Maintenance​

Task 1: Delete Old Entries​

  1. Choose the 🔎 icon, enter Shopify Log Entries, and then choose the related link.

  2. Press Delete Entries Older Than 7 Days

    image-20251021-174609.png

  3. Press Yes to confirm.

  4. All log entries older than 7 days will be deleted.

Note: You can change the number of days by modifying the action parameter.

Task 2: Delete All Entries​

  1. In Shopify Log Entries list, press Delete All Entries

  2. Press Yes to confirm.

  3. All log entries will be deleted.

Warning: This action cannot be undone. Export important logs before deleting.

Troubleshooting with Logs​

Scenario 1: Order Not Importing​

Steps:

  1. Open Shopify Log Entries

  2. Filter by Created = today

  3. Look for entries with Request Type = POST containing "order" or "fulfillment"

  4. Open log entry and check:

    • Request Data - Verify query parameters and filters

    • Response Data - Check if orders were returned by Shopify

  5. Common issues:

    • Response shows empty orders array → No orders match filters

    • Error in response → Check error message for details

    • Order already has JML Shopify Document ID → Already imported

Scenario 2: Item Export Failing​

Steps:

  1. Open Shopify Log Entries

  2. Filter by Type = Error

  3. Look for entries with "product" or "variant" in request

  4. Open log entry and check Response Data for error details

  5. Common issues:

    • "Collection not found" → Item Category not mapped to Shopify Collection

    • "Invalid price" → Price is negative or zero

    • "SKU already exists" → Duplicate SKU in Shopify

Scenario 3: Customer Not Created​

Steps:

  1. Open Shopify Log Entries

  2. Look for POST requests with "customer" in request

  3. Check Response Data for:

    • Success → Customer created, check if email matches

    • Error → Review error message (e.g., "Email already taken")

Best Practices​

  1. Regular Monitoring:

    • Review error logs daily

    • Set Logging Mode = Error Only in production

    • Delete old logs periodically

  2. Troubleshooting:

    • Switch to Logging Mode = All when investigating issues

    • Export important logs before deleting

    • Compare successful vs. failed requests

  3. Performance:

    • Keep log table size under control

    • Delete logs older than 30 days

    • Disable logging only if absolutely necessary

  4. Security:

    • Logs may contain sensitive data (customer info, prices)

    • Restrict access to Shopify Log Entries page

    • Follow data retention policies

Common Issues​

Problem: Log entries not created​

Solution:

  • Check Logging Mode is not Disabled

  • Verify user has permissions for "JML Shopify Log Entry" table

  • Check if Job Queue is running with correct user credentials

Problem: Request/Response data shows "(BLOB)" but JSON viewer is empty​

Solution:

  • Data may be corrupted

  • Try Download Request/Response to save as file

  • Check if log entry was created during system upgrade

Problem: Too many log entries, database growing​

Solution:

  • Switch Logging Mode from All to Error Only

  • Run Delete Entries Older Than 7 Days regularly

  • Set up automated cleanup job

Problem: Cannot find logs for specific operation​

Solution:

  • Check Created date filter

  • Check User ID - logs are recorded with the user who triggered action

  • Check if Logging Mode was Disabled at the time