On this page

A reward reference can be valid and still belong to the wrong store or customer. Authentication establishes who is making a request; authorization determines whether that identity may access the requested record. A multi-store integration must carry that distinction through every data path, including caches and background jobs.

Imagine two hypothetical Shopify merchants whose visible order numbers both include 1050. A cache keyed only by that number can return one merchant’s reward status to the other. The database query may be correctly scoped, yet the cache shortcut has crossed the boundary before the query runs.

Derive shop and customer scope from trusted authentication

Establish tenant and viewer context from the supported authenticated integration mechanism. Do not let a browser parameter such as shop=store-b define the caller’s authority. The requested resource must be checked within the trusted scope already established for the request.

OWASP distinguishes authentication from authorization and recommends checking access for each request and resource. Apply that principle to the actual reward relationships rather than assuming a signed-in user can retrieve any known identifier. OWASP authorization guidance

For the fictional merchants, the trusted context includes an internal tenant reference derived from the verified shop connection. A customer-facing request also includes the supported authenticated customer relationship. The order and award references are then resolved within that scope.

Use typed references in the application model. A human-readable order name is a display label, while a stable order identifier combined with trusted tenant scope identifies the purchase. A reward recipient may differ from the buyer, so the disclosure policy must establish which viewer relationship permits which projection.

A proposed access contract can state:

Context Required boundary
Merchant backend job Verified tenant and authorized integration scope
Customer reward lookup Verified tenant plus approved customer-to-record relationship
Staff lookup Verified tenant plus permitted staff workflow
Provider callback Verified origin and supported operation-to-tenant mapping
Public offer content Public campaign projection without personal reward records

The contract is an original architectural proposal. It does not define the merchant’s internal role policy or claim that a particular RebateCardX implementation already enforces these exact fields.

Do not use email matching as a universal identity shortcut. The same address can appear in different stores, be shared within a household or change over time. The authorized relationship should follow the actual Shopify and provider contracts, with explicit review when the relationship cannot be established.

Apply the same boundary to queries, caches and jobs

Every path that can return or modify reward data needs the same trusted scope. A correct API handler is insufficient if an export, search endpoint or background worker can query records without a tenant condition.

Make the scope difficult to omit. The repository or service interface can require a trusted tenant context rather than accept an optional shop argument. Database constraints, row-level controls or equivalent enforcement can add protection where they fit the architecture, but their actual configuration must be verified rather than assumed from the chosen technology.

For the fictional order 1050 collision, a safe cache key includes the internal tenant, stable resource reference and relevant disclosure class. A customer-specific projection may also need the authorized viewer relationship. Reusing a staff projection for a customer page is unsafe even when both belong to the same merchant.

An original lookup sketch is:

context = validate_supported_authentication(request)
resource = resolve_order_within(context.trusted_tenant, requested_reference)
permission = evaluate_approved_viewer_relationship(context, resource)

if permission is not_established:
    return_safe_denial_without_record_disclosure()
else:
    projection = load_or_build_cache_entry_for(context, resource, permission)
    return_only_permitted_fields(projection)

The pseudocode is a design sketch, not a vendor authentication library.

Carry trusted tenant identity into background work at enqueue time and validate it again against the operation’s stored relationship before processing. A job payload that names a tenant should not be accepted from an untrusted caller without verification. The worker should not resolve an award globally and only afterward decide which merchant it belongs to.

Provider callbacks need a similar boundary. The service should map the verified provider operation to the tenant and purchase recorded when the operation was created. It should not let an arbitrary callback field reassign the operation to another shop.

A difficult case is a shared administrator who legitimately works with several stores. Their broad access does not justify an unscoped cache or query. The active store context still needs to be explicit, and any switch should change the applicable data scope. A user’s ability to access both stores is different from permission to blend their records in one response.

Test cross-store and cross-customer access denials

Create at least two synthetic tenants and two customers within one tenant. Use deliberately similar display identifiers so the test can expose accidental reliance on human-readable names. The expected result must cover both the response and the absence of unauthorized side effects.

A practical fixture matrix is:

Attempt Expected outcome
Customer A requests their own permitted record Approved projection returned
Customer A substitutes Customer B’s award reference No unauthorized disclosure
Store A request uses Store B’s order reference Tenant boundary denial
Cache contains same visible order name from another store Correct scoped result or safe miss
Background job has mismatched tenant and operation Processing stops for review
Provider callback conflicts with stored tenant mapping No reassignment or cross-store mutation
Staff switches active stores New scope used consistently

Inspect error messages for record existence leaks. A denied lookup should not reveal another customer’s amount or confirm a private award’s existence merely to explain the denial. The exact response policy should be consistent with the application’s approved access design.

Test alternate endpoints. A list view can be correctly scoped while a detail endpoint, search filter or export path is not. Pagination cursors and cached downloads should remain bound to the trusted scope. A customer must not be able to alter a cursor or file reference to browse another person’s reward history.

For the fictional collision, first warm the cache with Store A’s order 1050, then request Store B’s order 1050. The second response must contain only Store B’s permitted data. Repeat with two customers in the same store to verify that tenant scoping alone does not replace customer authorization.

Also test a deleted or disconnected relationship. If the integration can no longer establish the active scope, it should follow the approved connection-state policy rather than use a stale authorization assumption indefinitely. Historical records may still need controlled handling, but their existence does not imply continuing access for every former session.

Retain an acceptance record with authenticated context, requested reference, expected policy decision and observed response fields. The evidence should show that the denial happens at the data boundary, not only through a hidden button in the interface.

The completed design makes trusted store and customer scope part of every query, cache and job contract. It prevents a convenient shortcut in one layer from undoing the access checks in another, while preserving the authorized reward experience for the person and merchant the record actually belongs to.

Keep the cache collision test in the regular regression set. It should run after changes to cache key construction, shared repository helpers or background-job serialization, because those are places where a previously explicit tenant context can be dropped without altering the visible customer component. The same fixture then protects several layers of the boundary.

Review store and recipient isolation requirements through Rebate Card X technical access.

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.