Memberships API
Memberships bridge subscriptions and entitlements: a membership row ties a user, organization, or project to a membership tier and an optional subscription_id. Tiers list features (for access checks); products can auto-map to tiers via metadata.
Base URL
https://your-instance.pubflow.com/bridge-payment/membershipsAdmin routes:
https://your-instance.pubflow.com/bridge-payment/admin/membershipsDo not use /api/memberships
The Bridge server mounts this router at /bridge-payment/memberships only. Paths under /api/memberships are not served by Bridge Payments.
Authentication
- Public tier catalog:
GET /memberships/tiersandGET /memberships/tiers/:idare optionally unauthenticated (read-only). - User/org/project membership routes: require a Flowless session (
X-Session-ID, Bearer, etc.) and ownership checks. - Admin routes: require admin privileges.
Core concepts
| Concept | Meaning |
|---|---|
| Membership type / tier | Row in membership_types — id, price, features JSON, metadata |
| Entity membership | Active (or historical) link of user, organization, or project to a tier + subscription |
| Product mapping | Product metadata.membership_type_id targets a tier id; when a subscription is created/paid, Bridge can create or update the right membership row |
| Project tier | GET /memberships/projects/:projectId returns active memberships for quota / billing badges (used by Flowfull clients) |
Endpoint map (public)
| Method | Path | Purpose |
|---|---|---|
| GET | /memberships/tiers | List active tiers |
| GET | /memberships/tiers/:id | Tier detail |
| GET | /memberships/users/me | Current user’s memberships |
| GET | /memberships/users/me/:id | Single membership (current user) |
| POST | /memberships/users/me/:id/cancel | Cancel (current user) |
| GET | /memberships/users/:userId | List for user (authorized) |
| GET | /memberships/users/:userId/:id | Detail |
| POST | /memberships/users/:userId/:id/cancel | Cancel |
| GET | /memberships/organizations/:organizationId | Org memberships |
| GET | /memberships/organizations/:organizationId/:id | Org membership detail |
| POST | /memberships/organizations/:organizationId/:id/cancel | Cancel org membership |
| GET | /memberships/projects/:projectId | Active project memberships |
| GET | /memberships/projects/:projectId/:id | Detail |
| POST | /memberships/projects/:projectId/:id/cancel | Cancel project membership |
| GET | /memberships/access | Feature access check (?feature=) |
Admin endpoints (prefix /bridge-payment/admin/memberships) manage tiers and entity memberships—see the canonical reference below.
Field-level and admin detail
Use the API Reference for request/response shapes where operations are published in OpenAPI. This page summarizes routes and concepts; expand the Memberships and Admin groups in the sidebar as your instance’s spec exposes them.
Related
- Subscriptions API —
product_id,metadata,PATCHpayment method - Organizations guide + Organizations API
- Public products listing —
metadataincludesmembership_type_idwhen you expose it on products