Skip to content

feat(emulate): add Polar.sh Merchant of Record API emulator#179

Open
chenanwang wants to merge 2 commits into
vercel-labs:mainfrom
chenanwang:main
Open

feat(emulate): add Polar.sh Merchant of Record API emulator#179
chenanwang wants to merge 2 commits into
vercel-labs:mainfrom
chenanwang:main

Conversation

@chenanwang

Copy link
Copy Markdown

This PR adds native support for simulating the Polar.sh Merchant of Record API, similar to the existing Stripe emulator. This is highly useful for developers testing alternative Merchant of Record integrations in offline or sandboxed environments.

Implementation Details:

  • Added new package @emulators/polar containing entity types, store mappings, and seeding configuration.
  • Simulated endpoints under /api/v1/:
    • GET /organizations (returns seeded organizations)
    • GET /products (returns seeded products)
    • POST /checkouts/custom (creates a custom checkout checkout link)
    • GET /checkouts/custom/:id (retrieves a checkout)
    • GET /subscriptions (lists subscriptions)
  • Configured CLI registration for polar service.
  • Added comprehensive unit tests (packages/@emulators/polar/src/__tests__/polar.test.ts) covering seeding and API workflows.

/claim #46

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@Rafa-Ross is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread packages/@emulators/polar/src/routes/checkouts.ts
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