This tool helps manage and update prices for your App Store Connect applications and in-app purchases using the App Store Connect API.
- JWT token authentication with App Store Connect API
- Fetch app information and details
- Update prices for apps and IAPs
The project uses the following main dependencies:
PyJWT==2.10.1
: For creating and handling JSON Web Tokens (JWT) for API authenticationrequests==2.32.3
: For making HTTP requests to the App Store Connect APIcryptography==44.0.2
: Required for ES256 algorithm support in JWT token creationpython-dotenv==1.1.0
: For managing environment variables and sensitive credentials
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Copy
.env.example
to.env
and fill in your credentials:cp .env.example .env
- Update the
.env
file with your App Store Connect API credentials:APPSTORE_ISSUER_ID="your-issuer-id" APPSTORE_KEY_ID="your-key-id" APPSTORE_PRIVATE_KEY_PATH="path/to/your/private/key.p8"
The updatePrice.py
script provides a command-line interface for updating prices in bulk. Here's how to use it:
python updatePrice.py --token YOUR_JWT_TOKEN --csv price-schedule.csv
--token
: App Store Connect API token (required)--csv
: Path to the CSV file with price schedule data (default: 'app-price-schedule.csv')--dry-run
: Print the payload without making the API request (optional)
The input CSV file should contain the following columns:
input
: Memo or description of the itemid
: The app or IAP IDtype
: Either 'apps' or 'inAppPurchases'territory
: Territory code (e.g., USA, JPN)price
: Price point codestart
: Start date (use "null" for no start date)end
: End date (use "null" for no end date)price_point_id
: Price point identifier Please take a look atsample.csv
for the details.
The createPricePointID.py
script is used to generate price point IDs required for the price schedule updates. This script encodes parameters into a base64 string that serves as a price point identifier.
Example CSV content:
input,id,type,territory,price,start,end,price_point_id
My App,1234567890,apps,USA,0.00,null,null,10000
My App,1234567890,apps,JPN,50,2024-03-01,null,10001
My IAP,9876543210,inAppPurchases,USA,9.99,null,null,10127
- The script reads the CSV file and groups items by their ID
- For each item:
- Validates the required fields
- Groups prices by territory
- Creates price point IDs using the createPricePointID.py script
- Updates the price schedule via the App Store Connect API
The script handles various error cases:
- Missing required CSV columns
- Invalid item types
- API authentication errors
- Network issues
- Invalid price formats
All errors are logged to the console with detailed messages.
-
Update prices using a CSV file:
python updatePrice.py --token YOUR_JWT_TOKEN --csv my-prices.csv
-
Perform a dry run to see the API payload without making changes:
python updatePrice.py --token YOUR_JWT_TOKEN --csv my-prices.csv --dry-run
This script works in conjunction with:
createPricePointID.py
: Generates price point IDsgetItemIds.py
: Fetches app and IAP IDs from App Store Connect
This project is licensed under the MIT License - see the LICENSE file for details.