App stores
AuraScore 79/100

StoreKit Receipt and Loyalty Verification Test Script Builder

Construct a backend integration test script to validate retail loyalty subscriptions and in-app purchase receipts against store APIs.

Use this prompt when validating consumer loyalty tiers, member-exclusive discounts, and digital gift cards purchased through mobile app stores. It produces an integration test script that verifies server-to-server transaction notifications.

Template

Role: Principal Mobile Backend Architect specializing in consumer loyalty platforms and in-app transaction integrity.

Context

  • Commerce backend framework: {{commerce_platform_name}}
  • Store billing API version: {{store_billing_api_version}}
  • Retail loyalty subscription SKU: {{loyalty_tier_sku}}
  • Server webhook endpoint URL: {{webhook_endpoint_url}}
  • Sandbox environment target: {{sandbox_environment_type}}
  • Authentication token strategy: {{auth_token_strategy}}

Task

Develop an automated integration testing script in Node.js or Python that simulates store server-to-server notifications, verifies cryptographic receipt signatures for {{loyalty_tier_sku}}, and updates consumer loyalty ledgers in {{commerce_platform_name}}.

Method

  1. Configure mock cryptographic payloads representing App Store Server Notifications or Google Play Real-Time Developer Notifications.
  2. Establish authentication headers utilizing {{auth_token_strategy}} against {{sandbox_environment_type}}.
  3. Generate realistic payload fixtures for initial purchase, subscription renewal, price increase consent, and cancellation of {{loyalty_tier_sku}}.
  4. Script HTTP dispatch logic hitting {{webhook_endpoint_url}} to test concurrency and out-of-order delivery.
  5. Parse server responses to verify database transaction commits and user discount entitlement flags.
  6. Implement edge-case assertion suites covering expired certificates, fraudulent receipts, and duplicate notification IDs.
  7. Output structured pass/fail test telemetry with latency measurements.

Constraints

  • The script MUST be fully executable using standard enterprise libraries without unverified third-party dependencies.
  • Payload validation MUST explicitly test the schema requirements of {{store_billing_api_version}}.
  • MUST NOT log sensitive mock consumer identifiers or unmasked card tokens.
  • Include explicit timeout controls and HTTP retry logic for resilient sandbox execution.

Output format

1. Test Harness Configuration

Environment variable definitions and dependency package manifests.

2. Executable Verification Script

Complete test script including mock generators, dispatch handlers, and assertion blocks.

3. Assertion Matrix and Diagnostic Guide

Table mapping test scenarios to expected HTTP status codes, webhook actions, and ledger states.

Self-review

  • Ensure every mock transaction correctly targets {{loyalty_tier_sku}}.
  • Confirm cryptographic verification steps reflect {{store_billing_api_version}} standards.
  • Verify assertions cover idempotency and duplicate webhook handling.
AuraScore breakdown
79/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering10/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-app-stores
retail-consumer-goods
in-app-purchase
storekit
retail-loyalty