Skip to main content

Subscriptions

Base URL: https://app.neuroflash.com/api/workspace-service

View the current subscription for a workspace.

Get

GET/v1/workspaces/{workspaceId}/subscriptions/{subscriptionId}

Response

FieldTypeDescription
_embeddedobject
availableWordsintegerdeprecated: fields are there until frontend removes all the usages default values are used, no adjustments are made! it always reports that the workspace is on an unlimited plan
newPricingPlanobject
activebooleanset to true when this pricingPlan can be configured on existing and new subscriptions
billingIntervalstring
categoryIdstringID of the category this plan belongs to
displayNamestringname used for internal purposes like the admin-ui or hubspot. Should not be displayed to customers
idstringid of the pricing plan
importedFromLegacyIdinteger
isDefaultbooleanIs this the default plan for new customers?
priceInEuronumberhow much the customer needs to pay for this subscription
pricePerCurrencyobjectA map of string keys to float values
stripeBillingPortalEnabledbooleantrue if subscriptions with this pricingPlan can be self-managed in the stripe billing portal
stripePriceIdstringID of the price in stripe
stripeTrackTokenMeterstring
stripeTrackUsagebooleandeprecated
tierinteger
trialDaysintegerhow many trial days are allowed for this plan
pricingPlanobject
activebooleanset to true when this pricingPlan can be configured on existing and new subscriptions
billingIntervalstring
categoryIdstringID of the category this plan belongs to
displayNamestringname used for internal purposes like the admin-ui or hubspot. Should not be displayed to customers
idstringid of the pricing plan
importedFromLegacyIdinteger
isDefaultbooleanIs this the default plan for new customers?
priceInEuronumberhow much the customer needs to pay for this subscription
pricePerCurrencyobjectA map of string keys to float values
stripeBillingPortalEnabledbooleantrue if subscriptions with this pricingPlan can be self-managed in the stripe billing portal
stripePriceIdstringID of the price in stripe
stripeTrackTokenMeterstring
stripeTrackUsagebooleandeprecated
tierinteger
trialDaysintegerhow many trial days are allowed for this plan
pricingPlanCategoryobject
displayNamestring
idstring
translationKeystring
activebooleanFlag indicating whether the subscription is active. Subscriptions can become inactive if they are paused or have more members than the current plan allows
activeDiscountsarray<string>readonly synced from stripe: true if a discount is active for this stripe subscription
availableWordsinteger
createdAtstring
createdByUserIdstring
currencystring
endDatestringreadonly synced from Stripe: date at which this subscription will automatically be cancelled
idstring
importedFromLegacyCustomerIdintegerDeprecated: only needed while import from legacy api is still active ID of the legacy customer this was imported from
isGracePeriodbooleantrue if the subscription will be cancelled at a set date in the future
isTrialbooleantrue if this is currently a trial period
limitRenewalDatestringnext date on which the limits (like words available, images available etc) will be reset. This happens every month, starting with the start of the subscription
nextSubscriptionCycleStartstringreadonly synced from Stripe: Timestamp when the next billing cycle starts. This is NOT necessarily the timestamp when we reset the limits in our system because we reset them monthly even if this is a yearly plan
paymentCardNumberLastFourDigitsstringreadonly synced from Stripe: Last four digits of the payment card number. Uses the default payment on the subscription with a fallback to the payment from the last invoice
paymentMethodCardBrandstring
paymentPausedbooleanreadonly synced from Stripe: true if the payment collection for this subscription is currently paused. Even though stripe intends these subscription to stay active and just be free for a while, we treat subscriptions with payment paused as inactive
paymentTypestring
pricingPlanIdstring
pricingPlanWordsintegerdeprecated: fields are there until frontend removes all the usages default values are used, no adjustments are made! it always reports that the workspace is on an unlimited plan
sepaPaymentFailedbooleanreadonly synced from Stripe: Flag indicating whether the SEPA payment has failed
spilloverWordsinteger
stripeStatusstring
stripeSubscriptionIdstringStripe subscription ID
stripeSubscriptionItemIdstringID of the subscription item in stripe (subscriptions should only have one item)
trialEndsAtstringreadonly synced from Stripe: Timestamp when the trial period ends
trialStartedAtstringreadonly synced from stripe: if a trial is in progress, date when it started
updatedAtstring
usedWordsinteger
workspaceIdstringID of the workspace this subscription belongs to

Example

curl "https://app.neuroflash.com/api/workspace-service/v1/workspaces/{workspace_id}/subscriptions/{subscription_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response:

