Skip to content

Payments

The Payments API lets you manage subscription Plans, configure Taxes, and handle tenant Subscriptions. Plans define the pricing tiers available to your tenants, taxes are applied per country, and subscriptions tie a tenant to a specific plan and price.


List all plans configured for your app.

GET https://api.thebridge.dev/account/payments/plan

HTTP 200 — Returns an array of plan objects.

Request example

curl --request GET 'https://api.thebridge.dev/account/payments/plan' \
--header 'x-api-key: YOUR_APP_API_KEY'

Response example:

[
{
"id": "650c548c29b15b62e681f28a",
"key": "premium",
"name": "Premium",
"trial": true,
"trialDays": 14,
"prices": [
{ "amount": 50, "currency": "EUR", "recurrenceInterval": "month" }
],
"createdAt": "2023-09-21T14:34:52.248Z"
}
]
GET Try it out
GET https://api.thebridge.dev/account/payments/plan
Stored in session memory only. Never persisted.

Create a new subscription plan.

POST https://api.thebridge.dev/account/payments/plan

Body Parameters

ParameterTypeRequiredDescription
keystringRequiredA unique key for this plan
namestringRequiredA presentable label for this plan
descriptionstringOptionalOptional description of the plan
trialbooleanOptionalWhether this plan includes a trial period
trialDaysnumberOptionalNumber of trial days (required when trial is true)
pricesPrice[]RequiredArray of price objects: { amount, currency, recurrenceInterval }

Price Object

ParameterTypeRequiredDescription
amountnumberRequiredPrice amount
currencystringRequiredISO 4217 currency code (e.g. EUR, USD)
recurrenceIntervalstringRequiredBilling interval: day, week, month, or year

HTTP 200 — Returns the created plan object.

Request example

curl --request POST 'https://api.thebridge.dev/account/payments/plan' \
--header 'x-api-key: YOUR_APP_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "key": "premium",
  "name": "Premium",
  "description": "Full-featured premium plan",
  "trial": true,
  "trialDays": 14,
  "prices": [
    { "amount": 50, "currency": "EUR", "recurrenceInterval": "month" }
  ]
}'

Response example:

{
"id": "650c548c29b15b62e681f28a",
"key": "premium",
"name": "Premium",
"trial": true,
"trialDays": 14,
"prices": [
{ "amount": 50, "currency": "EUR", "recurrenceInterval": "month" }
],
"createdAt": "2023-09-21T14:34:52.248Z"
}
POST Try it out
POST https://api.thebridge.dev/account/payments/plan
Stored in session memory only. Never persisted.

Retrieve a single plan by ID.

GET https://api.thebridge.dev/account/payments/plan/:PLAN_ID

HTTP 200 — Returns the plan object.

Request example

curl --request GET 'https://api.thebridge.dev/account/payments/plan/PLAN_ID' \
--header 'x-api-key: YOUR_APP_API_KEY'

Response example:

{
"id": "650c548c29b15b62e681f28a",
"key": "premium",
"name": "Premium",
"trial": true,
"trialDays": 14,
"prices": [
{ "amount": 50, "currency": "EUR", "recurrenceInterval": "month" }
],
"createdAt": "2023-09-21T14:34:52.248Z"
}
GET Try it out
GET https://api.thebridge.dev/account/payments/plan/:PLAN_ID
Stored in session memory only. Never persisted.
The ID of the plan

Update an existing plan.

PUT https://api.thebridge.dev/account/payments/plan/:PLAN_ID

Body Parameters

ParameterTypeRequiredDescription
keystringOptionalA unique key for this plan
namestringOptionalA presentable label for this plan
descriptionstringOptionalOptional description
trialbooleanOptionalWhether this plan includes a trial period
trialDaysnumberOptionalNumber of trial days
pricesPrice[]OptionalArray of price objects

HTTP 200 — Returns the updated plan object.

Request example

curl --request PUT 'https://api.thebridge.dev/account/payments/plan/PLAN_ID' \
--header 'x-api-key: YOUR_APP_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Premium Plus",
  "trialDays": 30
}'
PUT Try it out
PUT https://api.thebridge.dev/account/payments/plan/:PLAN_ID
Stored in session memory only. Never persisted.
The ID of the plan

Delete an existing plan.

DELETE https://api.thebridge.dev/account/payments/plan/:PLAN_ID

HTTP 200 — Empty body on success.

Request example

curl --request DELETE 'https://api.thebridge.dev/account/payments/plan/PLAN_ID' \
--header 'x-api-key: YOUR_APP_API_KEY'
DELETE Try it out
DELETE https://api.thebridge.dev/account/payments/plan/:PLAN_ID
Stored in session memory only. Never persisted.
The ID of the plan

List all taxes configured for your app.

GET https://api.thebridge.dev/account/payments/tax

HTTP 200 — Returns an array of tax objects.

Request example

curl --request GET 'https://api.thebridge.dev/account/payments/tax' \
--header 'x-api-key: YOUR_APP_API_KEY'

Response example:

