On this page

A recovery job should find purchases the integration has not handled, not create a second path that awards everything it can retrieve. The distinction matters when a webhook subscription fails, a worker is unavailable or a deployment leaves a gap in local processing history.

Imagine a hypothetical merchant whose integration missed part of an afternoon while a queue configuration was wrong. The team wants to recover the affected orders. A broad script that loops through all recent purchases and calls a reward operation directly could duplicate existing awards and apply today’s campaign rules to yesterday’s purchases.

Define the recovery window and authorized order query

Start with evidence of the gap. Record the trusted shop, suspected start and end, affected event or processing stage and the reason the window was chosen. A recovery window is a bounded investigation scope, not an invitation to retrieve all customer history.

Shopify’s webhook troubleshooting guidance describes delivery diagnostics and failure handling. Use the available platform evidence together with local processing records to establish what may have been missed. Shopify webhook troubleshooting

The fictional merchant identifies a possible gap from 14:00 to 15:30. The recovery design may include a reviewed overlap before and after that interval to account for timing ambiguity. The overlap is a testable operational choice, not a universal Shopify requirement.

Choose the source query according to the gap. If the missing work concerns newly created orders, the relevant window differs from a gap in order updates. Querying only creation time can miss an older purchase that changed during the incident. State which source timestamp or supported filter represents the recovery question.

Use authorized order access and the selected stable API version. For larger permitted datasets, Shopify’s GraphQL bulk query workflow can support asynchronous retrieval. The query and output handling must follow the actual supported contract and access scope. Shopify bulk query operations

A recovery specification can record:

Item Hypothetical decision
Shop One verified merchant connection
Suspected gap Afternoon processing interruption
Source question Orders created or changed in the reviewed interval
Query scope Only fields needed to identify and normalize candidates
Overlap Explicit reviewed boundary around the gap
Output Candidate references, not direct issuance requests
Resume point Durable cursor or batch checkpoint

Do not widen the query simply because a field is unavailable. If the current permission cannot retrieve the relevant history, record that limitation and use the approved recovery alternative. Missing access is not evidence that no orders were affected.

Compare source records with processed references

The comparison should distinguish several local states. An order may be absent from local storage, present but unevaluated, evaluated with no reward, associated with a completed award or linked to an unresolved external attempt. Only the first two are obvious candidates for ordinary evaluation recovery, and even they need current state checks.

For the hypothetical afternoon, suppose the authorized source query returns 120 order references. Local records show 100 fully evaluated, 12 present but waiting on a failed normalization step, five absent and three with unresolved provider outcomes. The recovery list is not simply “20 orders need rewards.” It contains different tasks with different permissions.

A filled comparison table makes the distinction visible:

Local state Count in the example Recovery treatment
Evaluation established 100 Preserve existing result
Input processing failed 12 Review corrected normalization and replay eligibility
Purchase absent locally 5 Import through the normal verified evaluation path
External outcome unresolved 3 Resolve existing operation before any retry

The counts total 120. They are fictional and illustrate classification, not a reported merchant incident.

Compare by trusted shop and stable purchase reference. A human-readable order name or customer email can collide or change. The recovery job should use the same identity model as normal processing so it does not create a new local purchase merely because it discovered the order through a different path.

Retain the source query definition and its completeness status. A partial bulk result or interrupted pagination sequence should not be reported as a complete reconciliation. Record which pages or output segments were processed and which remain outstanding.

A difficult case is an order that changed after the incident window but before the backfill runs. The current source record may differ from the state that would have been evaluated originally. The approved campaign timing and historical evidence rules determine the correct evaluation. The recovery script must not silently apply the current campaign version merely because it is easiest to load.

Reprocess omissions through the existing idempotent path

Recovery should feed candidate work into the same controlled normalization, evaluation and operation identity model used by ordinary processing. A separate script that bypasses those gates may appear faster but creates a second set of rules precisely when the data is already uncertain.

An original recovery sequence is:

load_bounded_authorized_source_window()
compare_each_purchase_with_durable_local_state()
classify_candidate_recovery_action()
produce_dry_run_with_expected_state_changes()
approve_the_bounded_batch_under_operational_authority()
replay_through_existing_idempotent_evaluation_path()
compare_actual_results_with_dry_run_expectations()

This is pseudocode for a proposed recovery tool, not a RebateCardX API. The approval mentioned is the merchant’s operational control for the recovery batch, not a request to the reader to approve an action in this article.

The dry run should predict record-level outcomes. For the five absent purchases, it might predict five normalized purchase records and evaluation tasks, not five issued cards. For the twelve failed inputs, it should show which corrected fields now permit evaluation. The three unknown provider operations stay outside ordinary replay until their existing outcomes are resolved.

Set stop conditions before running the batch. Examples include an unexpected increase in candidate count, a currency mismatch, a conflicting operation fingerprint or a source query that no longer matches the documented window. The conditions should address the actual recovery risk rather than become an unrelated general checklist.

Run a small initial subset and compare the observed local states with the dry run. If they agree, continue under the reviewed batch scope. If the first recovered order unexpectedly creates a second award reference, stop and investigate the identity boundary before processing the remainder.

Preserve progress durably. If the recovery worker stops after processing part of the window, it should resume from a known checkpoint and reuse the existing operation identities. Restarting the command should not make every previously handled candidate look new.

Finish with a reconciliation record: source references examined, candidates classified, evaluations recovered, existing results preserved, unresolved cases remaining and evidence that the query completed. For the fictional 120-order window, the final report should still explain the three unknown provider outcomes rather than hiding them inside a success count.

The practical result is a controlled backfill that repairs a specific processing gap while preserving the original purchase and reward history. It restores missing work without turning recovery into a new, uncontrolled award campaign.

After recovery, rerun the same bounded comparison without changing the source query. The expected result is that already recovered purchases no longer appear as new omissions, while the separately classified unresolved cases remain visible. This second comparison is a meaningful completion check because it tests whether the backfill repaired the durable processing record. It should not repeat the financial operation. Retain both comparison summaries with the recovery reference so a later investigator can distinguish successful repair from a job that merely finished running without establishing the missing state.

Request technical access to plan an authorized order-completeness recovery path.

Request technical access

Source references

Back to contents

General information only

This guide is general information, not financial, legal, tax or regulatory advice. Eligibility, card availability, permitted use and responsibilities depend on the applicable offer and card terms.