Skip to main content

Enrich Order API Integration Guide

Updated over 3 months ago

The Enrich Order API allows you to programmatically send historical or real-time order data from your e-commerce platform into WorkMagic. This enables enhanced attribution, sales analysis, and profitability insights within the WorkMagic platform.

Why Use the Enrich Order API?

The Enrich Order API is designed to modify existing order data that has already been retrieved from an integrated sales channel (e.g., Shopify, Amazon, TikTok Shop). It does not support uploading new orders from non-integrated platforms.

Its primary function is to override specific fields (such as sales and profit) for orders that already exist in WorkMagic’s system. This is particularly useful for correcting errors or filling in missing financial data that may not have been available at the time of the initial sync.

The key benefits include:

  • Ensuring data accuracy: Accurate sales and profit values are critical for downstream performance calculations.

  • Improving metric reliability: Metrics like ROAS (Return on Ad Spend) and POAS (Profit on Ad Spend) rely on correct and timely order data.

  • Targeted adjustments: Requires an existing order_id, ensuring only verified orders are modified rather than introduced from external systems.

By maintaining clean and accurate order data, the Enrich Order API helps uphold the integrity of your lift tests, channel attribution, and marketing ROI analysis.

How It Works

1. Authentication

Use your WorkMagic API key from Settings > Store Data Settings > Enrich Order API tab.

  • For first time use, you need to click "Generate new API key"

  • Click "Copy" to copy the existing key.

  • Use this key as a Bearer token in the Authorization header of your API requests.

  • You can also click "Generate new API key" if needed.

Note: Orders enriched yesterday or today appear after the next data refresh. Orders older than 4 weeks automatic application is not supported.

📤 Enriching Orders: POST /enrich/orders

To submit new or updated orders:

Endpoint

POST https://api.workmagic.io/enrich/orders

Headers

Authorization: Bearer <your-api-key> Content-Type: application/json

Sample Body

{ "orders": [ { "order_id": "ORDER12345", "order_timestamp": "2025-06-10T20:19:00Z", "sales_amount": 269.94, "profit_amount": -65.40, "currency": "USD" } ] }
  • order_id: Unique identifier.

  • order_timestamp: In ISO 8601 format.

  • sales_amount and profit_amount: Can be 0, but should reflect reality.

  • currency: Optional, defaults to USD.

The sample above might not be updated, please refer to POST /enrich/orders in the WorkMagic API docs.

📥 Retrieve Uploaded Orders: GET /enrich/orders

You can fetch previously uploaded orders to verify upload status or check for discrepancies.

Endpoint

GET https://api.workmagic.io/enrich/orders

Query Parameters

  • start: Start timestamp (ISO 8601)

  • end: End timestamp (ISO 8601)

  • limit: Max results (optional, default 100)

Example

curl -X GET 'https://api.workmagic.io/enrich/orders?start=2025-06-01T00:00:00Z&end=2025-06-11T23:59:59Z' \ -H 'Authorization: Bearer <your-api-key>'

The sample above might not be updated, please refer to GET /enrich/orders in the API docs for full usage.

Trendline View

In Settings > Store Data Settings > Enrich Order API, you can:

  • View order sync trends from the past 7 days.

  • Inspect individual orders: creation time, original vs. updated sales/profit.

  • Export API requests per day or review failed uploads.

Troubleshooting & Data Accuracy

To ensure consistency between your source data and WorkMagic's reporting:

Common Discrepancies

  • Zeroed out "Updated Sales" and "Updated Profit"

  • Timezone mismatches

  • API errors or partial responses

Troubleshooting Steps

  1. Check time range filters on the dashboard.

  2. Compare order IDs and timestamps between WorkMagic and your own system.

  3. Verify timezones - WorkMagic and your source should match.

  4. Review API status using the “View API request” logs on the dashboard.

  5. Contact support if issues persist.

Best Practices

  • Sync orders daily or hourly for real-time tracking.

  • Ensure all IDs are unique to prevent duplication.

  • Don’t send orders older than 4 weeks unless coordinating with support.

  • Use the GET /enrich/orders endpoint to verify syncing post-upload.

Did this answer your question?