Skip to content

DEV-8144: sync the Partner API store reads into the catalog - #91

Draft
ariel-greenfeld wants to merge 6 commits into
mainfrom
dev-8144-xyte-cli-sync-the-partner-api-store-reads
Draft

ariel-greenfeld wants to merge 6 commits into
mainfrom
dev-8144-xyte-cli-sync-the-partner-api-store-reads

Conversation

@ariel-greenfeld

@ariel-greenfeld ariel-greenfeld commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Merge after xyte-io/server#9927 (hub store reads) and xyte-cli#89 (this PR's base). On a hub without server#9927 the new keys return 404 and the per_page default stated in the notes (100) is wrong.

Linear: DEV-8144

What

Adds the Partner API store reads from the hub feature branch feature/partner-api-store-reads to the endpoint catalog, the partner namespace and the skill docs:

Key Request
partner.orders.getOrders GET /core/v1/partner/orders
partner.orders.getOrder GET /core/v1/partner/orders/:order_id
partner.orders.approveOrder POST /core/v1/partner/orders/:order_id/approve
partner.payments.getPayments / getPayment GET /core/v1/partner/payments[/:payment_id]
partner.subscriptions.getSubscriptions / getSubscription GET /core/v1/partner/subscriptions[/:subscription_id]
partner.subscriptions.getSubscriptionInvoiceItems GET /core/v1/partner/subscriptions/:subscription_id/invoice_items
partner.products.getProducts / getProduct GET /core/v1/partner/products[/:product_id]
partner.soldProducts.getSoldProducts / getSoldProduct GET /core/v1/partner/sold_products[/:sold_product_id]
partner.storeListings.getStoreListing GET /core/v1/partner/store_listings/:store_listing_id
partner.storeSettings.getStoreSettings GET /core/v1/partner/store_settings
partner.organizationTags.updateOrganizationTag PATCH /core/v1/partner/organizations/:organization_id/tags/:tag_id

Method, path, path params, query params and body come from the Bruno files on the hub branch and match the controllers.

Also updates #89's notes that the hub branch makes false: per_page default is now 100 (was 500) on coupons, organization tags, organizations and store listings, and coupon starts_at/ends_at need a time-zone offset (else 422). Every partner write key now notes that brand-partner keys are read-only (403).

Decided for you

If the server#9927 contract changes in review

Redo the matching entry (catalog note/params, the it.each row, endpoints.md row):

  • Orders filters, approve body or approve status codes → getOrders, approveOrder.
  • Any list per_page default/max → every list key note + the endpoints.md table.
  • Time filter rule (offset, inclusive/exclusive) → getOrders, getPayments, getSubscriptions, coupon notes.
  • Brand read-only rule → the 12 write-key notes + the test "notes that brand partner keys are read-only on every partner write".
  • Path param or route renames → the affected key's pathTemplate/pathParams.
  • Store plan gating → the "Requires the Store plan feature" notes.

Tests

  • Unit (head c683ad5): npm run typecheck, npm run lint (0 errors), full npm test (1313 passed), npm run build, skill data byte-identical.
  • Reviews: own deep review (19 Low, 7 doc/note fixes in ee1e7a8, 12 declined as not one-liners or pre-existing); bot review (9 findings, all fixed in c683ad5, decision acknowledged). The full loop ran on 3dd4ffe; later commits change only notes, docs and tests.
  • Full loop: the built CLI (xyte-cli api call, isolated config dir, file secret store) against a local hub at feature/partner-api-store-reads (own DB clone, no staging or production calls). All of these passed:
    • All 14 new GET keys returned 200 with seeded data (orders, payments, subscriptions + invoice items, products, sold products, store listing, store settings).
    • The 4 changed lists returned 200. Organizations returned 100 of 520 (has_next: true), which confirms the default per_page of 100. per_page=501 returned 422.
    • created_from with no offset returned 422. With +02:00 (sent as %2B02:00) or Z it returned 200.
    • pending_approval=true, payment_status=paid and per_page=2 filter and page as the notes say.
    • updateOrganizationTag returned 200. approveOrder on a pending order returned 200 and set approved_at. A second approve returned 200 with no change, and the pending list was then empty.
    • A brand-partner key got 200 on getOrders and 403 ("Brand partner API keys are read-only…") on approveOrder and updateOrganizationTag.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Gv4JfVvyLFoFkYeLX9fAue

ariel-greenfeld and others added 3 commits November 23, 2026 09:20
Add 15 partner catalog keys and client namespace methods from hub
server#9927 (orders incl. approveOrder, payments, subscriptions and
invoice items, products, sold products, store listing, store settings,
updateOrganizationTag), with Bruno query params and notes.

Correct the #89 partner list notes to per_page default 100, note the
time-zone offset rule on coupon starts_at/ends_at, and state the
brand-partner read-only rule once in endpoints.md. Skills data synced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gv4JfVvyLFoFkYeLX9fAue
F2: CHANGELOG bullet covers the order approval and tag rename writes, not only store reads
F4: endpoints.md getOrders row states include_renewals defaults to false
F5: endpoints.md getPayments / getProducts rows say offline payments / shared products are not listed
F6: endpoints.md Store-plan sentence says coupons also need store coupons enabled
F9: approveOrder note lists the 422s and that body shape and dates are checked before the order state, item keys after
F10: orders, payments and subscriptions notes say *_to must be after *_from, else 422
F11: getSubscriptions note says next_charge_at is a date read as 00:00 UTC

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gv4JfVvyLFoFkYeLX9fAue

@xyte-genie xyte-genie left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Partners using the CLI can now list and inspect their store orders, payments, subscriptions, products, sold products, a single store listing and store settings, approve an order, and edit an organization tag. The reference notes are corrected for the matching hub release: partner lists now default to 100 rows per page and coupon dates need a time-zone offset. Every partner write now tells the user that brand-partner keys are read-only.

