Best Practices

This section covers proven patterns and recommendations for building reliable, performant, and maintainable shop and marketplace integrations.

General Principles

Idempotency

Design your sync operations to be idempotent — running the same operation twice should produce the same result. This is critical because:

  • Webhooks may be delivered more than once

  • Queue items may be retried after failures

  • Users may manually trigger re-syncs

Fail Gracefully

A single failed sync should not block other operations. If one article fails to sync, continue with the next one. Track failures individually so they can be debugged and retried.

Be Defensive

Never trust external data blindly:

  • Validate data from the platform before importing to the ERP

  • Handle missing or unexpected fields

  • Sanitize strings to prevent injection issues

Keep State Minimal

Store only what you need to maintain sync state:

  • External IDs for entity matching

  • Timestamps for incremental sync

  • Error records for debugging

Avoid duplicating ERP or platform data in your own storage.

Last updated

Was this helpful?