Documentation

Manage Tiers and Memberships

Create and retire an organization's membership tiers, read a user's memberships, and manage an organization's members.

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.

MethodPathScope
GET/organizations/{organization_slug}/membership-tiersorg:tiers:read
POST/organizations/{organization_slug}/membership-tiersorg: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"
  }'
FieldMeaning
price_centsThe price in minor units of currency: 4900 is ₱49.00, not ₱4,900
currencyISO 4217 code. Defaults to PHP. Every tier returns it, so render a price against the tier's own currency
payment_intervaldaily, weekly, monthly, yearly or one_time
visibilityprivate (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.

MethodPathPurpose
GET/organizations/{organization_slug}/membershipsList the organization's memberships
POST/organizations/{organization_slug}/membershipsEnroll 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}/renewRenew a membership
GET/organizations/{organization_slug}/memberships/{user_uuid}/historyMembership history, including ended ones
GET/organizations/{organization_slug}/memberships/{user_uuid}/walletThe holder's membership wallet
GET/organizations/{organization_slug}/memberships/{user_uuid}/cardsCards 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:

  1. PATCH the tier's visibility to private, so nobody else joins it.
  2. POST /organizations/{organization_slug}/membership-tiers/{tier_uuid}/memberships/move (scope org:tiers:manage), naming the destination tier in membership_tier_slug.
  3. DELETE the tier.

Two settings decide what happens to each member:

FieldValues
termkeep (default) leaves each member's valid_until alone. convert re-expresses the remaining time at the new tier's price per day
custom_pricingWhat 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