> ## Documentation Index
> Fetch the complete documentation index at: https://docs.asccli.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Iap

# In-App Purchases

> Manage in-app purchases in App Store Connect

The `iap` command group provides comprehensive management of in-app purchases (IAP), including creation, pricing, localization, and submission workflows.

## Overview

In-app purchases allow you to sell digital content and features within your app:

* **Consumables** - Products that can be purchased multiple times (e.g., game currency)
* **Non-Consumables** - One-time purchases (e.g., premium features)
* **Non-Renewing Subscriptions** - Time-limited access that doesn't auto-renew

## List In-App Purchases

List all in-app purchases for an app.

```bash theme={null} theme={null}
asc iap list --app "APP_ID"
```

**Required Flags:**

* `--app` - App ID (or `ASC_APP_ID` env)

**Optional Flags:**

* `--limit` - Results per page (1-200)
* `--paginate` - Fetch all pages automatically
* `--next` - Pagination URL
* `--legacy` - Use v1 endpoint (for backward compatibility)

**Examples:**

```bash theme={null} theme={null}
# List all IAPs
asc iap list --app "123456789"

# Fetch all pages
asc iap list --app "123456789" --paginate

# Use legacy v1 endpoint
asc iap list --app "123456789" --legacy
```

## Get IAP Details

Retrieve details for a specific in-app purchase.

```bash theme={null} theme={null}
asc iap view --id "IAP_ID"
```

**Required Flags:**

* `--id` - In-app purchase ID

**Optional Flags:**

* `--legacy` - Use v1 endpoint

## Create In-App Purchase

Create a new in-app purchase product.

```bash theme={null} theme={null}
asc iap create \
  --app "APP_ID" \
  --type CONSUMABLE \
  --ref-name "Pro" \
  --product-id "com.example.pro"
```

**Required Flags:**