{
"_embedded": {
"availableWords": 500,
"newPricingPlan": {
"active": false,
"billingInterval": "day",
"categoryId": "18d0035a-5850-4bf4-8d5d-3dc8684e2bb2",
"displayName": "Business Pro with 3 members",
"id": "18d0045a-5850-4bf4-8d5d-3dc8684e2bb2",
"importedFromLegacyId": 0,
"isDefault": true,
"priceInEuro": 24.5,
"pricePerCurrency": {},
"stripeBillingPortalEnabled": false,
"stripePriceId": "price_123",
"stripeTrackTokenMeter": "string",
"stripeTrackUsage": false,
"tier": 5,
"trialDays": 7
},
"pricingPlan": {
"active": false,
"billingInterval": "day",
"categoryId": "18d0035a-5850-4bf4-8d5d-3dc8684e2bb2",
"displayName": "Business Pro with 3 members",
"id": "18d0045a-5850-4bf4-8d5d-3dc8684e2bb2",
"importedFromLegacyId": 0,
"isDefault": true,
"priceInEuro": 24.5,
"pricePerCurrency": {},
"stripeBillingPortalEnabled": false,
"stripePriceId": "price_123",
"stripeTrackTokenMeter": "string",
"stripeTrackUsage": false,
"tier": 5,
"trialDays": 7
},
"pricingPlanCategory": {
"displayName": "string",
"id": "string",
"translationKey": "string"
}
},
"active": true,
"activeDiscounts": [
"string"
],
"availableWords": 500,
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"currency": "aed",
"endDate": "string",
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"importedFromLegacyCustomerId": 12345,
"isGracePeriod": false,
"isTrial": false,
"limitRenewalDate": "string",
"nextSubscriptionCycleStart": "2024-01-01T00:00:00Z",
"paymentCardNumberLastFourDigits": "4242",
"paymentMethodCardBrand": "amex",
"paymentPaused": false,
"paymentType": "acss_debit",
"pricingPlanId": "18d0045a-5850-4bf4-8d5d-3dc8684e2bb2",
"pricingPlanWords": 10000,
"sepaPaymentFailed": false,
"spilloverWords": 500,
"stripeStatus": "active",
"stripeSubscriptionId": "sub_12345abcdef",
"stripeSubscriptionItemId": "sub_item_ad909w0",
"trialEndsAt": "2023-12-31T23:59:59Z",
"trialStartedAt": "string",
"updatedAt": "2025-01-14T16:20:59Z",
"usedWords": 5000,
"workspaceId": "550e8400-e29b-41d4-a716-446655440000"
}

Update

PUT/v1/workspaces/{workspaceId}/subscriptions/{subscriptionId}

Example

curl -X PUT "https://app.neuroflash.com/api/workspace-service/v1/workspaces/{workspace_id}/subscriptions/{subscription_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'

Update

PATCH/v1/workspaces/{workspaceId}/subscriptions/{subscriptionId}

Example

curl -X PATCH "https://app.neuroflash.com/api/workspace-service/v1/workspaces/{workspace_id}/subscriptions/{subscription_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'

Get current subscription

GET/v1/workspaces/{workspaceId}/current-subscription

Response

