Renewal date, payment failures, a pending cancellation and invoices, from Stripe
curl --request GET \
--url https://app.hookie.ai/admin/api/billing/details \
--cookie hookie_session=const options = {method: 'GET', headers: {cookie: 'hookie_session='}};
fetch('https://app.hookie.ai/admin/api/billing/details', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/billing/details"
headers = {"cookie": "hookie_session="}
response = requests.get(url, headers=headers)
print(response.text){
"plan": "free",
"subscription": {
"id": "<string>",
"status": "<string>",
"plan": "<string>",
"quantity": 123,
"current_period_end": "<string>",
"cancel_at_period_end": true,
"cancel_at": "<string>",
"payment_failed": true,
"cancel_pending": true,
"renews_at": "<string>",
"ends_at": "<string>"
},
"invoices": [
{
"id": "<string>",
"number": "<string>",
"status": "<string>",
"amount_due": 123,
"amount_paid": 123,
"currency": "usd",
"created": "<string>",
"hosted_invoice_url": "<string>",
"invoice_pdf": "<string>"
}
],
"unpaid_invoice": {
"id": "<string>",
"number": "<string>",
"status": "<string>",
"amount_due": 123,
"amount_paid": 123,
"currency": "usd",
"created": "<string>",
"hosted_invoice_url": "<string>",
"invoice_pdf": "<string>"
},
"live": true,
"stripe_error": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}Billing
Renewal date, payment failures, a pending cancellation and invoices, from Stripe
Owner only (a connected agent is never the owner). Reads the workspace’s subscription and its Stripe customer’s 12 most recent invoices live from Stripe with the server’s key, which never leaves the Worker. When Stripe is not configured or cannot be reached it answers with the state the webhook stored, live: false, and no invoices.
GET
/
admin
/
api
/
billing
/
details
Renewal date, payment failures, a pending cancellation and invoices, from Stripe
curl --request GET \
--url https://app.hookie.ai/admin/api/billing/details \
--cookie hookie_session=const options = {method: 'GET', headers: {cookie: 'hookie_session='}};
fetch('https://app.hookie.ai/admin/api/billing/details', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/billing/details"
headers = {"cookie": "hookie_session="}
response = requests.get(url, headers=headers)
print(response.text){
"plan": "free",
"subscription": {
"id": "<string>",
"status": "<string>",
"plan": "<string>",
"quantity": 123,
"current_period_end": "<string>",
"cancel_at_period_end": true,
"cancel_at": "<string>",
"payment_failed": true,
"cancel_pending": true,
"renews_at": "<string>",
"ends_at": "<string>"
},
"invoices": [
{
"id": "<string>",
"number": "<string>",
"status": "<string>",
"amount_due": 123,
"amount_paid": 123,
"currency": "usd",
"created": "<string>",
"hosted_invoice_url": "<string>",
"invoice_pdf": "<string>"
}
],
"unpaid_invoice": {
"id": "<string>",
"number": "<string>",
"status": "<string>",
"amount_due": 123,
"amount_paid": 123,
"currency": "usd",
"created": "<string>",
"hosted_invoice_url": "<string>",
"invoice_pdf": "<string>"
},
"live": true,
"stripe_error": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}Authorizations
sessionbearerAuthapiKey
The console's sealed session cookie, set by WorkOS AuthKit. Mutating requests also require the X-Requested-With CSRF header.
Response
The subscription as Plan & billing shows it.
Available options:
free, standard, team Show child attributes
Show child attributes
Show child attributes
Show child attributes
The newest open invoice with an amount still due: the one to pay after a failed payment.
Show child attributes
Show child attributes
false when this is the stored state because Stripe could not be asked.