GET /billing/subscription
Get the current subscription details from the database.

Authentication

API Key (header: X-API-Key) API Key (cookie: better-auth.session_token)

Responses

200 Current subscription (null if none)
application/json
subscription object | null REQUIRED
id string REQUIRED
org_id string REQUIRED
stripe_subscription_id string REQUIRED
stripe_customer_id string REQUIRED
plan string REQUIRED
status string REQUIRED
current_period_start string | null REQUIRED
current_period_end string | null REQUIRED
cancel_at_period_end number REQUIRED
created_at string REQUIRED
updated_at string REQUIRED
401 Unauthorized
curl -X GET 'https://hookstream.io/v1/billing/subscription' \
  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://hookstream.io/v1/billing/subscription', {
  method: 'GET',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN"
  }
});

const data = await response.json();
console.log(data);
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.get('https://hookstream.io/v1/billing/subscription', headers=headers)
print(response.json())
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://hookstream.io/v1/billing/subscription", nil)
	req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")

	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
	result, _ := io.ReadAll(resp.Body)
	fmt.Println(string(result))
}
200 Response
{
  "subscription": {
    "id": "<string>",
    "org_id": "<string>",
    "stripe_subscription_id": "<string>",
    "stripe_customer_id": "<string>",
    "plan": "<string>",
    "status": "<string>",
    "current_period_start": "<string>",
    "current_period_end": "<string>",
    "cancel_at_period_end": 123,
    "created_at": "<string>",
    "updated_at": "<string>"
  }
}
GET /billing/subscription
Ask a question... ⌘I