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.
URL Parameters
The ID of the community
The ID of the membership tier to subscribe to
Returns
Returns the credentials needed to initialize the Stripe PaymentSheet SDK on iOS and Android.Response Fields
| Field | Type | Description |
|---|---|---|
payment_intent | string | The client secret for the PaymentIntent or SetupIntent. Use this to initialize PaymentSheet. |
customer_session_client_secret | string | The CustomerSession client secret for PaymentSheet configuration. |
customer | string | The Stripe Customer ID on the connected account. |
ephemeral_key | string | The ephemeral key secret for the customer. |
publishable_key | string | The Stripe publishable key to use. |
subscription_id | string | The ID of the created subscription (status will be incomplete until payment succeeds). |
tier.id | integer | The membership tier ID. |
tier.name | string | The tier display name. |
tier.price_cents | integer | The monthly price in cents. |
tier.currency | string | The currency code (e.g., usd). |
tier.has_trial | boolean | Whether this tier includes a free trial. |
tier.trial_days | integer | Number of free trial days (null if no trial). |
Error Responses
| Status | Error | Description |
|---|---|---|
| 422 | Community does not have a connected Stripe account | The community hasn’t completed Stripe onboarding. |
| 422 | This tier is not available for subscription | The tier is archived or inactive. |
| 422 | This tier is at capacity | The tier has reached its member limit. |
| 422 | Tier is not configured for payments | The tier is missing Stripe price configuration. |
| 422 | You already have an active subscription to this community | User already has an active or trialing membership. |
| 422 | Could not create payment intent for subscription | Stripe failed to create the payment intent. |
Mobile Implementation Flow
- Call this endpoint to retrieve payment credentials
- Initialize PaymentSheet using the returned values:
payment_intent→ PaymentSheet’spaymentIntentClientSecretcustomer_session_client_secret→ PaymentSheet’scustomerSessionClientSecretcustomer→ PaymentSheet’scustomerIdephemeral_key→ PaymentSheet’scustomerEphemeralKeySecretpublishable_key→ Stripe SDK’s publishable key
- Present PaymentSheet to the user
- Handle completion - on success, the subscription activates via webhook and the user gains membership access
Notes
- Authorization: Requires authenticated user
- Free Trials: When
has_trialis true, thepayment_intentwill be a SetupIntent client secret instead of a PaymentIntent, as no charge occurs until the trial ends - Subscription Status: The subscription is created with status
incompleteand only activates after successful payment confirmation - Connected Accounts: Payments are processed on the community’s connected Stripe account, not the platform account