reviewed@ee1e7a8ced4dae6bb3e21b7cc6155974390768b4

Comment thread CHANGELOG.md Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread tests/auth-and-client.test.ts Resolved
Comment thread tests/endpoints.test.ts Resolved
Comment thread tests/namespaces.test.ts Resolved
"dev.xyte.io page pending; endpoint added by xyte-io/server#9927.",
"Requires the Store plan feature (403 otherwise).",
"Brand partner API keys are read-only (403).",
"Approval cannot be undone; it creates the purchased products and emails the customer. An already approved order returns 200 and nothing changes. 422 when the order is not awaiting approval.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: [Decision] Irreversible order approval ships as a plain catalog write: warning note only, no confirm or batch guard

  • Situation: Approving an order cannot be undone: it creates the purchased products and emails the customer. The CLI treats every non-GET call the same way, and the batch prepare tool lists this key like any other write.
  • Chosen: Expose it as a raw catalog key with the generic batch profile; the only safeguard is a catalog note saying approval cannot be undone, which an agent reads before calling.
  • Alternative: Mark the key as irreversible so the CLI and batch tool require an explicit confirm or exclude it from generic loops, or hold it back until a dedicated command exists.
  • Impact: A mistaken or looped call approves real orders and emails customers with no way back; this matches how device and coupon deletes are treated today, so the risk is accepted, not new.
  • Decided by: reviewer bot (inferred)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Acknowledged - approveOrder ships like the other partner writes (device and coupon deletes): a raw key with a note that approval cannot be undone; a confirm guard for irreversible writes would be a CLI-wide change, not part of this sync.

@xyte-genie

Copy link
Copy Markdown

AI: Review lenses for ee1e7a8

Lens Status Why
cross-repo ran 15 new catalog entries and 4 corrected notes claim to mirror hub branch feature/partner-api-store-reads (server#​9927); every method, path, param, body and status note must be checked against that branch's Bruno files and controllers.
docs ran skills/xyte-cli/references/endpoints.md is hand-maintained and must agree with the catalog it says it derives from; other docs (README, docs/commands.md, SKILL.md) may still carry stale partner pagination or key lists.
spec-coverage ran The PR adds four test changes whose assertions may be tautological copies of the catalog rather than checks of behaviour (brand read-only guard, it.each rows, + encoding, namespace map).
correctness ran Hand-written JSON catalog entries and namespace/type additions can be internally inconsistent (placeholders vs pathParams, key ordering, bodyType/hasBody, action naming).
decisions ran The body lists seven explicit decisions (no dedicated commands, updateOrganizationTag inclusion, fixing #​89 notes here, read-only note on all writes, dropping the %2B hint, no version bump, no xyte-mcp regen) and a merge-order gate on server#​9927.
security-tenancy skipped No auth or scoping logic in xyte-cli; the brand read-only and Store-plan rules are hub-side and are verified by cross-repo.
data-integrity skipped No writes, jobs or persistence in this repo; approveOrder's irreversibility is covered as a decision.
migrations-rollout skipped No migrations, jobs, flags or cached values; rollout n/a.
performance skipped Static JSON catalog and a map of method names; nothing executes per request beyond existing paths.
api-compat skipped xyte-cli consumes the hub API; it defines no public API of its own here, and additive namespace methods break no caller.
backwards-compat skipped Only additive keys and corrected note text; no default or behaviour flips in the client.
errors-observability skipped No new raises, messages or logs; status-code notes are documentation checked by cross-repo and docs.
ui-ux-product skipped No web/ files; xyte-cli has no screens touched here.
accessibility-i18n skipped No UI text or controls.
readability skipped New names follow the existing namespace.group.action pattern; nothing novel to name.
over-engineering skipped The 900-line diff is catalog data duplicated by design (skills copy is byte-identical by script); no new abstraction.
spec-vs-ticket skipped Ticket title equals the PR scope; completeness against the hub branch (keys and notes the branch adds beyond the 15) is checked inside cross-repo.
deps-infra skipped No package.json, lockfile or infra changes.
skills-authoring skipped Only skills/xyte-cli/references/endpoints.md and its data file change; no SKILL.md frontmatter, agents or AGENTS.md, and the reference-page content is checked by docs.

@xyte-genie xyte-genie added the awaiting-author Waiting on the author: the reviewer left comments to address label Nov 23, 2026
ariel-greenfeld and others added 2 commits November 23, 2026 09:44
CHANGELOG: updateOrganizationTag is an organization tag note update, not a rename
getOrder note: also returns renewal orders (getOrders needs include_renewals=true)
addOrganizationTag note: note optional, up to 1000 chars (422 otherwise); updateOrganizationTag changes it
getSoldProducts, getStoreListing, getSubscription notes: ids of another partner answer 404 on the matching get*
getStoreListings note: brand partner sees its brands' listings in store order; its coupons cannot use them
getSubscriptions note: next_charge_at null matches neither next_charge filter
cli test: --query created_from with +02:00 reaches the transport as %2B02%3A00
skills test: endpoints.md pins the brand read-only and Store plan sentences
namespaces test: every partner catalog key is called by a createPartnerNamespace method

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gv4JfVvyLFoFkYeLX9fAue
…59a5c317f

Orders list/get/approve note approved_by (API key, portal user or null; a
repeat approve keeps the first approver). Payments list/get note that the
totals are the partner's share, not the buyer's full charge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gv4JfVvyLFoFkYeLX9fAue
@ariel-greenfeld
ariel-greenfeld changed the base branch from dev-7993-xyte-cli-sync-the-public-endpoint-catalog-with-the to main November 23, 2026 16:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author Waiting on the author: the reviewer left comments to address

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants