Skip to content

feat(account,purchases): missing endpoints and a plan field fix - #20

Merged
imjohnbo merged 1 commit into
catchup/06-tagsfrom
catchup/07-account-purchases
Aug 20, 2026
Merged

feat(account,purchases): missing endpoints and a plan field fix#20
imjohnbo merged 1 commit into
catchup/06-tagsfrom
catchup/07-account-purchases

Conversation

@imjohnbo

@imjohnbo imjohnbo commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Part 7 of 8. Base: #19.

What this adds

Issue #12 named nine endpoints across the account and purchases families. Five had no CLI command. One printed the wrong value.

New account subcommands:

kit account colors
kit account set-colors <hex...>
kit account creator-profile
kit account email-stats
kit account growth-stats [--starting <date>] [--ending <date>]

set-colors validates hex format and the ten-color limit before it sends.

New purchases subcommand:

kit purchases create --file purchase.json

Bug fix

kit account read the plan from plan_name, then fell back to plan. The API returns plan_type as a string and plan as an object. The fallback therefore printed [object Object].

The command now reads plan_type. It also prints the billing interval, the subscriber limit, the trial flag, the renewal date, the time zone, and the sending addresses. A test asserts that the output never contains [object Object].

Design notes

A purchase requires eleven fields, including a products array. It therefore comes from JSON rather than from eleven flags. The command names any missing required field instead of relaying a 422.

The field check tests === undefined, not falsiness. A purchase with a zero discount is valid. A test covers this.

Review notes

Tests: 334 before, 368 after.

Closes #12


The stack

Merge from the top down. Each part builds on the one above it.

PR Contents
1 #14 Client query support and shared helpers
2 #15 Sequence CRUD and sequence emails
3 #16 Posts and snippets
4 #17 Broadcast filters, account-wide stats, link clicks
5 #18 Subscriber slim listing, warnings, filter
6 #19 Tag rename, remove-by-email, bulk delete
7 #20 (this one) Account endpoints and purchase create
8 #21 Spec coverage map and its tests

Base branch: main for part 1, the previous part's branch for the rest.
GitHub retargets each base to main as the part below it merges.

…ield

Issue #12 named nine endpoints across these two families. Five had no CLI
command, and one printed the wrong thing.

New account subcommands:
  kit account colors
  kit account set-colors <hex...>
  kit account creator-profile
  kit account email-stats
  kit account growth-stats [--starting <date>] [--ending <date>]

set-colors validates hex format and the ten-color limit before sending.

New purchases subcommand:
  kit purchases create --file purchase.json

A purchase requires eleven fields including a products array, so it comes from
JSON. The command names any missing required field instead of relaying a 422.

Bug fix: kit account read the plan from plan_name, then fell back to plan. The
API returns plan_type as a string and plan as an object, so the fallback printed
[object Object]. It now reads plan_type, and adds the billing interval,
subscriber limit, trial flag, renewal date, time zone, and sending addresses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kit API spec update: 30 changed

1 participant