mirror of
https://github.com/rudrankriyam/App-Store-Connect-CLI.git
synced 2026-04-25 23:55:51 +03:00
[GH-ISSUE #470] Parity: IAP offer code generation endpoints (custom codes + one-time use batches) #135
Labels
No labels
bug
bug
documentation
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/App-Store-Connect-CLI#135
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rudrankriyam on GitHub (Feb 10, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/470
Overview
Add missing creation/generation operations for in-app purchase offer code code resources.
Scope (OpenAPI resources)
POST /v1/inAppPurchaseOfferCodeCustomCodesPOST /v1/inAppPurchaseOfferCodeOneTimeUseCodesCurrent state
Current CLI support already includes read/update surfaces for these resources (list/get, and patch where applicable), but create/generate endpoints are not exposed.
Proposed CLI
Custom (vanity) codes
asc iap offer-codes custom-codes create --offer-code-id "OFFER_CODE_ID" --custom-code "HOLIDAY2026"One-time use code batches
asc iap offer-codes one-time-codes create --offer-code-id "OFFER_CODE_ID" --quantity 100 --expiration-date "2026-12-31"Examples:
asc iap offer-codes custom-codes create --offer-code-id "OFFER_CODE_ID" --custom-code "SUMMER26"asc iap offer-codes one-time-codes create --offer-code-id "OFFER_CODE_ID" --quantity 500 --expiration-date "2026-09-30"Flag patterns
Common:
--offer-code-id,--output,--prettyAdditional:
--custom-code--quantity,--expiration-date(or exact OpenAPI-required field names)Validation rules:
quantitypositive integerDetailed TODO
internal/ascIAP offer code types.internal/asc/client_iap_subresources.go:internal/cli/iap/offer_code_codes.go:custom-codes createone-time-codes createAcceptance criteria
make format,make lint, andmake testpass.Tests
Implementation notes
References
docs/openapi/paths.txtdocs/openapi/latest.jsoninternal/asc/client_iap_subresources.gointernal/cli/iap/offer_code_codes.go@rudrankriyam commented on GitHub (Feb 10, 2026):
@cursor Please implement this issue end-to-end.
What to build
Add creation/generation support for IAP offer-code code resources.
Endpoints to add
POST /v1/inAppPurchaseOfferCodeCustomCodesPOST /v1/inAppPurchaseOfferCodeOneTimeUseCodesImplementation plan
internal/asc)inAppPurchaseOfferCodes.internal/asc/client_iap_subresources.go)CreateInAppPurchaseOfferCodeCustomCode(...)CreateInAppPurchaseOfferCodeOneTimeUseCode(...)internal/cli/iap/offer_code_codes.go)asc iap offer-codes custom-codes create --offer-code-id ... --custom-code ...asc iap offer-codes one-time-codes create --offer-code-id ... --quantity ... --expiration-date ...--offer-code-id--custom-code--quantityNew tests to write
A) Client HTTP tests (
internal/asc/client_http_test.go)TestCreateInAppPurchaseOfferCodeCustomCode_UsesPostPathTestCreateInAppPurchaseOfferCodeOneTimeUseCode_UsesPostPathFor each test assert:
B) CLI cmdtests (new file)
internal/cli/cmdtest/iap_offer_code_code_generation_test.goCases to include:
--offer-code-id-> usage error--custom-code-> usage error--offer-code-id-> usage error--quantity(0, negative, non-integer) -> usage error--expiration-date-> usage errorC) Output behavior test
--pretty.How to test locally
Run exactly:
make formatmake lintmake testTargeted tests:
go test ./internal/asc -run 'CreateInAppPurchaseOfferCode(CustomCode|OneTimeUseCode)'go test ./internal/cli/cmdtest -run 'iap_offer_code_code_generation'Done criteria
format,lint,test).@cursor[bot] commented on GitHub (Feb 10, 2026):
Here's a summary of what I implemented:
Types (
internal/asc/iap_resources.go)InAppPurchaseOfferCodeCustomCodeCreateRequestwith attributes (customCode,numberOfCodes, optionalexpirationDate) and relationship toinAppPurchaseOfferCodesInAppPurchaseOfferCodeOneTimeUseCodeCreateRequestwith attributes (numberOfCodes,expirationDate) and relationship toinAppPurchaseOfferCodesClient methods (
internal/asc/client_iap_subresources.go)CreateInAppPurchaseOfferCodeCustomCode-- POST to/v1/inAppPurchaseOfferCodeCustomCodesCreateInAppPurchaseOfferCodeOneTimeUseCode-- POST to/v1/inAppPurchaseOfferCodeOneTimeUseCodesCLI subcommands (
internal/cli/iap/offer_code_codes.go)asc iap offer-codes custom-codes create --offer-code-id ... --custom-code ... --quantity ... [--expiration-date ...] [--output ...] [--pretty]asc iap offer-codes one-time-codes create --offer-code-id ... --quantity ... --expiration-date ... [--output ...] [--pretty]Tests
make format,make lint,make testall green@rudrankriyam commented on GitHub (Feb 10, 2026):
Implemented and merged in #472.
IAP offer code generation parity is now covered (custom codes plus one-time use batches), including validation and API error-path tests.
Closing as complete.