Skip to content

Payments

The Payments API manages your merchant catalog: the subscription Plans and Taxes you sell. Plans define the pricing tiers available to your tenants, and taxes are applied per country.

To work with a workspace’s live subscription (reading its state, selecting or changing a plan, running the cancel/reactivate/trial lifecycle, and reading entitlements), see Subscriptions & Entitlements.


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