[GH-ISSUE #199] Add App Pre-Orders CLI support #63

Closed
opened 2026-02-26 21:33:06 +03:00 by kerem · 1 comment
Owner

Originally created by @rudrankriyam on GitHub (Jan 26, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/199

Originally assigned to: @rudrankriyam on GitHub.

Overview

Add CLI support for App Pre‑Orders so users can configure pre‑order availability, release dates, and end pre‑orders using the public App Store Connect API.

Docs (API)

Scope (Endpoints)

The pre‑order flow is built on app availability and territory availability resources:

  • POST /v2/appAvailabilities (create/replace territory availabilities with pre‑order fields)
  • PATCH /v1/territoryAvailabilities/{id} (update release date / pre‑order enabled per territory)
  • POST /v1/endAppAvailabilityPreorders (end pre‑order and release immediately)
  • GET /v1/apps/{id}/appAvailabilityV2
  • GET /v1/appAvailabilityV2/{id}/territoryAvailabilities

Proposed CLI

Top‑level group: asc pre-orders <subcommand> [flags]

Subcommands:

  • pre-orders get --app APP_ID
  • pre-orders list --app APP_ID (alias of get, but returns territory rows)
  • pre-orders enable --app APP_ID --territory "USA,GBR" --release-date YYYY-MM-DD
  • pre-orders update --territory-availability AVAILABILITY_ID --release-date YYYY-MM-DD
  • pre-orders disable --territory-availability AVAILABILITY_ID (set preOrderEnabled=false)
  • pre-orders end --availability APP_AVAILABILITY_ID --confirm (end pre‑order globally)

Flags

Common:

  • --output json|table|markdown
  • --pretty

Enable/update:

  • --release-date required, validate YYYY-MM-DD
  • --territory required for enable (comma‑separated)

End:

  • --confirm required

Output

  • JSON (minified) by default
  • Table/markdown for list/get
  • Show available, releaseDate, preOrderEnabled per territory

Acceptance Criteria

  • asc pre-orders --help available
  • Can list territory pre‑order status for an app
  • Can enable pre‑order for territories with a release date
  • Can update release date for a territory availability
  • Can disable pre‑order for a territory availability
  • Can end pre‑order globally (endAppAvailabilityPreorders)
  • JSON/table/markdown output

Tests

  • CLI validation tests (missing --app, missing --territory, invalid date, missing --confirm)
  • Client tests for POST /v2/appAvailabilities, PATCH /v1/territoryAvailabilities, POST /v1/endAppAvailabilityPreorders
  • Output tests for table/markdown

Manual Test Plan (using real apps)

  1. Find IDs:
    • asc apps --paginateAPP_ID
  2. Get app availability ID:
    • asc pricing availability get --app APP_IDAPP_AVAILABILITY_ID
  3. List territory availability:
    • asc pricing availability territory-availabilities --availability APP_AVAILABILITY_ID
  4. Enable pre‑order:
    • asc pre-orders enable --app APP_ID --territory "USA" --release-date "2026-02-15"
  5. Update a territory availability (use ID from step 3):
    • asc pre-orders update --territory-availability TERR_AVAIL_ID --release-date "2026-02-20"
  6. Disable pre‑order:
    • asc pre-orders disable --territory-availability TERR_AVAIL_ID
  7. End pre‑order globally:
    • asc pre-orders end --availability APP_AVAILABILITY_ID --confirm

Implementation Notes

  • Reuse existing pricing availability client types (TerritoryAvailabilityCreate supports releaseDate + preOrderEnabled).
  • Add new command file cmd/pre_orders.go or extend cmd/pricing.go with a dedicated pre-orders group.
  • Add output helpers if needed to show pre‑order fields clearly.
Originally created by @rudrankriyam on GitHub (Jan 26, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/199 Originally assigned to: @rudrankriyam on GitHub. # Overview Add CLI support for **App Pre‑Orders** so users can configure pre‑order availability, release dates, and end pre‑orders using the public App Store Connect API. # Docs (API) - App Pre‑Orders: https://sosumi.ai/documentation/appstoreconnectapi/app-pre-orders - App availability (existing): https://sosumi.ai/documentation/appstoreconnectapi/app-availability - Modify territory availability: https://sosumi.ai/documentation/appstoreconnectapi/patch-v1-territoryavailabilities-_id_ - End pre‑order: https://sosumi.ai/documentation/appstoreconnectapi/post-v1-endappavailabilitypreorders # Scope (Endpoints) The pre‑order flow is built on **app availability** and **territory availability** resources: - `POST /v2/appAvailabilities` (create/replace territory availabilities with pre‑order fields) - `PATCH /v1/territoryAvailabilities/{id}` (update release date / pre‑order enabled per territory) - `POST /v1/endAppAvailabilityPreorders` (end pre‑order and release immediately) - `GET /v1/apps/{id}/appAvailabilityV2` - `GET /v1/appAvailabilityV2/{id}/territoryAvailabilities` # Proposed CLI Top‑level group: `asc pre-orders <subcommand> [flags]` Subcommands: - `pre-orders get --app APP_ID` - `pre-orders list --app APP_ID` (alias of get, but returns territory rows) - `pre-orders enable --app APP_ID --territory "USA,GBR" --release-date YYYY-MM-DD` - `pre-orders update --territory-availability AVAILABILITY_ID --release-date YYYY-MM-DD` - `pre-orders disable --territory-availability AVAILABILITY_ID` (set `preOrderEnabled=false`) - `pre-orders end --availability APP_AVAILABILITY_ID --confirm` (end pre‑order globally) # Flags Common: - `--output json|table|markdown` - `--pretty` Enable/update: - `--release-date` required, validate `YYYY-MM-DD` - `--territory` required for `enable` (comma‑separated) End: - `--confirm` required # Output - JSON (minified) by default - Table/markdown for list/get - Show `available`, `releaseDate`, `preOrderEnabled` per territory # Acceptance Criteria - [ ] `asc pre-orders --help` available - [ ] Can list territory pre‑order status for an app - [ ] Can enable pre‑order for territories with a release date - [ ] Can update release date for a territory availability - [ ] Can disable pre‑order for a territory availability - [ ] Can end pre‑order globally (`endAppAvailabilityPreorders`) - [ ] JSON/table/markdown output # Tests - CLI validation tests (missing --app, missing --territory, invalid date, missing --confirm) - Client tests for POST /v2/appAvailabilities, PATCH /v1/territoryAvailabilities, POST /v1/endAppAvailabilityPreorders - Output tests for table/markdown # Manual Test Plan (using real apps) 1) Find IDs: - `asc apps --paginate` → `APP_ID` 2) Get app availability ID: - `asc pricing availability get --app APP_ID` → `APP_AVAILABILITY_ID` 3) List territory availability: - `asc pricing availability territory-availabilities --availability APP_AVAILABILITY_ID` 4) Enable pre‑order: - `asc pre-orders enable --app APP_ID --territory "USA" --release-date "2026-02-15"` 5) Update a territory availability (use ID from step 3): - `asc pre-orders update --territory-availability TERR_AVAIL_ID --release-date "2026-02-20"` 6) Disable pre‑order: - `asc pre-orders disable --territory-availability TERR_AVAIL_ID` 7) End pre‑order globally: - `asc pre-orders end --availability APP_AVAILABILITY_ID --confirm` # Implementation Notes - Reuse existing `pricing availability` client types (`TerritoryAvailabilityCreate` supports `releaseDate` + `preOrderEnabled`). - Add new command file `cmd/pre_orders.go` or extend `cmd/pricing.go` with a dedicated `pre-orders` group. - Add output helpers if needed to show pre‑order fields clearly.
kerem closed this issue 2026-02-26 21:33:06 +03:00
Author
Owner
<!-- gh-comment-id:3808155842 --> @rudrankriyam commented on GitHub (Jan 27, 2026): Closed as fixed by #225, #229, #236. PRs: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/225, https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/229, https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/236
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#63
No description provided.