Skip to content

polar-config skill: refer to versioned config entries by external ID, never by Polar ID - #39

Merged
sebastianekstrom merged 4 commits into
mainfrom
abris/xp-75-external-id-lookup
Nov 27, 2026
Merged

sebastianekstrom merged 4 commits into
mainfrom
abris/xp-75-external-id-lookup

Conversation

@simonxabris

@simonxabris simonxabris commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #30.

Publishing a changed product, benefit, meter or custom field creates a new version with a new Polar ID. Only the external ID (or the custom field's slug) stays the same. In a test session, the agent stored the product ID in POLAR_PRODUCT_ID. After a price change it published catalog v2, and Subscribe started failing with "Product is no longer sold". The agent's fix was to paste the new ID into .env.local, which will break again on the next publish.

This replaces the one-line product warning in polar-config with a "Never store a Polar ID for something in the config" section:

  • A table mapping what the app wants to do to the 2027-01 parameter that takes an external ID: external_products, external_benefit_id, external_meter_id, external_product_id, and external_id with catalog_status: "live" on products.list, benefits.list and meters.list.
  • Why catalog_status: "live" is needed: is_archived: false does not drop retired versions.
  • Compare external_id on what Polar returns (subscriptions, grants). Customer state only has benefit_id and meter_id, so use the external ID filters instead.
  • Custom field values are keyed by slug. Checkout links: keep the URL, not the product ID.

Fixes XP-75. Related: XP-77.

@simonxabris
simonxabris added this pull request to stack #40 November 26, 2026 14:07
@simonxabris
simonxabris marked this pull request as ready for review November 26, 2026 14:12
@simonxabris simonxabris changed the title polar-config skill: resolve products by external_id instead of pinning IDs polar-config skill: refer to versioned config entries by external ID, never by Polar ID Nov 26, 2026
@sebastianekstrom
sebastianekstrom force-pushed the abris/xp-75-external-id-lookup branch from 155b5ff to 7c89559 Compare November 27, 2026 13:12
Base automatically changed from skills/polar-config to main November 27, 2026 13:21
@sebastianekstrom
sebastianekstrom force-pushed the abris/xp-75-external-id-lookup branch from 7c89559 to 0a47284 Compare November 27, 2026 13:21
@sebastianekstrom
sebastianekstrom merged commit c755841 into main Nov 27, 2026
17 of 19 checks passed
@sebastianekstrom
sebastianekstrom deleted the abris/xp-75-external-id-lookup branch November 27, 2026 13:28
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.

2 participants