FieldTypeDescription
_embeddedobject
availableWordsintegerdeprecated: fields are there until frontend removes all the usages default values are used, no adjustments are made! it always reports that the workspace is on an unlimited plan
newPricingPlanobject
activebooleanset to true when this pricingPlan can be configured on existing and new subscriptions
billingIntervalstring
categoryIdstringID of the category this plan belongs to
displayNamestringname used for internal purposes like the admin-ui or hubspot. Should not be displayed to customers
idstringid of the pricing plan
importedFromLegacyIdinteger
isDefaultbooleanIs this the default plan for new customers?
priceInEuronumberhow much the customer needs to pay for this subscription
pricePerCurrencyobjectA map of string keys to float values
stripeBillingPortalEnabledbooleantrue if subscriptions with this pricingPlan can be self-managed in the stripe billing portal
stripePriceIdstringID of the price in stripe
stripeTrackTokenMeterstring
stripeTrackUsagebooleandeprecated
tierinteger
trialDaysintegerhow many trial days are allowed for this plan
pricingPlanobject
activebooleanset to true when this pricingPlan can be configured on existing and new subscriptions
billingIntervalstring
categoryIdstringID of the category this plan belongs to
displayNamestringname used for internal purposes like the admin-ui or hubspot. Should not be displayed to customers
idstringid of the pricing plan
importedFromLegacyIdinteger
isDefaultbooleanIs this the default plan for new customers?
priceInEuronumberhow much the customer needs to pay for this subscription
pricePerCurrencyobjectA map of string keys to float values
stripeBillingPortalEnabledbooleantrue if subscriptions with this pricingPlan can be self-managed in the stripe billing portal
stripePriceIdstringID of the price in stripe
stripeTrackTokenMeterstring
stripeTrackUsagebooleandeprecated
tierinteger
trialDaysintegerhow many trial days are allowed for this plan
pricingPlanCategoryobject
displayNamestring
idstring
translationKeystring
activebooleanFlag indicating whether the subscription is active. Subscriptions can become inactive if they are paused or have more members than the current plan allows
activeDiscountsarray<string>readonly synced from stripe: true if a discount is active for this stripe subscription
availableWordsinteger
createdAtstring
createdByUserIdstring
currencystring
endDatestringreadonly synced from Stripe: date at which this subscription will automatically be cancelled
idstring
importedFromLegacyCustomerIdintegerDeprecated: only needed while import from legacy api is still active ID of the legacy customer this was imported from
isGracePeriodbooleantrue if the subscription will be cancelled at a set date in the future
isTrialbooleantrue if this is currently a trial period
limitRenewalDatestringnext date on which the limits (like words available, images available etc) will be reset. This happens every month, starting with the start of the subscription
nextSubscriptionCycleStartstringreadonly synced from Stripe: Timestamp when the next billing cycle starts. This is NOT necessarily the timestamp when we reset the limits in our system because we reset them monthly even if this is a yearly plan
paymentCardNumberLastFourDigitsstringreadonly synced from Stripe: Last four digits of the payment card number. Uses the default payment on the subscription with a fallback to the payment from the last invoice
paymentMethodCardBrandstring
paymentPausedbooleanreadonly synced from Stripe: true if the payment collection for this subscription is currently paused. Even though stripe intends these subscription to stay active and just be free for a while, we treat subscriptions with payment paused as inactive
paymentTypestring
pricingPlanIdstring
pricingPlanWordsintegerdeprecated: fields are there until frontend removes all the usages default values are used, no adjustments are made! it always reports that the workspace is on an unlimited plan
sepaPaymentFailedbooleanreadonly synced from Stripe: Flag indicating whether the SEPA payment has failed
spilloverWordsinteger
stripeStatusstring
stripeSubscriptionIdstringStripe subscription ID
stripeSubscriptionItemIdstringID of the subscription item in stripe (subscriptions should only have one item)
trialEndsAtstringreadonly synced from Stripe: Timestamp when the trial period ends
trialStartedAtstringreadonly synced from stripe: if a trial is in progress, date when it started
updatedAtstring
usedWordsinteger
workspaceIdstringID of the workspace this subscription belongs to

Example

curl "https://app.neuroflash.com/api/workspace-service/v1/workspaces/{workspace_id}/current-subscription" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response:

{
"_embedded": {
"availableWords": 500,
"newPricingPlan": {
"active": false,
"billingInterval": "day",
"categoryId": "18d0035a-5850-4bf4-8d5d-3dc8684e2bb2",
"displayName": "Business Pro with 3 members",
"id": "18d0045a-5850-4bf4-8d5d-3dc8684e2bb2",
"importedFromLegacyId": 0,
"isDefault": true,
"priceInEuro": 24.5,
"pricePerCurrency": {},
"stripeBillingPortalEnabled": false,
"stripePriceId": "price_123",
"stripeTrackTokenMeter": "string",
"stripeTrackUsage": false,
"tier": 5,
"trialDays": 7
},
"pricingPlan": {
"active": false,
"billingInterval": "day",
"categoryId": "18d0035a-5850-4bf4-8d5d-3dc8684e2bb2",
"displayName": "Business Pro with 3 members",
"id": "18d0045a-5850-4bf4-8d5d-3dc8684e2bb2",
"importedFromLegacyId": 0,
"isDefault": true,
"priceInEuro": 24.5,
"pricePerCurrency": {},
"stripeBillingPortalEnabled": false,
"stripePriceId": "price_123",
"stripeTrackTokenMeter": "string",
"stripeTrackUsage": false,
"tier": 5,
"trialDays": 7
},
"pricingPlanCategory": {
"displayName": "string",
"id": "string",
"translationKey": "string"
}
},
"active": true,
"activeDiscounts": [
"string"
],
"availableWords": 500,
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"currency": "aed",
"endDate": "string",
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"importedFromLegacyCustomerId": 12345,
"isGracePeriod": false,
"isTrial": false,
"limitRenewalDate": "string",
"nextSubscriptionCycleStart": "2024-01-01T00:00:00Z",
"paymentCardNumberLastFourDigits": "4242",
"paymentMethodCardBrand": "amex",
"paymentPaused": false,
"paymentType": "acss_debit",
"pricingPlanId": "18d0045a-5850-4bf4-8d5d-3dc8684e2bb2",
"pricingPlanWords": 10000,
"sepaPaymentFailed": false,
"spilloverWords": 500,
"stripeStatus": "active",
"stripeSubscriptionId": "sub_12345abcdef",
"stripeSubscriptionItemId": "sub_item_ad909w0",
"trialEndsAt": "2023-12-31T23:59:59Z",
"trialStartedAt": "string",
"updatedAt": "2025-01-14T16:20:59Z",
"usedWords": 5000,
"workspaceId": "550e8400-e29b-41d4-a716-446655440000"
}