Skip to main content

Documentation Index

Fetch the complete documentation index at: https://api.docs.onlydrams.app/llms.txt

Use this file to discover all available pages before exploring further.

Cancels a member’s subscription either immediately or at the end of the current billing period.

URL Parameters

community_id
integer
required
The ID of the community
id
integer
required
The ID of the community membership

Request Body

immediate
boolean
If true, cancels immediately. If false or omitted, cancels at end of billing period.

Returns

Returns a success message and the updated member object.
curl -X POST https://api.onlydrams.app/odis/v1/communities/1/members/50/cancel_subscription \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "immediate": true
     }'
{
  "message": "Subscription canceled immediately",
  "member": {
    "id": 50,
    "status": "canceled",
    "canceled_at": "2024-11-14T10:00:00Z",
    "ended_at": "2024-11-14T10:00:00Z",
    "current_period_end": "2024-12-01T00:00:00Z",
    "user": {
      "id": 200,
      "username": "whisky_lover"
    }
  }
}
{
  "message": "Subscription will be canceled at the end of the billing period",
  "member": {
    "id": 50,
    "status": "active",
    "canceled_at": "2024-11-14T10:00:00Z",
    "ended_at": null,
    "current_period_end": "2024-12-01T00:00:00Z",
    "user": {
      "id": 200,
      "username": "whisky_lover"
    }
  }
}

Error Responses

{
  "message": "No active subscription found"
}
{
  "message": "Subscription is already canceled"
}

Notes

  • Authorization: Community owner or admin only
  • Immediate Cancellation: Access ends immediately, no refund issued automatically
  • Period-End Cancellation: Member retains access until current_period_end
  • Stripe: Cancellation is synced to Stripe subscription
  • Refunds: To issue a refund, use the separate refund endpoints