Skip to main content

Billing

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

Manage billing contacts and access the Stripe billing portal.

creates a stripe checkout session with which a customer can create/update the subscription on his workspace to a different price in an embedded modal

POST/v1/workspaces/{workspaceId}/billing-contacts/{billingContactId}/stripe-checkout-sessions

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID
billingContactIdstringYesBillingContact ID

Request Body

FieldTypeRequiredDescription
callbackUrlstringYesurl to redirect to after successful checkout.
languagestringNolanguage in which to open the checkout session. Defaults to the language of the authenticated customer
legacyPricingPlanIdintegerNodeprecated id of the pricingPlan for which a subscription should be created
pricingPlanIdstringNo

Response

FieldTypeDescription
_embeddedobject
couponobject
_embeddedobject
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
stripeTrackUsagebooleanwhen true then the usage for subscriptions with this pricingPlan should be tracked in stripe
tierinteger
trialDaysintegerhow many trial days are allowed for this plan
pricingPlanCategoryobject
displayNamestring
idstring
translationKeystring
discountPercentagenumber
legacyPricingPlanIdinteger
pricingPlanIdstring
translationKeystring
callbackUrlstringurl to redirect to after successful checkout.
languagestringlanguage in which to open the checkout session. Defaults to the language of the authenticated customer
legacyPricingPlanIdintegerdeprecated id of the pricingPlan for which a subscription should be created
pricingPlanIdstring
statusstring
stripeClientSecretstringclient secret for this checkout session. Only set directly after creation
stripePriceIdstringstripe id of the price from the new subscription that is being checked out
stripeSubscriptionIdstringid of the stripe subscription that is being subscribed to in this checkout

Example

curl -X POST "https://app.neuroflash.com/api/workspace-service/v1/workspaces/{workspace_id}/billing-contacts/{billing_contact_id}/stripe-checkout-sessions" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"callbackUrl": "string",
"language": "string",
"legacyPricingPlanId": 0,
"pricingPlanId": "string"
}'

Response:

{
"_embedded": {
"coupon": {
"_embedded": {
"pricingPlan": {
"active": "...",
"billingInterval": "...",
"categoryId": "...",
"displayName": "...",
"id": "...",
"importedFromLegacyId": "...",
"isDefault": "...",
"priceInEuro": "...",
"pricePerCurrency": "...",
"stripeBillingPortalEnabled": "...",
"stripePriceId": "...",
"stripeTrackUsage": "...",
"tier": "...",
"trialDays": "..."
},
"pricingPlanCategory": {
"displayName": "...",
"id": "...",
"translationKey": "..."
}
},
"discountPercentage": 0,
"legacyPricingPlanId": 0,
"pricingPlanId": "string",
"translationKey": "string"
}
},
"callbackUrl": "https://app.neuroflash.com/payment-callback?session_id={CHECKOUT_SESSION_ID}",
"language": "de",
"legacyPricingPlanId": 150,
"pricingPlanId": "string",
"status": "complete",
"stripeClientSecret": "string",
"stripePriceId": "string",
"stripeSubscriptionId": "string"
}

get current billing contact for a workspace

GET/v1/workspaces/{workspaceId}/billing-contacts/{billingContactId}

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID

Response

FieldTypeDescription
activeDiscountstringreadonly synced from stripe: true if a discount is active for this stripe customer
addressLine1stringreadonly synced from stripe: First line of the address of the billing contact
addressLine2stringreadonly synced from stripe: Second line of the address of the billing contact
citystringreadonly synced from stripe: City of the billing contact
countrystringreadonly synced from stripe: Country of the billing contact
createdAtstring
createdByUserIdstring
defaultPaymentCardNumberLastFourDigitsstring
defaultPaymentMethodstring
defaultPaymentMethodCardBrandstring
emailstringEmail address of the billing contact
idstring
importedFromLegacyCustomerIdintegerDeprecated: only needed while import from legacy api is still active ID of the legacy customer this was imported from
namestringName of the billing contact
postalCodestringreadonly synced from stripe: Postal code of the billing contact
statestringreadonly synced from stripe: State of the billing contact
stripeCustomerIdstringStripe customer ID for billing purposes. Could become optional if we add other payment providers
updatedAtstring

Example

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

Response:

{
"activeDiscount": "string",
"addressLine1": "123 Main St",
"addressLine2": "123 Main St",
"city": "Berlin",
"country": "DE",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"defaultPaymentCardNumberLastFourDigits": "1234",
"defaultPaymentMethod": "acss_debit",
"defaultPaymentMethodCardBrand": "amex",
"email": "max.mustermann@neuroflash.com",
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"importedFromLegacyCustomerId": 12345,
"name": "Max Mustermann",
"postalCode": "12345",
"state": "Schleswig-Holstein",
"stripeCustomerId": "cus_12345abcdef",
"updatedAt": "2025-01-14T16:20:59Z"
}

creates a checkout session in stripe. Checkout sessions can be used to let a customer switch pricing plans with an embedded view which is more convenient than a redirect to the stripe portal

GET/v1/workspaces/{workspaceId}/billing-contacts/{billingContactId}/stripe-checkout-sessions/{sessionId}

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID
billingContactIdstringYesBillingContact ID
sessionIdstringYesstripe session ID

Response

