# Guideline 2.1 - Performance - App Completeness: In-App Purchase Error on Continue Button

**Guideline:** 2.1 · **Store:** Apple App Store · **Risk:** medium · **Difficulty:** medium · **Typical turnaround:** 1-3 days

Canonical URL: https://appstorereject.com/rejections/apple/2/guideline-21-performance-app-completeness-in-app-purchase-error-on-continue-button

## Description

This is a technical implementation rejection, not a policy violation. Apple's review system detected an error when testing your in-app purchase flow, specifically when tapping the CTA button during purchase validation. 

This is almost certainly an automated detection based on a server-side receipt validation error. The root cause is that your production app's server is trying to validate App Store review team receipts (which come from Apple's sandbox environment) against Apple's production servers, causing validation to fail. 

The fix is straightforward: implement receipt validation logic that handles both production and sandbox receipts.

## Common variations

- We found that your in-app purchase products exhibited one or more bugs which create a poor user experience. Specifically, an error occurred during the purchase validation process.
- Your app's in-app purchase functionality is not working as expected. When we attempted to make a purchase, we encountered an error during receipt validation.
- We discovered issues with your in-app purchase implementation that prevent successful completion of transactions during our review process.
- The in-app purchase flow in your app contains bugs that result in transaction failures and error messages being displayed to users.
- We found that your app's subscription or in-app purchase validation process fails when processing receipts from Apple's review environment.

## Example rejection email

```
Guideline 2.1 - Performance - App Completeness

We found that your in-app purchase products exhibited one or more bugs which create a poor user experience.

Specifically, an error message was displayed when we tapped on the 'continue' button.

Next Steps

When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple's test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead.

For resources on in-app purchases, please review the In-App Purchase Programming Guide.
```

## Resolution steps

## Quick Assessment
- **Risk level:** Medium
- **Resolution path:** Fix & Resubmit
- **Typical turnaround:** 1-3 days

## The Fix

01. **Update server-side receipt validation logic**
   Modify your server to first attempt validation against Apple's production endpoint (https://buy.itunes.apple.com/verifyReceipt). If this returns error code 21007 ("Sandbox receipt used in production"), automatically retry against the sandbox endpoint (https://sandbox.itunes.apple.com/verifyReceipt).

02. **Implement proper error handling**
   Ensure your app gracefully handles both successful and failed receipt validations without showing raw error messages to users. Display user-friendly messages for validation failures.

03. **Test the dual-environment flow**
   Test your implementation with both production and sandbox receipts to ensure seamless validation regardless of the environment.

04. **Update client-side purchase flow**
   Verify that your app's purchase flow properly waits for server validation before completing the transaction and updating the user interface.

05. **Deploy and resubmit**
   Deploy the server-side changes, ensure they're live, then resubmit your app for review.

## Prevention
- Always implement dual-environment receipt validation from the start
- Test in-app purchases thoroughly with both sandbox and production-signed builds
- Monitor server logs for receipt validation errors during review periods

## Before / after examples

**Before:** Server only validates receipts against production endpoint, causing validation failures when Apple reviewers (using sandbox receipts) test purchases.
**After:** Server first tries production validation, then automatically falls back to sandbox validation if it receives error 21007.
**Why it works:** This handles both real user purchases and Apple review team testing seamlessly.

**Before:** Purchase flow shows raw validation error messages like 'Receipt validation failed' when reviewers test the app.
**After:** Purchase flow shows user-friendly messages and handles validation gracefully regardless of environment.
**Why it works:** Creates a smooth user experience even when validation encounters expected environment mismatches.

## Common questions

**How long does this typically take to fix?**

Typical turnaround is 1-3 days (difficulty: medium). After resubmission, most re-reviews complete within 24-48 hours.

---
*Machine-readable source: https://api.appstorereject.com/api/rejections/detail?slug=guideline-21-performance-app-completeness-in-app-purchase-error-on-continue-button*