[GH-ISSUE #243] Add Promoted Purchases CLI support #73

Closed
opened 2026-02-26 21:33:11 +03:00 by kerem · 0 comments
Owner

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

Overview

Add CLI support for Promoted Purchases, which allow promoting in-app purchases and subscriptions on the App Store. This enables full management of promoted purchases from the CLI with JSON-first output and explicit flags.

Scope

Primary resources from the OpenAPI spec:

  • promotedPurchases (list, get, create, update, delete)
  • Relationships: apps/{id}/promotedPurchases, apps/{id}/relationships/promotedPurchases
  • Related resources: subscriptions/{id}/promotedPurchase, inAppPurchases/{id}/promotedPurchase (v2)

Endpoints:

  • GET /v1/promotedPurchases
  • GET /v1/promotedPurchases/{id}
  • GET /v1/apps/{id}/promotedPurchases
  • GET /v1/apps/{id}/relationships/promotedPurchases
  • GET /v1/subscriptions/{id}/promotedPurchase
  • GET /v1/subscriptions/{id}/relationships/promotedPurchase
  • GET /v2/inAppPurchases/{id}/promotedPurchase
  • GET /v2/inAppPurchases/{id}/relationships/promotedPurchase
  • POST /v1/promotedPurchases
  • PATCH /v1/promotedPurchases/{id}
  • PATCH /v1/apps/{id}/relationships/promotedPurchases
  • DELETE /v1/promotedPurchases/{id}

Proposed CLI

Top-level group:

  • asc promoted-purchases <subcommand> [flags]

Subcommands (all support list/get/create/update/delete unless noted):

  • promoted-purchases list|get|create|update|delete
  • promoted-purchases link (link to app via relationships endpoint)

Examples:

  • asc promoted-purchases list --app APP_ID
  • asc promoted-purchases get --promoted-purchase-id PROMO_ID
  • asc promoted-purchases create --app APP_ID --product-id PRODUCT_ID --product-type SUBSCRIPTION
  • asc promoted-purchases update --promoted-purchase-id PROMO_ID --visible-for-all-users true
  • asc promoted-purchases delete --promoted-purchase-id PROMO_ID --confirm
  • asc promoted-purchases link --app APP_ID --promoted-purchase-id PROMO_ID

Flag patterns

Common:

  • --app, --output, --pretty, --limit, --next, --paginate
  • --confirm for destructive operations

Resource-specific examples:

  • --promoted-purchase-id
  • --product-id, --product-type (SUBSCRIPTION or IN_APP_PURCHASE)
  • --visible-for-all-users (boolean)
  • --enabled (boolean)

Output

  • JSON minified by default
  • --pretty for JSON
  • --output table/markdown for list commands

Acceptance criteria

  • Commands appear in asc --help and asc promoted-purchases --help
  • CRUD works for promoted purchases
  • List command works with --app filter
  • Create supports linking to subscriptions and in-app purchases
  • Update supports visibility and enabled flags
  • Link command works for app relationships
  • Pagination flags work (--paginate, --next, --limit)
  • Delete requires --confirm
  • JSON-first output matches existing conventions
  • Table and markdown output for list commands

Tests

  • Unit tests for command flag validation and error cases
  • HTTP client tests for list/get/create/update/delete
  • Relationship tests for app linking
  • Output tests for table/markdown

Implementation notes

  • Add cmd/promoted_purchases.go and internal/asc/client_promoted_purchases.go
  • Add output helpers in internal/asc/output_promoted_purchases.go
  • Register command in cmd/root.go
  • Add resource type constants in internal/asc/client_types.go
  • Follow patterns in cmd/apps.go, cmd/subscriptions.go, and output helpers in internal/asc/output_*
Originally created by @rudrankriyam on GitHub (Jan 28, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/243 # Overview Add CLI support for Promoted Purchases, which allow promoting in-app purchases and subscriptions on the App Store. This enables full management of promoted purchases from the CLI with JSON-first output and explicit flags. # Scope Primary resources from the OpenAPI spec: - `promotedPurchases` (list, get, create, update, delete) - Relationships: `apps/{id}/promotedPurchases`, `apps/{id}/relationships/promotedPurchases` - Related resources: `subscriptions/{id}/promotedPurchase`, `inAppPurchases/{id}/promotedPurchase` (v2) Endpoints: - GET /v1/promotedPurchases - GET /v1/promotedPurchases/{id} - GET /v1/apps/{id}/promotedPurchases - GET /v1/apps/{id}/relationships/promotedPurchases - GET /v1/subscriptions/{id}/promotedPurchase - GET /v1/subscriptions/{id}/relationships/promotedPurchase - GET /v2/inAppPurchases/{id}/promotedPurchase - GET /v2/inAppPurchases/{id}/relationships/promotedPurchase - POST /v1/promotedPurchases - PATCH /v1/promotedPurchases/{id} - PATCH /v1/apps/{id}/relationships/promotedPurchases - DELETE /v1/promotedPurchases/{id} # Proposed CLI Top-level group: - `asc promoted-purchases <subcommand> [flags]` Subcommands (all support list/get/create/update/delete unless noted): - `promoted-purchases list|get|create|update|delete` - `promoted-purchases link` (link to app via relationships endpoint) Examples: - `asc promoted-purchases list --app APP_ID` - `asc promoted-purchases get --promoted-purchase-id PROMO_ID` - `asc promoted-purchases create --app APP_ID --product-id PRODUCT_ID --product-type SUBSCRIPTION` - `asc promoted-purchases update --promoted-purchase-id PROMO_ID --visible-for-all-users true` - `asc promoted-purchases delete --promoted-purchase-id PROMO_ID --confirm` - `asc promoted-purchases link --app APP_ID --promoted-purchase-id PROMO_ID` # Flag patterns Common: - `--app`, `--output`, `--pretty`, `--limit`, `--next`, `--paginate` - `--confirm` for destructive operations Resource-specific examples: - `--promoted-purchase-id` - `--product-id`, `--product-type` (SUBSCRIPTION or IN_APP_PURCHASE) - `--visible-for-all-users` (boolean) - `--enabled` (boolean) # Output - JSON minified by default - `--pretty` for JSON - `--output table/markdown` for list commands # Acceptance criteria - [ ] Commands appear in `asc --help` and `asc promoted-purchases --help` - [ ] CRUD works for promoted purchases - [ ] List command works with `--app` filter - [ ] Create supports linking to subscriptions and in-app purchases - [ ] Update supports visibility and enabled flags - [ ] Link command works for app relationships - [ ] Pagination flags work (`--paginate`, `--next`, `--limit`) - [ ] Delete requires `--confirm` - [ ] JSON-first output matches existing conventions - [ ] Table and markdown output for list commands # Tests - Unit tests for command flag validation and error cases - HTTP client tests for list/get/create/update/delete - Relationship tests for app linking - Output tests for table/markdown # Implementation notes - Add `cmd/promoted_purchases.go` and `internal/asc/client_promoted_purchases.go` - Add output helpers in `internal/asc/output_promoted_purchases.go` - Register command in `cmd/root.go` - Add resource type constants in `internal/asc/client_types.go` - Follow patterns in `cmd/apps.go`, `cmd/subscriptions.go`, and output helpers in `internal/asc/output_*`
kerem closed this issue 2026-02-26 21:33:11 +03:00
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#73
No description provided.