# claimReferralCode

mutation · in the family [Billing and the wallet](/reference/billing-and-the-wallet/)

## What it does

Claim your group’s one referral code. Businesses that sign up with it get 50% off their base fee for 3 months, and your group earns on their collected fees and first-year usage once AlmondTill approves each referral.

Claim your group's ONE referral code: a generated code owned by your group, carrying the two-sided standard (the referred business gets 50% off its base fee for 3 cycles; you earn on their collected fees and their first-year kernel consumption once AlmondTill approves each referral). Requires APPROVED affiliate standing (AlmondTill grants it — ask us; a default waiting period applies from your signup). One code per group, forever — a second claim refuses naming the standing code. Requires the unrestricted capability. Template class A16_BILLING (hand-derived v94).

## What happens

Requires approved affiliate standing (AlmondTill grants it). One code per group, forever.

## Who may call it

Capability area: **Billing and the wallet** — Your platform bill, token purchases and the usage and cost reads.

- Owner
- Manager
- Associate Manager
- An API key whose scope allows `api:claimReferralCode`

## Returns

[ClaimedReferralCode](/types/ClaimedReferralCode/) `ClaimedReferralCode!` — Your group's claimed referral code.

## Example request

```graphql
mutation ExampleClaimReferralCode {
  claimReferralCode {
    code
    promotionPercent
    promotionCycles
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

## Example response

```json
{
  "data": {
    "claimReferralCode": {
      "code": "BJ-001",
      "promotionPercent": 1,
      "promotionCycles": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

## Errors this call can answer

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `CONFLICT/*` — The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. ([CONFLICT](/errors/CONFLICT/))
- `VALIDATION/VERSION_REQUIRED` — The request did not say which app version it came from. ([VALIDATION](/errors/VALIDATION/))
