Create customer portal session
Create a Stripe Customer Portal session for managing subscriptions and invoices.
POST
/billing/portal
Create a Stripe Customer Portal session for managing subscriptions and invoices.
Authentication
API Key (header: X-API-Key) API Key (cookie: better-auth.session_token)
Responses
200
Portal session created
application/jsonportal_url
string
REQUIRED
Stripe Customer Portal URL
400
No billing account found
401
Unauthorized
curl -X POST 'https://hookstream.io/v1/billing/portal' \
-H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://hookstream.io/v1/billing/portal', {
method: 'POST',
headers: {
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
import requests
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
response = requests.post('https://hookstream.io/v1/billing/portal', headers=headers)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "https://hookstream.io/v1/billing/portal", 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
{
"portal_url": "<string>"
}
POST
/billing/portal