Payments

The payment endpoints let you manage subscriptions: list plans, create checkout sessions, process subscriptions, update or cancel plans, and access the customer portal.

Endpoints

MethodPathDescription
GET/payment/subscription-plansList available subscription plans
POST/payment/subscription-checkoutCreate checkout session
POST/payment/subscription-processProcess subscription after checkout
POST/payment/subscription-updateUpdate subscription
POST/payment/subscription-cancelCancel subscription
GET/payment/customer-infoGet customer billing info
POST/payment/customer-portalCreate customer portal session

List Subscription Plans

Returns available subscription plans for an organization.

Method: GET
Path: /payment/subscription-plans

Query Parameters

ParameterTypeRequiredDescription
organizationIdstringYesOrganization ID

Response Body

Returns an array of subscription plan objects with pricing, features, and product details.

Example

curl -X GET "https://api.app.bullseye.so/api/v1/payment/subscription-plans?organizationId=org_abc123" 
  -H "X-API-Key: bsk_live_your_api_key_here" 
  -H "Content-Type: application/json"

Create Checkout Session

Creates a hosted checkout session for subscribing to a plan. Returns a URL to redirect the user to complete payment.

Method: POST
Path: /payment/subscription-checkout

Request Body

JSON object with organizationId, priceId, productId, and optionally successUrl, cancelUrl.

Response Body

Returns an object with a url field for the checkout session.

Example

curl -X POST "https://api.app.bullseye.so/api/v1/payment/subscription-checkout" 
  -H "X-API-Key: bsk_live_your_api_key_here" 
  -H "Content-Type: application/json" 
  -d '{"organizationId": "org_abc123", "priceId": "price_xxx", "productId": "prod_xxx"}'

Process Subscription

Processes a subscription after the user completes checkout. Typically called by a webhook or redirect handler.

Method: POST
Path: /payment/subscription-process

Query Parameters

ParameterTypeRequiredDescription
secretstringYesSecret or session identifier from checkout

Response Body

Returns confirmation of the processed subscription.

Example

curl -X POST "https://api.app.bullseye.so/api/v1/payment/subscription-process?secret=session_xxx" 
  -H "X-API-Key: bsk_live_your_api_key_here" 
  -H "Content-Type: application/json"

Update Subscription

Updates the subscription plan for an organization (e.g., upgrade or downgrade).

Method: POST
Path: /payment/subscription-update

Request Body

FieldTypeRequiredDescription
organizationIdstringYesOrganization ID
priceIdstringYesNew plan price ID
productIdstringYesNew plan product ID

Response Body

Returns confirmation of the update.

Example

curl -X POST "https://api.app.bullseye.so/api/v1/payment/subscription-update" 
  -H "X-API-Key: bsk_live_your_api_key_here" 
  -H "Content-Type: application/json" 
  -d '{"organizationId": "org_abc123", "priceId": "price_xxx", "productId": "prod_xxx"}'

Cancel Subscription

Cancels the subscription for an organization.

Method: POST
Path: /payment/subscription-cancel

Request Body

FieldTypeRequiredDescription
organizationIdstringYesOrganization ID

Response Body

Returns an empty object on success.

Example

curl -X POST "https://api.app.bullseye.so/api/v1/payment/subscription-cancel" 
  -H "X-API-Key: bsk_live_your_api_key_here" 
  -H "Content-Type: application/json" 
  -d '{"organizationId": "org_abc123"}'

Get Customer Info

Retrieves customer billing information for an organization, including subscription status, payment method, and billing details.

Method: GET
Path: /payment/customer-info

Query Parameters

ParameterTypeRequiredDescription
organizationIdstringYesOrganization ID

Response Body

Returns customer details such as customerId, email, address, defaultCardLast4, activeProductId, and subscription status.

Example

curl -X GET "https://api.app.bullseye.so/api/v1/payment/customer-info?organizationId=org_abc123" 
  -H "X-API-Key: bsk_live_your_api_key_here" 
  -H "Content-Type: application/json"

Create Customer Portal Session

Creates a customer billing portal session. Returns a URL where the user can manage their subscription, payment methods, and invoices.

Method: POST
Path: /payment/customer-portal

Request Body

FieldTypeRequiredDescription
organizationIdstringYesOrganization ID

Response Body

Returns an object with a url field for the portal session.

Example

curl -X POST "https://api.app.bullseye.so/api/v1/payment/customer-portal" 
  -H "X-API-Key: bsk_live_your_api_key_here" 
  -H "Content-Type: application/json" 
  -d '{"organizationId": "org_abc123"}'