[PR #187] [MERGED] Offer codes CLI support #349

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

📋 Pull Request Information

Original PR: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/187
Author: @rudrankriyam
Created: 1/26/2026
Status: Merged
Merged: 1/26/2026
Merged by: @rudrankriyam

Base: mainHead: cursor/promo-codes-cli-support-65d4


📝 Commits (1)

  • 6024f5d Add promo codes CLI support

📊 Changes

14 files changed (+857 additions, -1 deletions)

View changed files

📝 README.md (+17 -1)
📝 cmd/commands_test.go (+73 -0)
cmd/promocodes.go (+265 -0)
📝 cmd/root.go (+1 -0)
📝 internal/asc/client_http_test.go (+122 -0)
📝 internal/asc/client_options.go (+21 -0)
📝 internal/asc/client_pagination.go (+4 -0)
📝 internal/asc/client_queries.go (+10 -0)
📝 internal/asc/client_test.go (+93 -0)
📝 internal/asc/client_types.go (+1 -0)
📝 internal/asc/output_core.go (+8 -0)
📝 internal/asc/output_test.go (+56 -0)
internal/asc/promo_codes.go (+132 -0)
internal/asc/promo_codes_output.go (+54 -0)

📄 Description

Implement App Store Connect offer code (subscription one-time use code) management to replace unsupported promo codes.

Summary

  • replace promo code commands with offer-codes (list/generate/values) backed by subscription offer code endpoints
  • add CSV values download parsing and output formatting for one-time use code batches
  • update docs, tests, and types for offer codes

Test plan

  • ASC_APP_ID= ASC_KEY_ID= ASC_ISSUER_ID= ASC_PRIVATE_KEY_PATH= ASC_VENDOR_NUMBER= ASC_CONFIG_PATH=/tmp/asc-config-empty.json go test ./...
  • ASC_APP_ID= ASC_KEY_ID= ASC_ISSUER_ID= ASC_PRIVATE_KEY_PATH= ASC_VENDOR_NUMBER= ASC_CONFIG_PATH=/tmp/asc-config-empty.json go test ./cmd ./internal/asc ./internal/auth -count=10 -shuffle=on
  • ASC_BYPASS_KEYCHAIN=1 ASC_KEY_ID="B5D62ZK8WW" ASC_ISSUER_ID="ff24f170-22a9-45b3-b880-29816376771b" ASC_PRIVATE_KEY_PATH="/Users/rudrank/Downloads/AuthKey_B5D62ZK8WW.p8" go run . offer-codes list --offer-code "000000000000000000000000" (expect not found)
  • ASC_BYPASS_KEYCHAIN=1 ASC_KEY_ID="B5D62ZK8WW" ASC_ISSUER_ID="ff24f170-22a9-45b3-b880-29816376771b" ASC_PRIVATE_KEY_PATH="/Users/rudrank/Downloads/AuthKey_B5D62ZK8WW.p8" go run . offer-codes generate --offer-code "000000000000000000000000" --quantity 1 --expiration-date "2026-02-01" (expect invalid relationship)
  • ASC_BYPASS_KEYCHAIN=1 ASC_KEY_ID="B5D62ZK8WW" ASC_ISSUER_ID="ff24f170-22a9-45b3-b880-29816376771b" ASC_PRIVATE_KEY_PATH="/Users/rudrank/Downloads/AuthKey_B5D62ZK8WW.p8" go run . offer-codes values --id "000000000000000000000000" (expect not found)

Open in Cursor Open in Web


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/187 **Author:** [@rudrankriyam](https://github.com/rudrankriyam) **Created:** 1/26/2026 **Status:** ✅ Merged **Merged:** 1/26/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `main` ← **Head:** `cursor/promo-codes-cli-support-65d4` --- ### 📝 Commits (1) - [`6024f5d`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/6024f5d4e923583d6b77a7df087fc39c81c1b14a) Add promo codes CLI support ### 📊 Changes **14 files changed** (+857 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+17 -1) 📝 `cmd/commands_test.go` (+73 -0) ➕ `cmd/promocodes.go` (+265 -0) 📝 `cmd/root.go` (+1 -0) 📝 `internal/asc/client_http_test.go` (+122 -0) 📝 `internal/asc/client_options.go` (+21 -0) 📝 `internal/asc/client_pagination.go` (+4 -0) 📝 `internal/asc/client_queries.go` (+10 -0) 📝 `internal/asc/client_test.go` (+93 -0) 📝 `internal/asc/client_types.go` (+1 -0) 📝 `internal/asc/output_core.go` (+8 -0) 📝 `internal/asc/output_test.go` (+56 -0) ➕ `internal/asc/promo_codes.go` (+132 -0) ➕ `internal/asc/promo_codes_output.go` (+54 -0) </details> ### 📄 Description Implement App Store Connect offer code (subscription one-time use code) management to replace unsupported promo codes. ## Summary - replace promo code commands with `offer-codes` (list/generate/values) backed by subscription offer code endpoints - add CSV values download parsing and output formatting for one-time use code batches - update docs, tests, and types for offer codes ## Test plan - `ASC_APP_ID= ASC_KEY_ID= ASC_ISSUER_ID= ASC_PRIVATE_KEY_PATH= ASC_VENDOR_NUMBER= ASC_CONFIG_PATH=/tmp/asc-config-empty.json go test ./...` - `ASC_APP_ID= ASC_KEY_ID= ASC_ISSUER_ID= ASC_PRIVATE_KEY_PATH= ASC_VENDOR_NUMBER= ASC_CONFIG_PATH=/tmp/asc-config-empty.json go test ./cmd ./internal/asc ./internal/auth -count=10 -shuffle=on` - `ASC_BYPASS_KEYCHAIN=1 ASC_KEY_ID="B5D62ZK8WW" ASC_ISSUER_ID="ff24f170-22a9-45b3-b880-29816376771b" ASC_PRIVATE_KEY_PATH="/Users/rudrank/Downloads/AuthKey_B5D62ZK8WW.p8" go run . offer-codes list --offer-code "000000000000000000000000"` (expect not found) - `ASC_BYPASS_KEYCHAIN=1 ASC_KEY_ID="B5D62ZK8WW" ASC_ISSUER_ID="ff24f170-22a9-45b3-b880-29816376771b" ASC_PRIVATE_KEY_PATH="/Users/rudrank/Downloads/AuthKey_B5D62ZK8WW.p8" go run . offer-codes generate --offer-code "000000000000000000000000" --quantity 1 --expiration-date "2026-02-01"` (expect invalid relationship) - `ASC_BYPASS_KEYCHAIN=1 ASC_KEY_ID="B5D62ZK8WW" ASC_ISSUER_ID="ff24f170-22a9-45b3-b880-29816376771b" ASC_PRIVATE_KEY_PATH="/Users/rudrank/Downloads/AuthKey_B5D62ZK8WW.p8" go run . offer-codes values --id "000000000000000000000000"` (expect not found) --- <a href="https://cursor.com/background-agent?bcId=bc-6ffc9537-d29e-45aa-a0b4-fc62c820fc02"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-6ffc9537-d29e-45aa-a0b4-fc62c820fc02"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web" src="https://cursor.com/open-in-web.svg"></picture></a> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 21:34:42 +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#349
No description provided.