0

Get organization billing status

by
Published Oct 17, 2025

This endpoint returns a "is_valid" boolean field reflecting the billing status of the organization: - If true, the organization billing is valid - For Startup organization, it returns false if there is at least 1 invoice unpaid since 1 week - For Community organization, it returns false if there is no credit left

Script qovery Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Get organization billing status
4
 * This endpoint returns a "is_valid" boolean field reflecting the billing status of the organization:
5
- If true, the organization billing is valid
6
- For Startup organization, it returns false if there is at least 1 invoice unpaid since 1 week
7
- For Community organization, it returns false if there is no credit left
8

9
 */
10
export async function main(auth: RT.Qovery, organizationId: string) {
11
	const url = new URL(`https://api.qovery.com/organization/${organizationId}/billingStatus`)
12

13
	const response = await fetch(url, {
14
		method: 'GET',
15
		headers: {
16
			Authorization: 'Token ' + auth.apiKey
17
		},
18
		body: undefined
19
	})
20
	if (!response.ok) {
21
		const text = await response.text()
22
		throw new Error(`${response.status} ${text}`)
23
	}
24
	return await response.json()
25
}
26