Quota
Your organisation's allowance of GP codes, set by GP Code under your partner contract. Every code you create counts against it — whether it belongs to one of your users or to your partner account — and deleting a code frees its place again.
There is no payment flow in the API. When an allowance is used up, POST /gp-codes answers 402 quota_exhausted and nothing is written. Contact GP Code to extend your contract.
Retrieve quota
Returns the live allowance for standard and custom codes. Works with any valid key, so it is also a convenient health check for your credentials.
Response attributes
Standard codes you can still create.
Custom codes you can still create.
Sum of both.
Your standard code allowance. 999999 when unlimited_standard_codes is true.
Your custom code allowance. 999999 when unlimited_custom_codes is true.
Standard codes currently counted against the allowance.
Custom codes currently counted against the allowance.
No limit on standard codes; ignore max_standard_codes.
No limit on custom codes; ignore max_custom_codes.
Plan tier, if your contract uses one.
Errors
401 authentication errors · 503 client_misconfigured when no allowance is set up for your account.
curl {{BASE}}/me/quota \
-H "X-GoPeeko-Key: $GPCODE_KEY" \
-H "Authorization: Bearer $GPCODE_SECRET"
$res = $client->get('me/quota');
$quota = json_decode($res->getBody(), true)['data'];
if ($quota['usable_standard_codes'] === 0 && ! $quota['unlimited_standard_codes']) {
// warn before creating
}
const res = await fetch(`${BASE}/me/quota`, { headers });
const { data: quota } = await res.json();
if (quota.usable_standard_codes === 0 && !quota.unlimited_standard_codes) {
// warn before creating
}
quota = session.get(f"{BASE}/me/quota").json()["data"]
if quota["usable_standard_codes"] == 0 and not quota["unlimited_standard_codes"]:
pass # warn before creating
{
"data": {
"max_standard_codes": 100,
"max_custom_codes": 25,
"used_standard_codes": 61,
"used_custom_codes": 25,
"usable_standard_codes": 39,
"usable_custom_codes": 0,
"usable_codes_total": 39,
"unlimited_standard_codes": false,
"unlimited_custom_codes": false,
"tier_level": null
}
}