[GH-ISSUE #247] Add Merchant IDs CLI support #76

Closed
opened 2026-02-26 21:33:12 +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/247

Overview

Add CLI support for Merchant IDs, which are used for Apple Pay and other payment services. This enables full management of merchant IDs from the CLI with JSON-first output and explicit flags.

Scope

Primary resources from the OpenAPI spec:

  • merchantIds (list, get, create, update, delete)
  • Relationships: merchantIds/{id}/certificates, merchantIds/{id}/relationships/certificates

Endpoints:

  • GET /v1/merchantIds
  • GET /v1/merchantIds/{id}
  • GET /v1/merchantIds/{id}/certificates
  • GET /v1/merchantIds/{id}/relationships/certificates
  • POST /v1/merchantIds
  • PATCH /v1/merchantIds/{id}
  • DELETE /v1/merchantIds/{id}

Proposed CLI

Top-level group:

  • asc merchant-ids <subcommand> [flags]

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

  • merchant-ids list|get|create|update|delete
  • merchant-ids certificates list|get (read-only, certificates are managed separately)

Examples:

  • asc merchant-ids list
  • asc merchant-ids get --merchant-id MERCHANT_ID
  • asc merchant-ids create --identifier com.example.merchant --name "Example Merchant"
  • asc merchant-ids update --merchant-id MERCHANT_ID --name "Updated Name"
  • asc merchant-ids delete --merchant-id MERCHANT_ID --confirm
  • asc merchant-ids certificates list --merchant-id MERCHANT_ID

Flag patterns

Common:

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

Resource-specific examples:

  • --merchant-id
  • --identifier (reverse domain format)
  • --name

Output

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

Acceptance criteria

  • Commands appear in asc --help and asc merchant-ids --help
  • CRUD works for merchant IDs
  • List command works without filters (all merchant IDs)
  • Create supports identifier and name
  • Update supports name changes
  • Certificates list command works (read-only)
  • 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 certificates listing
  • Output tests for table/markdown

Implementation notes

  • Add cmd/merchant_ids.go and internal/asc/client_merchant_ids.go
  • Add output helpers in internal/asc/output_merchant_ids.go
  • Register command in cmd/root.go
  • Add resource type constants in internal/asc/client_types.go
  • Follow patterns in cmd/bundle_ids.go, cmd/certificates.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/247 # Overview Add CLI support for Merchant IDs, which are used for Apple Pay and other payment services. This enables full management of merchant IDs from the CLI with JSON-first output and explicit flags. # Scope Primary resources from the OpenAPI spec: - `merchantIds` (list, get, create, update, delete) - Relationships: `merchantIds/{id}/certificates`, `merchantIds/{id}/relationships/certificates` Endpoints: - GET /v1/merchantIds - GET /v1/merchantIds/{id} - GET /v1/merchantIds/{id}/certificates - GET /v1/merchantIds/{id}/relationships/certificates - POST /v1/merchantIds - PATCH /v1/merchantIds/{id} - DELETE /v1/merchantIds/{id} # Proposed CLI Top-level group: - `asc merchant-ids <subcommand> [flags]` Subcommands (all support list/get/create/update/delete unless noted): - `merchant-ids list|get|create|update|delete` - `merchant-ids certificates list|get` (read-only, certificates are managed separately) Examples: - `asc merchant-ids list` - `asc merchant-ids get --merchant-id MERCHANT_ID` - `asc merchant-ids create --identifier com.example.merchant --name "Example Merchant"` - `asc merchant-ids update --merchant-id MERCHANT_ID --name "Updated Name"` - `asc merchant-ids delete --merchant-id MERCHANT_ID --confirm` - `asc merchant-ids certificates list --merchant-id MERCHANT_ID` # Flag patterns Common: - `--output`, `--pretty`, `--limit`, `--next`, `--paginate` - `--confirm` for destructive operations Resource-specific examples: - `--merchant-id` - `--identifier` (reverse domain format) - `--name` # Output - JSON minified by default - `--pretty` for JSON - `--output table/markdown` for list commands # Acceptance criteria - [ ] Commands appear in `asc --help` and `asc merchant-ids --help` - [ ] CRUD works for merchant IDs - [ ] List command works without filters (all merchant IDs) - [ ] Create supports identifier and name - [ ] Update supports name changes - [ ] Certificates list command works (read-only) - [ ] 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 certificates listing - Output tests for table/markdown # Implementation notes - Add `cmd/merchant_ids.go` and `internal/asc/client_merchant_ids.go` - Add output helpers in `internal/asc/output_merchant_ids.go` - Register command in `cmd/root.go` - Add resource type constants in `internal/asc/client_types.go` - Follow patterns in `cmd/bundle_ids.go`, `cmd/certificates.go`, and output helpers in `internal/asc/output_*`
kerem closed this issue 2026-02-26 21:33:12 +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#76
No description provided.