# pet.trezy.retirePet

> Published by [trezy.pet](https://lexicon.garden/identity/did:plc:ollch4g7tes2reb5eceiwuol)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:ollch4g7tes2reb5eceiwuol/pet.trezy.retirePet)
- [Documentation](https://lexicon.garden/lexicon/did:plc:ollch4g7tes2reb5eceiwuol/pet.trezy.retirePet/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:ollch4g7tes2reb5eceiwuol/pet.trezy.retirePet/examples)

## Definitions

### `pet.trezy.retirePet`

**Type**: `procedure`

Retire one of the caller's own pets: put it away, off the stage and out of the collection's foreground. IRREVERSIBLE — there is no un-retire, here or anywhere, by design. A client MUST confirm before calling this and MUST name the pet in the confirmation. The pet is not deleted and not refunded: its ledger row stays, its price still counts as spent, and the record in the caller's repo is left where it is. REFUSES the caller's last ACTIVE pet with last-active-pet: only active pets earn and nothing activates a pet after the fact, so retiring the last one leaves a player with no income and no route back to any — the balance can never reach a price again and the starter grant is once per DID. It blocks nothing achievable another way: buying lands a pet active while a slot is free, so a player with money can buy first and retire after.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes | The pet to retire. Must be a pet the caller owns; the procedure never accepts a DID and acts only on the authenticated caller's own rows. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | No | The pet that was retired. Present only on success, which is why nothing here is required: a refusal carries error and message instead, and requiring even one of these would fail response validation and turn an expected refusal back into a 500. |
| `name` | `string` | No | The retired pet's name, so the confirmation the player sees afterwards can use it. Absent if the ledger row carries no usable name. |
| `error` | `string` | No | Present instead of uri/name when the pet was not retired for an expected reason. A stable machine code the client branches on — add codes, never rename them. |
| `message` | `string` | No | A sentence to show the player, accompanying `error`. Free to reword; do not branch on it. |

## Raw Schema

```json
{
  "id": "pet.trezy.retirePet",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "uri"
          ],
          "properties": {
            "uri": {
              "type": "string",
              "format": "at-uri",
              "description": "The pet to retire. Must be a pet the caller owns; the procedure never accepts a DID and acts only on the authenticated caller's own rows."
            }
          }
        },
        "encoding": "application/json"
      },
      "output": {
        "schema": {
          "type": "object",
          "required": [],
          "properties": {
            "uri": {
              "type": "string",
              "format": "at-uri",
              "description": "The pet that was retired. Present only on success, which is why nothing here is required: a refusal carries error and message instead, and requiring even one of these would fail response validation and turn an expected refusal back into a 500."
            },
            "name": {
              "type": "string",
              "description": "The retired pet's name, so the confirmation the player sees afterwards can use it. Absent if the ledger row carries no usable name."
            },
            "error": {
              "type": "string",
              "description": "Present instead of uri/name when the pet was not retired for an expected reason. A stable machine code the client branches on — add codes, never rename them.",
              "knownValues": [
                "missing-uri",
                "unknown-pet",
                "already-retired",
                "last-active-pet",
                "last-pet"
              ]
            },
            "message": {
              "type": "string",
              "description": "A sentence to show the player, accompanying `error`. Free to reword; do not branch on it."
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Retire one of the caller's own pets: put it away, off the stage and out of the collection's foreground. IRREVERSIBLE — there is no un-retire, here or anywhere, by design. A client MUST confirm before calling this and MUST name the pet in the confirmation. The pet is not deleted and not refunded: its ledger row stays, its price still counts as spent, and the record in the caller's repo is left where it is. REFUSES the caller's last ACTIVE pet with last-active-pet: only active pets earn and nothing activates a pet after the fact, so retiring the last one leaves a player with no income and no route back to any — the balance can never reach a price again and the starter grant is once per DID. It blocks nothing achievable another way: buying lands a pet active while a slot is free, so a player with money can buy first and retire after."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
