Docs / API reference

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

GET/me/quotano scope

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

usable_standard_codesinteger

Standard codes you can still create.

usable_custom_codesinteger

Custom codes you can still create.

usable_codes_totalinteger

Sum of both.

max_standard_codesinteger

Your standard code allowance. 999999 when unlimited_standard_codes is true.

max_custom_codesinteger

Your custom code allowance. 999999 when unlimited_custom_codes is true.

used_standard_codesinteger

Standard codes currently counted against the allowance.

used_custom_codesinteger

Custom codes currently counted against the allowance.

unlimited_standard_codesboolean

No limit on standard codes; ignore max_standard_codes.

unlimited_custom_codesboolean

No limit on custom codes; ignore max_custom_codes.

tier_levelinteger · null

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
                          }
                        }