pet.trezy.swapPets
Change which of the caller's pets are on the stage. Pass `activate` to bring a pet on, `deactivate` to take one off, or both to swap in one call. Acts only on the authenticated caller's own rows and never accepts a DID. TOUCHES NO MONEY AT ALL: it writes a stint to trezy_pet_stage_log recording exactly when each pet went on or came off, and the accrual reads those stints so every pet is paid for the stretches it was genuinely on stage and no others. Coins already waiting stay waiting — nothing is collected, banked or forfeited by swapping, and the player picks them up whenever they like. A pet with no stints at all is treated as having been on stage since it was bought, which is what lets accounts that predate the log keep working unchanged.
Details · procedure
| Kind | procedure |
|---|---|
| Authority | trezy.pet |
| Indexed |
Procedure
procedure · POSTInput
application/jsonactivate
string · at-uriThe pet to bring onto the stage. Must be a pet the caller owns and has not retired. Alone, it fills a free slot and refuses with stage-full if there is none. It starts earning from the moment of this call and is paid nothing for the time it spent waiting.
deactivate
string · at-uriThe pet to take off the stage. Must be a pet the caller owns and currently has on the stage. Alone, it refuses with last-active-pet rather than leave a player with nothing earning. It keeps everything it earned up to this moment. Nothing here is destructive: a benched pet keeps its name, its history and its price, and can be brought back at any time. Retiring is the irreversible one, and that is pet.trezy.retirePet.
Output
application/jsonactive
arrayEvery pet on the stage after the change, oldest first. The whole set rather than the pets that moved, so a client can render the stage from the answer without a second call and without guessing at a race it lost.
changedAt
string · datetimeThe moment recorded in the stint log — the instant the outgoing pet stopped earning and the incoming one started. Not a wallet timestamp: this call does not touch the wallet.
error
stringPresent instead of the fields above when the stage was not changed for an expected reason. A stable machine code the client branches on — add codes, never rename them.
knownValues: missing-target | same-pet | unknown-pet | retired-pet | already-active | already-benched | stage-full | last-active-pet | unavailable
message
stringA sentence to show the player, accompanying `error`. Free to reword; do not branch on it.
Similar lexicons
semantic matchLexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.
-
pet.trezy.retirePet
procedureRetire 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 nothin