Skip to content

Sync & Integration Errors

This guide helps administrators and integration developers diagnose failures when EGKits exchanges data with external systems via REST API, webhooks, scheduled imports, or middleware connectors. Symptoms include partial imports, duplicate records, HTTP 4xx/5xx responses, and webhook retry exhaustion.

#Integration architecture overview

External System  <--REST API-->  EGKits Tenant
       ^                              |
       |         Webhooks             |
       +------------------------------+
Channel Direction Typical use
REST API Bidirectional CRUD on master data and transactions
Webhooks EGKits → external Event notifications (invoice posted, payment received)
CSV import External → EGKits Bulk master data and opening balances
Scheduled jobs Platform internal Retry queues, e-invoice submission

#Before you begin

Item Location
API key or OAuth client Administration > API Keys
Webhook endpoint URLs Administration > Integrations > Webhooks
Import job history Administration > Data Import > Logs
API request logs Analytics > Audit Trail (filter by API)
Platform API version API Reference

Ensure clocks are synchronized (NTP) on integration servers — timestamp skew causes signature validation failures.

#Symptom: HTTP 401 Unauthorized

#Diagnostic steps

  1. Verify API key is active and not expired.
  2. Confirm Authorization header format: Bearer {token} or documented scheme.
  3. Check key scopes include the target module (for example invoicing:write).
  4. Regenerate key if compromised; update all calling systems.

#Resolution matrix

Error detail Action
invalid_token Refresh OAuth token; verify client secret
insufficient_scope Add required scope to API key or role
tenant_mismatch Ensure base URL matches key's tenant
Works in Postman, fails in app Compare headers; check for truncated key in config

#Symptom: HTTP 400 Bad Request / validation errors

#Diagnostic steps

  1. Parse response body — EGKits returns field-level validation messages.
  2. Compare payload against API Reference schema for the endpoint version.
  3. Verify required foreign keys exist (customer ID, product SKU, GL account code).
  4. Check date formats (ISO 8601) and decimal precision for amounts.
  5. Confirm fiscal period is open for financial transactions.

#Resolution matrix

Validation message Action
Customer not found Create or import customer first; use correct external ID mapping
Duplicate document number Use idempotency key or platform numbering — do not hard-code numbers
Tax code invalid Sync tax master data before invoice lines
Period closed Change document date or open period in GL
Required field missing Add field per schema; check API version changelog

#Symptom: HTTP 429 Rate limit exceeded

#Diagnostic steps

  1. Review Retry-After response header.
  2. Inspect integration batch size — reduce concurrent requests.
  3. Implement exponential backoff in client code.
  4. Contact account manager if sustained throughput exceeds tier limits.

#Resolution matrix

Pattern Action
Burst on hourly schedule Spread requests over window
Pagination loop too fast Add delay between pages
Multiple systems same key Issue separate keys per integration

#Symptom: Webhook not received or failing

#Diagnostic steps

  1. Open Administration > Integrations > Webhooks and review delivery log.
  2. Confirm endpoint URL is HTTPS with valid TLS certificate.
  3. Verify webhook secret matches HMAC validation on receiver.
  4. Check receiver returns HTTP 2xx within timeout (default 30 seconds).
  5. Inspect retry count — exhausted retries mark event as dead letter.

#Resolution matrix

Delivery status Action
Connection refused Fix firewall; allow EGKits egress IPs
SSL handshake failed Renew certificate; enable TLS 1.2+
401 on receiver Update receiver auth; verify signature header
Timeout Optimize receiver processing; acknowledge async
Success but no processing Debug receiver application logs

#Symptom: CSV import partial failure

#Diagnostic steps

  1. Download import result log with row numbers and error messages.
  2. Validate CSV encoding (UTF-8 with BOM for Arabic text).
  3. Confirm column headers match template exactly.
  4. Check for duplicate natural keys (SKU, customer code, account code).
  5. Re-import failed rows only after correction.

#Resolution matrix

Log message Action
Invalid account type Use seeded COA types; do not invent codes
Duplicate key Remove duplicate rows; merge in source system
Reference not found Import dependencies first (COA before balances)
Character encoding error Save CSV as UTF-8; avoid Excel auto-format on codes
Row limit exceeded Split file; use API for large volumes

#Symptom: Duplicate or missing records after sync

#Diagnostic steps

  1. Verify idempotency keys on create operations (API clients).
  2. Check for retry logic that replays POST without idempotency.
  3. Review external ID mapping table in middleware.
  4. Compare record counts between systems using reconciliation reports.
  5. Inspect Audit Trail for duplicate create events with same correlation ID.

#Resolution matrix

Pattern Action
Duplicates on network retry Implement idempotency-key header
Missing updates Use PATCH with etag/version check
Deletes not propagating Confirm soft-delete vs. hard-delete API behavior
Orphan lines on header failure Wrap in transaction; use composite API if available

#Monitoring and prevention

Practice Benefit
Dead-letter queue for webhooks Manual replay without data loss
Daily reconciliation job Early detection of drift
Staging tenant for integration tests Safe schema and version validation
Version pin in API clients Avoid breaking changes on platform upgrade

#Escalation checklist

  1. Tenant URL and integration name.
  2. HTTP status code and full response body (redact secrets).
  3. Sample request payload (anonymized).
  4. Webhook delivery ID or import batch ID.
  5. Timestamp range of failures.

Reconnecting to the server…

Please wait, or reload the page.