Billing

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
POST
POST
POST
POST
GET
GET
POST
POST
GET

List all billing

Required API key scopes

billing:read

Query parameters

  • include_forecasting
    boolean | null
  • organization_id
    string

Response


Example request

GET /api/billing
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/

Example response

Status 200
RESPONSE
{
"customer_id": "string",
"billing_plan": "string",
"subscription_level": "string",
"has_active_subscription": true,
"is_annual_plan_customer": true,
"free_trial_until": "string",
"current_total_amount_usd": "string",
"current_total_amount_usd_after_discount": "string",
"projected_total_amount_usd": "string",
"projected_total_amount_usd_after_discount": "string",
"projected_total_amount_usd_with_limit": "string",
"projected_total_amount_usd_with_limit_after_discount": "string",
"discount_amount_usd": "string",
"discount_percent": 0,
"amount_off_expires_at": "string",
"startup_program_label": "string",
"startup_program_label_previous": "string",
"stripe_portal_url": "http://example.com",
"external_billing_provider_invoices_url": "http://example.com",
"products": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
"string"
],
"usage_summary": null,
"billing_period": null,
"custom_limits_usd": null,
"next_period_custom_limits_usd": null,
"trial": null,
"license": null,
"account_owner": null,
"customer_trust_scores": null,
"never_drop_data": true,
"billing_managed_by_partner": {
"partner_name": "string"
}
}

List all billing

Required API key scopes

billing:read

Query parameters

  • include_forecasting
    boolean | null
  • organization_id
    string

Response


Example request

GET /api/billing
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/

Example response

Status 200
RESPONSE
{
"customer_id": "string",
"billing_plan": "string",
"subscription_level": "string",
"has_active_subscription": true,
"is_annual_plan_customer": true,
"free_trial_until": "string",
"current_total_amount_usd": "string",
"current_total_amount_usd_after_discount": "string",
"projected_total_amount_usd": "string",
"projected_total_amount_usd_after_discount": "string",
"projected_total_amount_usd_with_limit": "string",
"projected_total_amount_usd_with_limit_after_discount": "string",
"discount_amount_usd": "string",
"discount_percent": 0,
"amount_off_expires_at": "string",
"startup_program_label": "string",
"startup_program_label_previous": "string",
"stripe_portal_url": "http://example.com",
"external_billing_provider_invoices_url": "http://example.com",
"products": [
{
"property1": null,
"property2": null
}
],
"available_product_features": [
"string"
],
"usage_summary": null,
"billing_period": null,
"custom_limits_usd": null,
"next_period_custom_limits_usd": null,
"trial": null,
"license": null,
"account_owner": null,
"customer_trust_scores": null,
"never_drop_data": true,
"billing_managed_by_partner": {
"partner_name": "string"
}
}

Create billing activate

Request parameters

  • organization_id
    string
  • products
    string
  • intent_product
    string
  • custom_limits_usd
    string

Response


Example request

POST /api/billing/activate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/activate/\
-d organization_id="string"

Example response

Status 200
RESPONSE
{
"success": true,
"must_setup_payment": true,
"products": [
"string"
],
"error": "string"
}

Create billing activate

Request parameters

  • organization_id
    string
  • products
    string
  • intent_product
    string
  • custom_limits_usd
    string

Response


Example request

POST /api/billing/activate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/activate/\
-d organization_id="string"

Example response

Status 200
RESPONSE
{
"success": true,
"must_setup_payment": true,
"products": [
"string"
],
"error": "string"
}

Create billing activate authorize

Request parameters

  • organization_id
    string

Response


Example request

POST /api/billing/activate/authorize
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/activate/authorize/\
-d organization_id="string"

Example response

Status 200
RESPONSE
{
"clientSecret": "string",
"success": true
}

Create billing activate authorize

Request parameters

  • organization_id
    string

Response


Example request

POST /api/billing/activate/authorize
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/activate/authorize/\
-d organization_id="string"

Example response

Status 200
RESPONSE
{
"clientSecret": "string",
"success": true
}

Create billing activate authorize status

Request parameters

  • organization_id
    string
  • payment_intent_id
    string | null

Response


Example request

POST /api/billing/activate/authorize/status
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/activate/authorize/status/\
-d organization_id="string"

Example response

Status 200
RESPONSE
{
"status": "string",
"error": "string",
"success": true
}

Create billing activate authorize status

Request parameters

  • organization_id
    string
  • payment_intent_id
    string | null

Response


Example request

POST /api/billing/activate/authorize/status
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/activate/authorize/status/\
-d organization_id="string"

Example response

Status 200
RESPONSE
{
"status": "string",
"error": "string",
"success": true
}

Create billing coupons claim

Request parameters

  • plan
    string
  • billing_limit
    integer

Example request

POST /api/billing/coupons/claim
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/coupons/claim/\
-d plan="string",\
-d billing_limit="integer"

Example response

Status 200 No response body

Create billing coupons claim

Request parameters

  • plan
    string
  • billing_limit
    integer

Example request

POST /api/billing/coupons/claim
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/coupons/claim/\
-d plan="string",\
-d billing_limit="integer"

Example response

Status 200 No response body

Retrieve billing coupons overview

Example request

GET /api/billing/coupons/overview
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/coupons/overview/

Example response

Status 200 No response body

Retrieve billing coupons overview

Example request

GET /api/billing/coupons/overview
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/coupons/overview/

Example response

Status 200 No response body

Retrieve billing credits overview

Example request

GET /api/billing/credits/overview
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/credits/overview/

Example response

Status 200 No response body

Retrieve billing credits overview

Example request

GET /api/billing/credits/overview
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/credits/overview/

Example response

Status 200 No response body

Create billing credits purchase

Request parameters

  • plan
    string
  • billing_limit
    integer

Example request

POST /api/billing/credits/purchase
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/credits/purchase/\
-d plan="string",\
-d billing_limit="integer"

Example response

Status 200 No response body

Create billing credits purchase

Request parameters

  • plan
    string
  • billing_limit
    integer

Example request

POST /api/billing/credits/purchase
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/credits/purchase/\
-d plan="string",\
-d billing_limit="integer"

Example response

Status 200 No response body

Create billing deactivate

Request parameters

  • plan
    string
  • billing_limit
    integer

Example request

POST /api/billing/deactivate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/deactivate/\
-d plan="string",\
-d billing_limit="integer"

Example response

Status 200 No response body

Create billing deactivate

Request parameters

  • plan
    string
  • billing_limit
    integer

Example request

POST /api/billing/deactivate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/deactivate/\
-d plan="string",\
-d billing_limit="integer"

Example response

Status 200 No response body

Retrieve billing get invoices

Example request

GET /api/billing/get_invoices
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/get_invoices/

Example response

Status 200 No response body

Retrieve billing get invoices

Example request

GET /api/billing/get_invoices
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/billing/get_invoices/

Example response

Status 200 No response body