# Validate your first creator code

Validate a creator code before checkout using your Public key so you can store it and use it when tracking the purchase.

Before tracking purchases, you must validate the creator code in the client. This ensures the code is in the program and lets you:

* give immediate feedback to the player (Valid / Not found)
* prevent a checkout flow that will later be rejected
* store the valid code for use during the purchase flow

After a code is validated, you should persist it (session/local/in-memory) so that when the player completes a purchase, your backend can include the same code in the attribution request.

## Validation request

Validation is a public-key route, so it is safe to call from a game client.

<ApiMethod method="GET" path="/manage/members/{memberCode}" />

```bash
curl -G "$NEXUS_BASE_URL/manage/members/thesearing" \
  -H "X-SHARED-SECRET: $NEXUS_PUBLIC_KEY" \
  --data-urlencode "groupId=$NEXUS_GROUP_ID"
```

<Aside type="note">The `groupId` query parameter is only needed when using global API keys, which is not recommended.</Aside>

<LinkCard title="View full reference" description="Parameters, responses, and status codes." href="/api/operations/getmemberbycode/" />

The validation call returns one of two outcomes:

* `200` valid code in this program
* `400` no matching member in this program

`400` should be treated as a normal "no such code" condition, not an exception.

### Response

```json
{
  "groupId": "2ixlNNFdJh-9scoXek80w",
  "groupName": "Creator Loop",
  "groupDefaultRevShare": 10,
  "id": "Hv98bvRCSm1jDDPhls1qC",
  "name": "The Searing Podcast",
  "logoImage": "https://cdn.nexus.gg/FzVN5qcpr8s8irlokp/iQJWVLokKREqYXPxkO/images/logo-image.jpg",
  "tier": {
    "id": "M9cgAXgP3DqyuZcoszkeE",
    "name": "Tier 2",
    "revShare": 15
  },
  "codes": [
    {
      "code": "thesearing",
      "isPrimary": true,
      "isGenerated": false,
      "isManaged": false
    }
  ]
}
```

## Next steps

<LinkCard title="Track a purchase" description="Send the validated code in an attribution after checkout." href="/start-integrating/track-a-purchase/" />
