curl -X POST https://api.llmgenerator.com/api/v1/subscriptions/portal \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"returnUrl": "https://yourapp.com/settings/billing"
}'
const response = await fetch('https://api.llmgenerator.com/api/v1/subscriptions/portal', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
returnUrl: 'https://yourapp.com/settings/billing'
})
});
const data = await response.json();
// Redirect user to Stripe portal
window.location.href = data.url;
import requests
response = requests.post(
'https://api.llmgenerator.com/api/v1/subscriptions/portal',
headers={
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
json={
'returnUrl': 'https://yourapp.com/settings/billing'
}
)
data = response.json()
print(f"Redirect to: {data['url']}")
{
"url": "https://billing.stripe.com/p/session/test_a1b2c3d4..."
}
Abonnements
Abrechnungsportal-Sitzung erstellen
Stripe-Kundenportal-Sitzung für Abonnement- und Zahlungsmittelverwaltung erstellen.
POST
/
subscriptions
/
portal
curl -X POST https://api.llmgenerator.com/api/v1/subscriptions/portal \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"returnUrl": "https://yourapp.com/settings/billing"
}'
const response = await fetch('https://api.llmgenerator.com/api/v1/subscriptions/portal', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
returnUrl: 'https://yourapp.com/settings/billing'
})
});
const data = await response.json();
// Redirect user to Stripe portal
window.location.href = data.url;
import requests
response = requests.post(
'https://api.llmgenerator.com/api/v1/subscriptions/portal',
headers={
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
json={
'returnUrl': 'https://yourapp.com/settings/billing'
}
)
data = response.json()
print(f"Redirect to: {data['url']}")
{
"url": "https://billing.stripe.com/p/session/test_a1b2c3d4..."
}
Überblick
Erstellt eine Stripe-Customer-Portal-Sitzung. Nutzer können dort:- Zahlungsmittel aktualisieren
- Rechnungshistorie einsehen
- Abonnementtarife wechseln
- Rechnungen herunterladen
- Das Abonnement kündigen
Für Drittanbieter-Integrationen: Verwenden Sie
POST /subscriptions/portal/api mit API-Schlüssel-Authentifizierung.Authentifizierung
string
erforderlich
JWT-Access-Token. Format:
Bearer YOUR_ACCESS_TOKENAnfragetext
string
URL nach Verlassen des Portals. Standard: App-Dashboard.
curl -X POST https://api.llmgenerator.com/api/v1/subscriptions/portal \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"returnUrl": "https://yourapp.com/settings/billing"
}'
const response = await fetch('https://api.llmgenerator.com/api/v1/subscriptions/portal', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
returnUrl: 'https://yourapp.com/settings/billing'
})
});
const data = await response.json();
// Redirect user to Stripe portal
window.location.href = data.url;
import requests
response = requests.post(
'https://api.llmgenerator.com/api/v1/subscriptions/portal',
headers={
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
json={
'returnUrl': 'https://yourapp.com/settings/billing'
}
)
data = response.json()
print(f"Redirect to: {data['url']}")
{
"url": "https://billing.stripe.com/p/session/test_a1b2c3d4..."
}
Antwortfelder
string
URL zum Stripe-gehosteten Abrechnungsportal.
Portal-Funktionen
Im Stripe Customer Portal können Nutzer:| Funktion | Beschreibung |
|---|---|
| Zahlungsmittel | Karten hinzufügen, ändern oder entfernen |
| Rechnungen | Vergangene Rechnungen anzeigen und herunterladen |
| Tarifwechsel | Abonnement upgraden oder downgraden |
| Kündigung | Abonnement beenden |
| Abrechnungshistorie | Alle Transaktionen einsehen |
Fehlerantworten
Ungültige Anfrage – Kein Abrechnungskonto gefunden. Zuerst einen Kauf tätigen.
Nicht autorisiert – Ungültiges oder fehlendes Token.
Das Abrechnungsportal steht Nutzern zur Verfügung, die bereits gekauft haben oder ein aktives Abonnement besitzen. Neue Nutzer sollten den Checkout-Endpunkt verwenden.
POST /subscriptions/portal/api
Erstellt eine Stripe-Customer-Portal-Sitzung mit API-Schlüssel-Authentifizierung. Geeignet für Drittanbieter-Integrationen.Authentifizierung
API-Schlüssel erforderlich. Übergeben Sie ihn im HeaderAuthorization:
Authorization: Bearer llmgen_your_api_key_here
Anfragetext
Wie bei/subscriptions/portal oben.
Antwort
Wie bei/subscriptions/portal oben.
curl -X POST https://api.llmgenerator.com/api/v1/subscriptions/portal/api \
-H "Authorization: Bearer llmgen_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"returnUrl": "https://yourapp.com/settings/billing"
}'
const response = await fetch('https://api.llmgenerator.com/api/v1/subscriptions/portal/api', {
method: 'POST',
headers: {
'Authorization': 'Bearer llmgen_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
returnUrl: 'https://yourapp.com/settings/billing'
})
});
const data = await response.json();
// Redirect user to Stripe portal
window.location.href = data.url;
import requests
response = requests.post(
'https://api.llmgenerator.com/api/v1/subscriptions/portal/api',
headers={
'Authorization': 'Bearer llmgen_your_api_key_here',
'Content-Type': 'application/json'
},
json={
'returnUrl': 'https://yourapp.com/settings/billing'
}
)
data = response.json()
print(f"Redirect to: {data['url']}")
Bewährte Praktiken
- Link in den Einstellungen: Button „Abrechnung verwalten“ in den Kontoeinstellungen
- Nach dem Checkout: Nach Abonnementabschluss Zugang zum Portal anbieten
- Support: Portal als Self-Service für Abrechnungsfragen bereitstellen
War diese Seite hilfreich?
⌘I