[PR #210] [MERGED] Fix subscription create relationship name from subscriptionGroup to group #354

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

📋 Pull Request Information

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

Base: cursor/in-app-purchases-and-subscriptions-5fadHead: fix/subscription-create-relationship-name


📝 Commits (1)

  • 57b7ccc Fix subscription create relationship name from subscriptionGroup to group

📊 Changes

3 files changed (+6 additions, -6 deletions)

View changed files

📝 internal/asc/client_http_test.go (+4 -4)
📝 internal/asc/client_subscriptions.go (+1 -1)
📝 internal/asc/subscriptions.go (+1 -1)

📄 Description

Summary

Fixes a critical bug in PR #118 where subscriptions create fails with:

'subscriptionGroup' is not a relationship on the resource 'subscriptions'

The Problem

The Apple App Store Connect API expects the relationship to be named group, not subscriptionGroup, when creating subscriptions. The API documentation at sosumi.ai shows the correct format.

The Fix

  • Changed JSON tag in SubscriptionCreateRequestDataRelationships from json:"subscriptionGroup" to json:"group"
  • Updated corresponding struct field name from SubscriptionGroup to Group
  • Updated unit tests to match

Files Changed

  • internal/asc/subscriptions.go:87 - Fixed JSON tag
  • internal/asc/client_subscriptions.go:165 - Updated field reference
  • internal/asc/client_http_test.go:3021-3025 - Updated test

Testing

Tested against live App Store Connect API on RetroBudget (app ID 6743363764):

# Before fix - FAILED
$ asc subscriptions create --group b]"2.99" --duration ONE_MONTH
Error: 'subscriptionGroup' is not a relationship on the resource 'subscriptions'

# After fix - WORKS
$ asc subscriptions create --group 2a7c18d5-xxxx --name "Test Sub" --product-id "com.test.sub" --duration ONE_MONTH
{"data":{"type":"subscriptions","id":"...",...}}

All subscription commands verified working:

  • subscriptions groups list/get/create/update/delete
  • subscriptions list/get/create/update/delete
  • Fixes bug found during testing of #118
  • This branch is based on cursor/in-app-purchases-and-subscriptions-5fad

🔄 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/210 **Author:** [@swiftlysingh](https://github.com/swiftlysingh) **Created:** 1/27/2026 **Status:** ✅ Merged **Merged:** 1/27/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `cursor/in-app-purchases-and-subscriptions-5fad` ← **Head:** `fix/subscription-create-relationship-name` --- ### 📝 Commits (1) - [`57b7ccc`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/57b7ccc7fb0d4fd22fa211fd0ff89c1c27f69997) Fix subscription create relationship name from subscriptionGroup to group ### 📊 Changes **3 files changed** (+6 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `internal/asc/client_http_test.go` (+4 -4) 📝 `internal/asc/client_subscriptions.go` (+1 -1) 📝 `internal/asc/subscriptions.go` (+1 -1) </details> ### 📄 Description ## Summary Fixes a critical bug in PR #118 where `subscriptions create` fails with: ``` 'subscriptionGroup' is not a relationship on the resource 'subscriptions' ``` ## The Problem The Apple App Store Connect API expects the relationship to be named `group`, not `subscriptionGroup`, when creating subscriptions. The API documentation at [sosumi.ai](https://sosumi.ai/documentation/appstoreconnectapi/post-v1-subscriptions) shows the correct format. ## The Fix - Changed JSON tag in `SubscriptionCreateRequestDataRelationships` from `json:"subscriptionGroup"` to `json:"group"` - Updated corresponding struct field name from `SubscriptionGroup` to `Group` - Updated unit tests to match ## Files Changed - `internal/asc/subscriptions.go:87` - Fixed JSON tag - `internal/asc/client_subscriptions.go:165` - Updated field reference - `internal/asc/client_http_test.go:3021-3025` - Updated test ## Testing Tested against live App Store Connect API on RetroBudget (app ID 6743363764): ```bash # Before fix - FAILED $ asc subscriptions create --group b]"2.99" --duration ONE_MONTH Error: 'subscriptionGroup' is not a relationship on the resource 'subscriptions' # After fix - WORKS $ asc subscriptions create --group 2a7c18d5-xxxx --name "Test Sub" --product-id "com.test.sub" --duration ONE_MONTH {"data":{"type":"subscriptions","id":"...",...}} ``` All subscription commands verified working: - `subscriptions groups list/get/create/update/delete` ✅ - `subscriptions list/get/create/update/delete` ✅ ## Related - Fixes bug found during testing of #118 - This branch is based on `cursor/in-app-purchases-and-subscriptions-5fad` --- <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:44 +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#354
No description provided.