mirror of
https://github.com/rudrankriyam/App-Store-Connect-CLI.git
synced 2026-04-25 07:35:48 +03:00
[GH-ISSUE #25] Phase 7: Sandbox tester management #2
Labels
No labels
bug
bug
documentation
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/App-Store-Connect-CLI#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rudrankriyam on GitHub (Jan 20, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/25
PRD: Sandbox Testers Management in ASC CLI
Overview
This PRD outlines the implementation of sandbox tester management for App Store Connect CLI, enabling developers and AI agents to create, list, and delete sandbox testers used for testing in-app purchases and subscriptions.
Goals
API Endpoints
Core Sandbox Tester Endpoints
/v1/sandboxTesters/v1/sandboxTesters/{id}/v1/sandboxTesters/v1/sandboxTesters/{id}Supporting Endpoints (Future)
/v1/sandboxTesters/{id}/clearPurchaseHistoryRequestNote: Some sources mention
/v2/sandboxTesters, but/v1/sandboxTestersappears to be the standard endpoint. Implementation should verify the correct version during development.CLI Commands
Command Structure
Subcommands
list- List sandbox testersLists all sandbox testers for the team.
Flags:
--email(optional) - Filter by email address--territory(optional) - Filter by territory code (e.g., "USA", "JPN", "GBR")--limit(optional) - Maximum results per page (1-200)--next(optional) - Fetch next page usinglinks.nextURL--output(optional) - Output format:json(default),table,markdown--pretty(optional) - Pretty-print JSON outputExamples:
JSON Output:
create- Create sandbox testerCreates a new sandbox tester account for testing in-app purchases.
Flags:
--email(required) - Email address (must be unique, not used for Apple ID)--first-name(required) - First name--last-name(required) - Last name--password(required) - Password (8+ chars, uppercase, lowercase, number, symbol)--territory(required) - Territory code (e.g., "USA", "JPN", "GBR")--output(optional) - Output format:json(default),table,markdown--pretty(optional) - Pretty-print JSON outputExamples:
JSON Output:
Note: Email subaddressing (e.g.,
user+test@example.com) is supported and recommended for creating multiple test accounts.get- Get sandbox tester detailsGets detailed information about a specific sandbox tester.
Flags:
--id(required) - Sandbox tester ID (alternative to--email)--email(optional) - Email address (alternative to--id)--output(optional) - Output format:json(default),table,markdown--pretty(optional) - Pretty-print JSON outputExamples:
JSON Output:
delete- Delete sandbox testerPermanently deletes a sandbox tester account.
Flags:
--id(required) - Sandbox tester ID (alternative to--email)--email(optional) - Email address (alternative to--id)--confirm(required) - Confirmation flag to prevent accidental deletions--output(optional) - Output format:json(default),table,markdown--pretty(optional) - Pretty-print JSON outputExamples:
JSON Output:
Note: If the tester is part of a "Sandbox Test Family," they must be removed from the family before deletion.
Request/Response Shapes
Create Sandbox Tester (POST)
Request:
Response:
Note: Password is not returned in the response for security reasons.
List Sandbox Testers (GET)
Request:
Response:
Delete Sandbox Tester (DELETE)
Request:
Response:
Required Fields
Create Sandbox Tester (POST)
Required Fields:
type:"sandboxTesters"attributes.firstName: String - First name of the testerattributes.lastName: String - Last name of the testerattributes.email: String - Unique email address (not used for Apple ID)attributes.password: String - Password meeting Apple's requirements:attributes.territory: String - Territory code (e.g., "USA", "JPN", "GBR", "CAN")Optional Fields (may be required by API):
attributes.confirmPassword: String - Must matchpassword(if required by API)attributes.secretQuestion: String - Security question for account recoveryattributes.secretAnswer: String - Answer to security questionattributes.birthDate: String - Birth date inYYYY-MM-DDformatNote: Implementation should verify which optional fields are actually required by testing against the API.
Validation
Input Validation
Email
createanddelete(when using--email)user+test@example.com)First Name / Last Name
createPassword
createTerritory
createTester ID
getanddelete(when using--id)Confirmation Flag
--confirmrequired fordeleteLimit
API Validation
Email Uniqueness
Territory Validity
Password Strength
Tester Existence
Family Membership
Error Handling
Common Errors
Email Already Exists
Invalid Password
Invalid Territory
Tester Not Found
Tester Not Found (by ID)
Missing Confirmation
Cannot Delete (Family Member)
Unauthorized
Rate Limiting
Error Response Format
All errors follow the existing pattern:
Testing Requirements
Unit Tests
Client Layer (
internal/asc/client.go)GetSandboxTesters
filter[email],filter[territory],limit)links.next)GetSandboxTester
CreateSandboxTester
DeleteSandboxTester
CLI Layer (
cmd/sandbox.go)SandboxListCommand
--email,--territory)--next)SandboxCreateCommand
SandboxGetCommand
--idor--email)SandboxDeleteCommand
--confirm)Integration Tests (Opt-in)
Environment Variables:
ASC_SANDBOX_TEST_EMAIL- Email for testing (should use subaddressing)ASC_SANDBOX_TEST_TERRITORY- Territory code for testing (default: "USA")ASC_CONFIRM_DELETE=true- Required for actual deletionsTest Scenarios:
ASC_CONFIRM_DELETE=true)Skip Conditions:
ASC_SANDBOX_TEST_EMAILnot setASC_CONFIRM_DELETEnot set totrueImplementation Checklist
Phase 1: Client Methods
GetSandboxTesters(ctx, opts...)- List testers with filtersGetSandboxTester(ctx, testerID)- Get tester by IDCreateSandboxTester(ctx, email, firstName, lastName, password, territory)- Create testerDeleteSandboxTester(ctx, testerID)- Delete testerWithSandboxTesterEmail,WithSandboxTesterTerritory, etc.)Phase 2: CLI Commands
SandboxCommand- Parent commandSandboxListCommand- List testersSandboxCreateCommand- Create testerSandboxGetCommand- Get tester detailsSandboxDeleteCommand- Delete testerRootCommandsubcommands listPhase 3: Validation
Phase 4: Output Formatting
Phase 5: Error Handling
Phase 6: Tests
API Reference URLs
Official Documentation
Sandbox Testing Overview
Create Sandbox Account
Manage Sandbox Account Settings
App Store Connect API
Testing In-App Purchases
OpenAPI Specification
Related Documentation
Design Decisions
Explicit Flags: All commands use long-form flags (
--email,--first-name,--territory) following project conventionsJSON-First: Default output is minified JSON for AI agent consumption
Non-Interactive: No prompts; all required information via flags
Confirmation Flags:
--confirmrequired for destructive operations (delete)ID vs Email: Support both
--idand--emailfor get/delete operations for flexibilityEmail Subaddressing: Explicitly support and recommend email subaddressing for multiple test accounts
Password Validation: Validate password strength before API call to provide immediate feedback
Territory Codes: Use standard territory codes (e.g., "USA", "JPN") matching API expectations
Error Messages: Include actionable hints (e.g., "Use email subaddressing")
Family Membership: Handle Sandbox Test Family constraints gracefully
Future Enhancements
Clear Purchase History: Add
asc sandbox clear-history --id "TESTER_ID"command/v1/sandboxTesters/{id}/clearPurchaseHistoryRequestendpointBulk Operations: Create/delete multiple testers from a file
asc sandbox create-bulk --file "testers.json"asc sandbox delete-bulk --file "testers.json"Tester Status: Show tester status (active, purchases, etc.)
asc sandbox status --id "TESTER_ID"Territory Management: List available territories
asc sandbox territoriesPassword Generation: Auto-generate secure passwords
asc sandbox create --email "..." --auto-passwordNotes
beta-testerscommand)/v2/sandboxTesters) - verify during implementationBetaTestersCommandfor command structureTerritory Codes Reference
Common territory codes (verify against API):
USA- United StatesJPN- JapanGBR- United KingdomCAN- CanadaAUS- AustraliaDEU- GermanyFRA- FranceCHN- ChinaKOR- South KoreaBRA- BrazilNote: Implementation should fetch or validate against the complete list of supported territories from the API or documentation.
@rudrankriyam commented on GitHub (Jan 21, 2026):
Completed via PR #35 and released in 0.3.0. Closing as done.