This page covers defining an organization's membership tiers, reading which memberships a user holds, and managing the memberships an organization has issued. An organization offers one or more membership tiers. A user's membership is their enrollment in one tier, with its own membership wallet and validity window. See Core Concepts for the model.
Membership tiers
Managing tiers acts on behalf of the organization, so use an org-scoped token.
| Method | Path | Scope |
|---|---|---|
GET | /organizations/{organization_slug}/membership-tiers | org:tiers:read |
POST | /organizations/{organization_slug}/membership-tiers | org:tiers:manage |
GET | /organizations/{organization_slug}/membership-tiers/{tier_uuid} | org:tiers:read |
PATCH / DELETE | /organizations/{organization_slug}/membership-tiers/{tier_uuid} | org:tiers:manage |
Create a tier with a name, price and interval:
curl -X POST \
"https://api.davi.social/api/v1/organizations/ORG_SLUG/membership-tiers" \
-H "Authorization: Bearer ORG_SCOPED_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Gold",
"price_cents": 4900,
"currency": "PHP",
"payment_interval": "monthly",
"description": "Priority access and perks"
}'
| Field | Meaning |
|---|---|
price_cents | The price in minor units of currency: 4900 is ₱49.00, not ₱4,900 |
currency | ISO 4217 code. Defaults to PHP. Every tier returns it, so render a price against the tier's own currency |
payment_interval | daily, weekly, monthly, yearly or one_time |
visibility | private (the default) is neither advertised nor joinable on its own. unlisted is joinable by anyone holding its slug, and public is both. A card carrying the tier enrolls its holder whatever this says |
Reading a user's memberships
GET /memberships (scope user:read) lists the authenticated user's active
memberships across organizations:
curl "https://api.davi.social/api/v1/memberships" \
-H "Authorization: Bearer ACCESS_TOKEN"
Each entry includes organization_uuid and tier_uuid (with
organization_name and tier_name alongside), joined_at, and valid_until.
Check valid_until for expiry; null means the membership does not expire.
With an org-scoped token, the list is filtered to
that organization.
GET /organizations/{organization_slug}/memberships/{user_uuid} returns one
user's membership in a specific organization, including one past valid_until
that can still be renewed. Check valid_until before treating it as active.
A user's staff role on an organization is a different relationship with a different endpoint: see Fetching an Organization.
Managing an organization's memberships
These act on behalf of the organization, so use an org-scoped token.
| Method | Path | Purpose |
|---|---|---|
GET | /organizations/{organization_slug}/memberships | List the organization's memberships |
POST | /organizations/{organization_slug}/memberships | Enroll a user at a tier |
GET / PATCH / DELETE | /organizations/{organization_slug}/memberships/{user_uuid} | Read, change tier, or end a membership |
POST | /organizations/{organization_slug}/memberships/{user_uuid}/renew | Renew a membership |
GET | /organizations/{organization_slug}/memberships/{user_uuid}/history | Membership history, including ended ones |
GET | /organizations/{organization_slug}/memberships/{user_uuid}/wallet | The holder's membership wallet |
GET | /organizations/{organization_slug}/memberships/{user_uuid}/cards | Cards issued to the holder |
A membership is also created when a user claims a card that carries a membership tier.
Cancelling, renewing, restoring and moving between tiers are covered in Change a Membership.
Retiring a tier
Deleting a tier does not move the memberships on it. Retire a tier in this order:
PATCHthe tier'svisibilitytoprivate, so nobody else joins it.POST /organizations/{organization_slug}/membership-tiers/{tier_uuid}/memberships/move(scopeorg:tiers:manage), naming the destination tier inmembership_tier_slug.DELETEthe tier.
Two settings decide what happens to each member:
| Field | Values |
|---|---|
term | keep (default) leaves each member's valid_until alone. convert re-expresses the remaining time at the new tier's price per day |
custom_pricing | What to do with members who have an agreed price: refuse (default) moves nobody and answers 409 naming them, carry keeps their figures, clear puts them on the new tier's price |
Send the move with dry_run: true first. It changes nothing and returns the
report: memberships, the skipped ones, and still_blocking_delete, which
lists what would still stop step 3. Members with an agreed price appear in
skipped on a dry run, and are what makes the real call answer 409 under the
default custom_pricing. This report is what the move endpoint offers over
looping PATCH /organizations/{organization_slug}/memberships/{user_uuid}
yourself.
A real run answers 202 with the same report and scheduled: true, and the
moves happen in the background.
Next
- Change a Membership: cancel, renew, restore.
- Issue Rewards: reward members automatically.
- Run Activities and Check-ins: run events for members.