* `--app` - App ID (or `ASC_APP_ID` env)
* `--type` - IAP type: `CONSUMABLE`, `NON_CONSUMABLE`, `NON_RENEWING_SUBSCRIPTION`
* `--ref-name` - Reference name (internal identifier)
* `--product-id` - Product ID (must match your app's bundle ID prefix)

**Optional Flags:**

* `--family-sharable` - Enable Family Sharing (cannot be undone)

**Product ID Format:**

Product IDs typically follow this pattern:

```
<bundle_id>.<product_identifier>
```

Example: If your bundle ID is `com.example.myapp`, product IDs might be:

* `com.example.myapp.pro`
* `com.example.myapp.coins100`
* `com.example.myapp.unlock`

**Examples:**

```bash theme={null} theme={null}
# Create consumable IAP
asc iap create \
  --app "123456789" \
  --type CONSUMABLE \
  --ref-name "100 Coins" \
  --product-id "com.example.app.coins100"

# Create non-consumable with Family Sharing
asc iap create \
  --app "123456789" \
  --type NON_CONSUMABLE \
  --ref-name "Lifetime Access" \
  --product-id "com.example.app.lifetime" \
  --family-sharable

# Create non-renewing subscription
asc iap create \
  --app "123456789" \
  --type NON_RENEWING_SUBSCRIPTION \
  --ref-name "Season Pass" \
  --product-id "com.example.app.season2024"
```

## Update In-App Purchase

Update an existing in-app purchase.

```bash theme={null} theme={null}
asc iap update \
  --id "IAP_ID" \
  --ref-name "New Name"
```

**Required Flags:**

* `--id` - In-app purchase ID

**Optional Flags:**

* `--ref-name` - New reference name
* `--family-sharable` - Enable Family Sharing (cannot be disabled once enabled)

**Note:** Product ID and type cannot be changed after creation.

## Delete In-App Purchase

Delete an in-app purchase.

```bash theme={null} theme={null}
asc iap delete --id "IAP_ID" --confirm
```

**Required Flags:**

* `--id` - In-app purchase ID
* `--confirm` - Confirm deletion

**Warning:** Deletion is permanent and affects customer purchases. Only delete products that were never released.

## Pricing

### View Pricing

View current pricing for in-app purchases in an app.

```bash theme={null} theme={null}
asc iap pricing summary --app "APP_ID"
```

### Manage Price Points

Work with App Store price points and tiers.

```bash theme={null} theme={null}
# List available price points
asc iap pricing price-points list \
  --iap-id "IAP_ID"

# Get price point details
asc iap pricing price-points equalizations --id "PRICE_POINT_ID"
```

### Manage Price Schedules

Configure pricing schedules for in-app purchases.

```bash theme={null} theme={null}
# View price schedule
asc iap pricing schedules view --iap-id "IAP_ID"

# Create price schedule
asc iap pricing schedules create \
  --iap-id "IAP_ID" \
  --base-territory "USA" \
  --prices "PRICE_POINT_ID:2026-03-01"
```

## Localizations

Manage in-app purchase localizations for different languages and regions.

### List Localizations

```bash theme={null} theme={null}
asc iap localizations list --iap-id "IAP_ID"
```

**Optional Flags:**

* `--limit` - Results per page (1-200)
* `--paginate` - Fetch all pages

### Create Localization

```bash theme={null} theme={null}
asc iap localizations create \
  --iap-id "IAP_ID" \
  --locale "en-US" \
  --name "Premium Features" \
  --description "Unlock all premium features"
```

### Update Localization

```bash theme={null} theme={null}
asc iap localizations update \
  --localization-id "LOCALIZATION_ID" \
  --name "Updated Name" \
  --description "Updated description"
```

### Delete Localization

```bash theme={null} theme={null}
asc iap localizations delete \
  --localization-id "LOCALIZATION_ID" \
  --confirm
```

## Images and Screenshots

### Upload Promotional Image

Upload a promotional image for an in-app purchase.

```bash theme={null} theme={null}
asc iap images create \
  --iap-id "IAP_ID" \
  --file "./promo-image.png"
```

**Image Requirements:**

* Format: PNG or JPG
* Size: 1024 x 1024 pixels
* Color space: RGB
* Maximum file size: 4MB

### Manage Review Screenshots

Upload screenshots for App Review.

```bash theme={null} theme={null}
# Create review screenshot
asc iap review-screenshots create \
  --iap-id "IAP_ID" \
  --file "./screenshot.png"

# View review screenshot
asc iap review-screenshots view --iap-id "IAP_ID"

# Delete review screenshot
asc iap review-screenshots delete \
  --screenshot-id "SCREENSHOT_ID" \
  --confirm
```

## Availability

Control which territories can purchase your in-app purchases.

### Get Availability

```bash theme={null} theme={null}
asc iap pricing availability view --iap-id "IAP_ID"
```

### Set Availability

```bash theme={null} theme={null}
asc iap pricing availability set \
  --iap-id "IAP_ID" \
  --territories "USA,CAN,GBR"
```

**Territory Codes:**
Use ISO 3166-1 alpha-3 codes:

* `USA` - United States
* `CAN` - Canada
* `GBR` - United Kingdom
* `AUS` - Australia
* `JPN` - Japan

### List Availabilities

```bash theme={null} theme={null}
asc iap pricing availabilities view --id "AVAILABILITY_ID"
```

## Promoted In-App Purchases

Promote in-app purchases on your App Store product page.

### View Promoted Purchase

```bash theme={null} theme={null}
asc iap promoted-purchases view --promoted-purchase-id "PROMO_ID"
```

### Create Promoted Purchase

```bash theme={null} theme={null}
asc iap promoted-purchases create \
  --app "APP_ID" \
  --product-id "IAP_ID" \
  --visible-for-all-users true
```

### Update Promotion Order

```bash theme={null} theme={null}
asc iap promoted-purchases link \
  --app "APP_ID" \
  --promoted-purchase-id "PROMO_ID"
```

## Offer Codes

Create promotional offer codes for in-app purchases.

### Create Offer Code

```bash theme={null} theme={null}
asc iap offer-codes create \
  --iap-id "IAP_ID" \
  --name "SPRING2024" \
  --prices "USA:PRICE_POINT_ID"
```

**Optional Flags:**

* `--one-time` - One-time use codes
* `--start-date` - Start date (ISO 8601)
* `--end-date` - End date (ISO 8601)

### Manage Offer Code Prices

```bash theme={null} theme={null}
# List offer code pricing
asc iap offer-codes prices \
  --offer-code-id "CODE_ID" \
  --paginate
```

## Content

Manage hosted content for in-app purchases.

```bash theme={null} theme={null}
# View content status
asc iap content view --iap-id "IAP_ID"
```

## Submission

Submit in-app purchases for review.

```bash theme={null} theme={null}
asc iap submit --iap-id "IAP_ID" --confirm
```

**Requirements before submission:**

* At least one localization
* Pricing configured
* Screenshots for review (if required)
* All required metadata fields completed

## Common Workflows

### Create Complete IAP

```bash theme={null} theme={null}
#!/bin/bash
# Create a fully configured in-app purchase

APP_ID="123456789"
PRODUCT_ID="com.example.app.premium"

# 1. Create IAP
IAP_RESPONSE=$(asc iap create \
  --app "$APP_ID" \
  --type NON_CONSUMABLE \
  --ref-name "Premium Features" \
  --product-id "$PRODUCT_ID" \
  --output json)

IAP_ID=$(echo "$IAP_RESPONSE" | jq -r '.data.id')

# 2. Add localization
asc iap localizations create \
  --iap-id "$IAP_ID" \
  --locale "en-US" \
  --name "Premium Features" \
  --description "Unlock all premium features"

# 3. Upload promotional image
asc iap images create \
  --iap-id "$IAP_ID" \
  --file "./promo.png"

# 4. Set availability
asc iap pricing availability set \
  --iap-id "$IAP_ID" \
  --territories "USA,CAN,GBR,AUS"

# 5. Configure pricing (requires price point ID)
# See pricing documentation for details

echo "IAP created with ID: $IAP_ID"
```

### Bulk Update Availability

```bash theme={null} theme={null}
#!/bin/bash
# Update availability for multiple IAPs

TERRITORIES="USA,CAN,GBR,AUS,JPN"

for IAP_ID in $(asc iap list --app "$APP_ID" --output json | jq -r '.data[].id'); do
  echo "Updating $IAP_ID"
  asc iap pricing availability set \
    --iap-id "$IAP_ID" \
    --territories "$TERRITORIES"
done
```

### Export IAP Catalog

```bash theme={null} theme={null}
# Export all IAPs to JSON
asc iap list \
  --app "$APP_ID" \
  --paginate \
  --output json \
  > iap-catalog.json

# Format for review
jq '[.data[] | {id: .id, name: .attributes.name, productId: .attributes.productId, type: .attributes.inAppPurchaseType}]' iap-catalog.json
```

## Family Sharing

Family Sharing allows up to six family members to share eligible in-app purchases.

**Enabling Family Sharing:**

```bash theme={null} theme={null}
asc iap create \
  --app "APP_ID" \
  --type NON_CONSUMABLE \
  --ref-name "Premium" \
  --product-id "com.example.premium" \
  --family-sharable
```

**Important Notes:**

* Only available for `NON_CONSUMABLE` and `NON_RENEWING_SUBSCRIPTION` types
* **Cannot be disabled** once enabled
* Consumables are never shareable

## Best Practices

### Product IDs

* Use descriptive, hierarchical naming: `com.example.app.category.item`
* Include version or tier in recurring products: `com.example.app.premium.v2`
* Keep IDs under 100 characters
* Use only alphanumerics, dots, and underscores

### Localizations

* Provide localizations for all supported app languages
* Keep names concise (30 characters or less)
* Write clear descriptions that explain value
* Review translations with native speakers

### Pricing

* Research price tiers across key markets
* Consider regional purchasing power
* Test price sensitivity with A/B testing
* Use offer codes for promotions rather than changing base price

### Testing

* Test all IAPs in sandbox environment before release
* Verify purchase flows on multiple devices
* Test restoration of non-consumables
* Validate receipt verification on your backend

## Related Commands

* [Subscriptions](/commands/subscriptions) - Auto-renewable subscriptions
* [Apps](/commands/apps) - Manage app metadata and settings
* [Pricing](/commands/pricing) - Territory pricing and currencies

## API Reference

* [In-App Purchases v2](https://sosumi.ai/documentation/appstoreconnectapi/inapppurchasev2)
* [In-App Purchase Localizations](https://sosumi.ai/documentation/appstoreconnectapi/inapppurchaselocalization)
* [In-App Purchase Prices](https://sosumi.ai/documentation/appstoreconnectapi/inapppurchaseprice)
* [In-App Purchase Availability](https://sosumi.ai/documentation/appstoreconnectapi/inapppurchaseavailability)