FieldTypeDescription
_embeddedobject
couponobject
_embeddedobject
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
stripeTrackUsagebooleanwhen true then the usage for subscriptions with this pricingPlan should be tracked in stripe
tierinteger
trialDaysintegerhow many trial days are allowed for this plan
pricingPlanCategoryobject
displayNamestring
idstring
translationKeystring
discountPercentagenumber
legacyPricingPlanIdinteger
pricingPlanIdstring
translationKeystring
callbackUrlstringurl to redirect to after successful checkout.
languagestringlanguage in which to open the checkout session. Defaults to the language of the authenticated customer
legacyPricingPlanIdintegerdeprecated id of the pricingPlan for which a subscription should be created
pricingPlanIdstring
statusstring
stripeClientSecretstringclient secret for this checkout session. Only set directly after creation
stripePriceIdstringstripe id of the price from the new subscription that is being checked out
stripeSubscriptionIdstringid of the stripe subscription that is being subscribed to in this checkout

Example

curl "https://app.neuroflash.com/api/workspace-service/v1/workspaces/{workspace_id}/billing-contacts/{billing_contact_id}/stripe-checkout-sessions/{session_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response:

{
"_embedded": {
"coupon": {
"_embedded": {
"pricingPlan": {
"active": "...",
"billingInterval": "...",
"categoryId": "...",
"displayName": "...",
"id": "...",
"importedFromLegacyId": "...",
"isDefault": "...",
"priceInEuro": "...",
"pricePerCurrency": "...",
"stripeBillingPortalEnabled": "...",
"stripePriceId": "...",
"stripeTrackUsage": "...",
"tier": "...",
"trialDays": "..."
},
"pricingPlanCategory": {
"displayName": "...",
"id": "...",
"translationKey": "..."
}
},
"discountPercentage": 0,
"legacyPricingPlanId": 0,
"pricingPlanId": "string",
"translationKey": "string"
}
},
"callbackUrl": "https://app.neuroflash.com/payment-callback?session_id={CHECKOUT_SESSION_ID}",
"language": "de",
"legacyPricingPlanId": 150,
"pricingPlanId": "string",
"status": "complete",
"stripeClientSecret": "string",
"stripePriceId": "string",
"stripeSubscriptionId": "string"
}

Update a billingContact

PUT/v1/workspaces/{workspaceId}/billing-contacts/{billingContactId}

Update a billingContact

Request Body

FieldTypeRequiredDescription
activeDiscountstringNoreadonly synced from stripe: true if a discount is active for this stripe customer
addressLine1stringNoreadonly synced from stripe: First line of the address of the billing contact
addressLine2stringNoreadonly synced from stripe: Second line of the address of the billing contact
citystringNoreadonly synced from stripe: City of the billing contact
countrystringNoreadonly synced from stripe: Country of the billing contact
defaultPaymentCardNumberLastFourDigitsstringNo
defaultPaymentMethodstringNo
defaultPaymentMethodCardBrandstringNo
emailstringYesEmail address of the billing contact
namestringYesName of the billing contact
postalCodestringNoreadonly synced from stripe: Postal code of the billing contact
statestringNoreadonly synced from stripe: State of the billing contact

Response

FieldTypeDescription
activeDiscountstringreadonly synced from stripe: true if a discount is active for this stripe customer
addressLine1stringreadonly synced from stripe: First line of the address of the billing contact
addressLine2stringreadonly synced from stripe: Second line of the address of the billing contact
citystringreadonly synced from stripe: City of the billing contact
countrystringreadonly synced from stripe: Country of the billing contact
createdAtstring
createdByUserIdstring
defaultPaymentCardNumberLastFourDigitsstring
defaultPaymentMethodstring
defaultPaymentMethodCardBrandstring
emailstringEmail address of the billing contact
idstring
importedFromLegacyCustomerIdintegerDeprecated: only needed while import from legacy api is still active ID of the legacy customer this was imported from
namestringName of the billing contact
postalCodestringreadonly synced from stripe: Postal code of the billing contact
statestringreadonly synced from stripe: State of the billing contact
stripeCustomerIdstringStripe customer ID for billing purposes. Could become optional if we add other payment providers
updatedAtstring

Example

curl -X PUT "https://app.neuroflash.com/api/workspace-service/v1/workspaces/{workspace_id}/billing-contacts/{billing_contact_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"activeDiscount": "string",
"addressLine1": "string",
"addressLine2": "string",
"city": "string",
"country": "string",
"defaultPaymentCardNumberLastFourDigits": "string",
"defaultPaymentMethod": "string",
"defaultPaymentMethodCardBrand": "string",
"email": "string",
"name": "string",
"postalCode": "string",
"state": "string"
}'

Response:

{
"activeDiscount": "string",
"addressLine1": "123 Main St",
"addressLine2": "123 Main St",
"city": "Berlin",
"country": "DE",
"createdAt": "2025-01-14T16:20:59Z",
"createdByUserId": "b0920767-2e30-48d3-80ce-268810bc433a",
"defaultPaymentCardNumberLastFourDigits": "1234",
"defaultPaymentMethod": "acss_debit",
"defaultPaymentMethodCardBrand": "amex",
"email": "max.mustermann@neuroflash.com",
"id": "113c0b32-ed6c-4421-b7da-d1faf238eb56",
"importedFromLegacyCustomerId": 12345,
"name": "Max Mustermann",
"postalCode": "12345",
"state": "Schleswig-Holstein",
"stripeCustomerId": "cus_12345abcdef",
"updatedAt": "2025-01-14T16:20:59Z"
}