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 Plans
Section titled “List Plans”List all plans configured for your app.
HTTP Request
Section titled “HTTP Request”GET https://api.thebridge.dev/account/payments/plan
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/payments/planCreate a Plan
Section titled “Create a Plan”Create a new subscription plan.
HTTP Request
Section titled “HTTP Request”POST https://api.thebridge.dev/account/payments/plan
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Required | A unique key for this plan |
name | string | Required | A presentable label for this plan |
description | string | Optional | Optional description of the plan |
trial | boolean | Optional | Whether this plan includes a trial period |
trialDays | number | Optional | Number of trial days (required when trial is true) |
prices | Price[] | Required | Array of price objects: { amount, currency, recurrenceInterval } |
Price Object
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | number | Required | Price amount |
currency | string | Required | ISO 4217 currency code (e.g. EUR, USD) |
recurrenceInterval | string | Required | Billing interval: day, week, month, or year |
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/payments/planGet a Plan
Section titled “Get a Plan”Retrieve a single plan by ID.
HTTP Request
Section titled “HTTP Request”GET https://api.thebridge.dev/account/payments/plan/:PLAN_ID
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/payments/plan/:PLAN_IDUpdate a Plan
Section titled “Update a Plan”Update an existing plan.
HTTP Request
Section titled “HTTP Request”PUT https://api.thebridge.dev/account/payments/plan/:PLAN_ID
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Optional | A unique key for this plan |
name | string | Optional | A presentable label for this plan |
description | string | Optional | Optional description |
trial | boolean | Optional | Whether this plan includes a trial period |
trialDays | number | Optional | Number of trial days |
prices | Price[] | Optional | Array of price objects |
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/payments/plan/:PLAN_IDDelete a Plan
Section titled “Delete a Plan”Delete an existing plan.
HTTP Request
Section titled “HTTP Request”DELETE https://api.thebridge.dev/account/payments/plan/:PLAN_ID
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/payments/plan/:PLAN_IDList Taxes
Section titled “List Taxes”List all taxes configured for your app.
HTTP Request
Section titled “HTTP Request”GET https://api.thebridge.dev/account/payments/tax
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/payments/taxCreate a Tax
Section titled “Create a Tax”Create a new tax entry.
HTTP Request
Section titled “HTTP Request”POST https://api.thebridge.dev/account/payments/tax
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
countryCode | string | Required | ISO 3166-1 alpha-2 country code (e.g. SE, US) |
name | string | Required | Tax name (e.g. VAT, GST) |
percentage | number | Required | Tax percentage (e.g. 25 for 25%) |
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/payments/taxGet a Tax
Section titled “Get a Tax”Retrieve a single tax by ID.
HTTP Request
Section titled “HTTP Request”GET https://api.thebridge.dev/account/payments/tax/:TAX_ID
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/payments/tax/:TAX_IDUpdate a Tax
Section titled “Update a Tax”Update an existing tax entry.
HTTP Request
Section titled “HTTP Request”PUT https://api.thebridge.dev/account/payments/tax/:TAX_ID
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
countryCode | string | Optional | ISO 3166-1 alpha-2 country code |
name | string | Optional | Tax name |
percentage | number | Optional | Tax percentage |
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/payments/tax/:TAX_IDDelete a Tax
Section titled “Delete a Tax”Delete an existing tax entry.
HTTP Request
Section titled “HTTP Request”DELETE https://api.thebridge.dev/account/payments/tax/:TAX_ID
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/payments/tax/:TAX_IDSubscriptions
Section titled “Subscriptions”Subscription Portal
Section titled “Subscription Portal”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.
HTTP Request
Section titled “HTTP Request”GET https://api.thebridge.dev/cloud-views/subscription-portal/selectPlan?code=XXXX
Note: Replace
XXXXwith 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'Get Tenant Payment Details
Section titled “Get Tenant Payment Details”Retrieve payment and subscription details for a specific tenant.
HTTP Request
Section titled “HTTP Request”GET https://api.thebridge.dev/account/tenant/:TENANT_ID/paymentDetails
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/tenant/:TENANT_ID/paymentDetailsSet Tenant Plan Details
Section titled “Set Tenant Plan Details”Assign a plan and price offer to a specific tenant.
HTTP Request
Section titled “HTTP Request”POST https://api.thebridge.dev/account/tenant/:TENANT_ID/paymentDetails
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
planKey | string | Required | The key of the plan to assign |
priceOffer | object | Required | The price offer to apply |
priceOffer.currency | string | Required | ISO 4217 currency code (e.g. EUR, USD) |
priceOffer.recurrenceInterval | string | Required | Billing interval: day, week, month, or year |
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/tenant/:TENANT_ID/paymentDetails