[
{
"id": "650c6a1b29b15b62e681f2a1",
"countryCode": "SE",
"name": "VAT",
"percentage": 25
}
]
GET Try it out
GET https://api.thebridge.dev/account/payments/tax
Stored in session memory only. Never persisted.

Create a new tax entry.

POST https://api.thebridge.dev/account/payments/tax

Body Parameters

ParameterTypeRequiredDescription
countryCodestringRequiredISO 3166-1 alpha-2 country code (e.g. SE, US)
namestringRequiredTax name (e.g. VAT, GST)
percentagenumberRequiredTax percentage (e.g. 25 for 25%)

HTTP 200 — Returns the created tax object.

Request example

curl --request POST 'https://api.thebridge.dev/account/payments/tax' \
--header 'x-api-key: YOUR_APP_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "countryCode": "SE",
  "name": "VAT",
  "percentage": 25
}'

Response example:

{
"id": "650c6a1b29b15b62e681f2a1",
"countryCode": "SE",
"name": "VAT",
"percentage": 25
}
POST Try it out
POST https://api.thebridge.dev/account/payments/tax
Stored in session memory only. Never persisted.

Retrieve a single tax by ID.

GET https://api.thebridge.dev/account/payments/tax/:TAX_ID

HTTP 200 — Returns the tax object.

Request example

curl --request GET 'https://api.thebridge.dev/account/payments/tax/TAX_ID' \
--header 'x-api-key: YOUR_APP_API_KEY'

Response example:

{
"id": "650c6a1b29b15b62e681f2a1",
"countryCode": "SE",
"name": "VAT",
"percentage": 25
}
GET Try it out
GET https://api.thebridge.dev/account/payments/tax/:TAX_ID
Stored in session memory only. Never persisted.
The ID of the tax

Update an existing tax entry.

PUT https://api.thebridge.dev/account/payments/tax/:TAX_ID

Body Parameters

ParameterTypeRequiredDescription
countryCodestringOptionalISO 3166-1 alpha-2 country code
namestringOptionalTax name
percentagenumberOptionalTax percentage

HTTP 200 — Returns the updated tax object.

Request example

curl --request PUT 'https://api.thebridge.dev/account/payments/tax/TAX_ID' \
--header 'x-api-key: YOUR_APP_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "percentage": 20
}'
PUT Try it out
PUT https://api.thebridge.dev/account/payments/tax/:TAX_ID
Stored in session memory only. Never persisted.
The ID of the tax

Delete an existing tax entry.

DELETE https://api.thebridge.dev/account/payments/tax/:TAX_ID

HTTP 200 — Empty body on success.

Request example

curl --request DELETE 'https://api.thebridge.dev/account/payments/tax/TAX_ID' \
--header 'x-api-key: YOUR_APP_API_KEY'
DELETE Try it out
DELETE https://api.thebridge.dev/account/payments/tax/:TAX_ID
Stored in session memory only. Never persisted.
The ID of the tax

Redirect a tenant to the hosted subscription portal where they can select a plan and enter payment details. This is a redirect URL — open it in the browser or redirect the user to it. No x-api-key header is required.

GET https://api.thebridge.dev/cloud-views/subscription-portal/selectPlan?code=XXXX

Note: Replace XXXX with the tenant’s subscription portal code. This endpoint returns an HTML page, not JSON.

Request example

# This is a redirect URL — open in the browser or redirect the user.
curl --request GET 'https://api.thebridge.dev/cloud-views/subscription-portal/selectPlan?code=XXXX'

Retrieve payment and subscription details for a specific tenant.

GET https://api.thebridge.dev/account/tenant/:TENANT_ID/paymentDetails

HTTP 200 — Returns payment/subscription details (planKey, priceOffer).

Request example

curl --request GET 'https://api.thebridge.dev/account/tenant/TENANT_ID/paymentDetails' \
--header 'x-api-key: YOUR_APP_API_KEY'

Response example:

{
"planKey": "premium",
"priceOffer": {
"currency": "EUR",
"recurrenceInterval": "month"
}
}
GET Try it out
GET https://api.thebridge.dev/account/tenant/:TENANT_ID/paymentDetails
Stored in session memory only. Never persisted.
The ID of the tenant

Assign a plan and price offer to a specific tenant.

POST https://api.thebridge.dev/account/tenant/:TENANT_ID/paymentDetails

Body Parameters

ParameterTypeRequiredDescription
planKeystringRequiredThe key of the plan to assign
priceOfferobjectRequiredThe price offer to apply
priceOffer.currencystringRequiredISO 4217 currency code (e.g. EUR, USD)
priceOffer.recurrenceIntervalstringRequiredBilling interval: day, week, month, or year

HTTP 200 — Empty body on success.

Request example

curl --request POST 'https://api.thebridge.dev/account/tenant/TENANT_ID/paymentDetails' \
--header 'x-api-key: YOUR_APP_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "planKey": "premium",
  "priceOffer": {
    "currency": "EUR",
    "recurrenceInterval": "month"
  }
}'
POST Try it out
POST https://api.thebridge.dev/account/tenant/:TENANT_ID/paymentDetails
Stored in session memory only. Never persisted.
The ID of the tenant