Skip to main content

polar-member-model

Migrate a Polar seat-based integration from customer_id to the member model. Use when Polar has told you your organization moves to the member model, or when code reads customer_id to identify who holds a seat.

معلومات المصدر

المستودع
polarsource/polar
آخر نشاط في المصدر
٢٨ سبتمبر ٢٠٢٦ في ٠٩:٣٣
لغة SKILL.md المكتشفة
الإنجليزية
النجوم
١٠٬٣٢٤
التفرعات
٧٩٨

خيارات التثبيت

يُحدَّد Prompt الذي يراجع المصدر أولًا بشكل افتراضي. يمكنك التبديل إلى أمر مباشر أو تنزيل نسخة محلية.

مراجعة ملفات المصدر

اقرأ SKILL.md وأي ملفات مرافقة يعرضها SkillsMP قبل أن تقرر التثبيت.

عرض SKILL.md

SKILL.md
تعليمات المصدر · معاينة للقراءة فقط
name
polar-member-model
description
Migrate a Polar seat-based integration from customer_id to the member model. Use when Polar has told you your organization moves to the member model, or when code reads customer_id to identify who holds a seat.
# Migrate a Polar seat-based integration to the member model On seat-based products, `customer_id` used to be the seat holder. It becomes the buyer. Every seat and grant carries a `member`, which is the person. Read that. ## Change Find reads of `customer_id` on seats and benefit grants — REST responses and the `customer_seat.*`, `benefit_grant.*` webhooks — and rewrite the ones that mean "the person holding this seat": ```diff - grantAccess(seat.customer_id) + grantAccess(seat.member.id, seat.member.email) ``` Leave the ones that mean "the account that pays". `seat.email` and `seat.customer_email` already resolve to the holder; leave those too. ## Watch out A branch on whether `member` is set cannot tell a seat holder from a buyer: direct purchases carry the buyer's own member. ```diff - if (grant.member) { holder(grant.member) } else { buyer(grant.customer_id) } + holder(grant.member) ``` Keep a null check for the type, but read no meaning into it — Polar leaves `member` unset on old revoked grants. Use `member.role` to tell a buyer (`owner`, `billing_manager`) from a holder (`member`), and `member.customer_id` for the billing customer. ## Also - Seat-holder `customer_id` stored in your database will return `404`. Remap it to `member.id` from `GET /v1/customer-seats`, or set `external_member_id` at assignment and key on your own identifier. - Pass `member_id` to `customerSessions.create`. Required for team customers. - Never mix `customer_id`/`external_customer_id` with `member_id`/`external_member_id` in one seat assignment. ## Report List every read you left alone as "the buyer", so a human can check the call.
عرض على GitHub