Repository navigation
DEV-8144: sync the Partner API store reads into the catalog - #91
ariel-greenfeld wants to merge 6 commits into
Conversation
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
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
left a comment
There was a problem hiding this comment.
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
| "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.", |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
|
AI: Review lenses for ee1e7a8
|
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
…c-the-partner-api-store-reads
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_pagedefault 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-readsto the endpoint catalog, thepartnernamespace and the skill docs:partner.orders.getOrdersGET /core/v1/partner/orderspartner.orders.getOrderGET /core/v1/partner/orders/:order_idpartner.orders.approveOrderPOST /core/v1/partner/orders/:order_id/approvepartner.payments.getPayments/getPaymentGET /core/v1/partner/payments[/:payment_id]partner.subscriptions.getSubscriptions/getSubscriptionGET /core/v1/partner/subscriptions[/:subscription_id]partner.subscriptions.getSubscriptionInvoiceItemsGET /core/v1/partner/subscriptions/:subscription_id/invoice_itemspartner.products.getProducts/getProductGET /core/v1/partner/products[/:product_id]partner.soldProducts.getSoldProducts/getSoldProductGET /core/v1/partner/sold_products[/:sold_product_id]partner.storeListings.getStoreListingGET /core/v1/partner/store_listings/:store_listing_idpartner.storeSettings.getStoreSettingsGET /core/v1/partner/store_settingspartner.organizationTags.updateOrganizationTagPATCH /core/v1/partner/organizations/:organization_id/tags/:tag_idMethod, 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_pagedefault is now 100 (was 500) on coupons, organization tags, organizations and store listings, and couponstarts_at/ends_atneed a time-zone offset (else 422). Every partner write key now notes that brand-partner keys are read-only (403).Decided for you
util prepareprofile automatically. Alternative: dedicated commands. Why: the ticket asks for catalog parity; no new workflow.updateOrganizationTag— it is in the AC range (DEV-8137) though the DEV-8177 list did not name it. Alternative: leave it out.endpoints.md. Alternative: only the 2 new writes. Why:api endpoints describeis what an agent reads before a write.+as%2B" hint. Alternative: copy it. Why: the client already encodes+; a user following the hint would double-encode (a new test proves the encoding).[Unreleased]bullet. Alternative: bump. Why: same as DEV-7993: sync the catalog with the new Partner coupon and tag endpoints #89; publish is out of scope.If the server#9927 contract changes in review
Redo the matching entry (catalog note/params, the
it.eachrow,endpoints.mdrow):getOrders,approveOrder.per_pagedefault/max → every list key note + theendpoints.mdtable.getOrders,getPayments,getSubscriptions, coupon notes.pathTemplate/pathParams.Tests
npm run typecheck,npm run lint(0 errors), fullnpm test(1313 passed),npm run build, skill data byte-identical.xyte-cli api call, isolated config dir, file secret store) against a local hub atfeature/partner-api-store-reads(own DB clone, no staging or production calls). All of these passed:has_next: true), which confirms the defaultper_pageof 100.per_page=501returned 422.created_fromwith no offset returned 422. With+02:00(sent as%2B02:00) orZit returned 200.pending_approval=true,payment_status=paidandper_page=2filter and page as the notes say.updateOrganizationTagreturned 200.approveOrderon a pending order returned 200 and setapproved_at. A second approve returned 200 with no change, and the pending list was then empty.getOrdersand 403 ("Brand partner API keys are read-only…") onapproveOrderandupdateOrganizationTag.🤖 Generated with Claude Code
https://claude.ai/code/session_01Gv4JfVvyLFoFkYeLX9fAue