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.

Issues a full or partial refund for the most recent invoice of a member’s subscription.

URL Parameters

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

Request Body

amount_cents
integer
Amount to refund in cents. If omitted, full invoice amount is refunded.
reason
string
Refund reason: duplicate, fraudulent, or requested_by_customer (default)

Returns

Returns the refund details from Stripe.
curl -X POST https://api.onlydrams.app/odis/v1/communities/1/members/50/issue_refund \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "amount_cents": 999,
       "reason": "requested_by_customer"
     }'
{
  "success": true,
  "refund": {
    "id": "re_1234567890",
    "amount_cents": 999,
    "amount_dollars": 9.99,
    "currency": "usd",
    "status": "succeeded",
    "reason": "requested_by_customer",
    "charge_id": "ch_1234567890",
    "created": 1699970400
  }
}
{
  "success": true,
  "refund": {
    "id": "re_0987654321",
    "amount_cents": 1999,
    "amount_dollars": 19.99,
    "currency": "usd",
    "status": "succeeded",
    "reason": "requested_by_customer",
    "charge_id": "ch_1234567890",
    "created": 1699970400
  }
}

Error Responses

{
  "message": "No charge found for the latest invoice"
}
{
  "message": "Refund failed: Charge already refunded"
}

Notes

  • Authorization: Community owner or admin only
  • Latest Invoice: Refunds the most recent invoice charge
  • Partial Refunds: Specify amount_cents less than invoice total
  • Full Refunds: Omit amount_cents to refund entire invoice
  • Metadata: Refund details are stored in member metadata
  • Subscription: Refunding doesn’t cancel the subscription automatically
  • Stripe: Refund is processed through Stripe and may take 5-10 business days to appear