Skip to main content

pocket_market.purchase_service

Overview

  • Buys a home service (cleaning, repair, babysitter, ...) from the PocketMarket app, with the same rules and payment as the Buy button in the app. The buyer is entity_id (default: the possessed Zoi) and its household pays; a purchase by a Zoi outside the possessed household shows no toast on screen. Price, discount and count are decided by the game, and a service is always bought once. On success returns the service context id; follow it with phone.get_pending_actions (same entity_id). An omitted, empty or null entity_id means the possessed Zoi. A failure message starts with a reason code: InvalidBuyer (entity_id is not a positive integer or not a character; an invalid value is never replaced by the possessed Zoi), ItemNotFound, AmbiguousItem, TravelInProgress, ConditionNotMet, ServiceInProgress, TimeClosed, NotAtResidence, NotEnoughMoney, BuildWorld, ServiceRequestFailed, InternalError or NotInGame (no game running, loading, or the character studio is open). Nothing is charged on failure.

Metadata

FieldValue
DisplayPurchase PocketMarket Service
Categorypocket_market
AccessScriptCheat
ScopeB2Authority
TagsExperimental
Aliases—

Parameters

NameTypeRequiredDefaultDescription
service_idnameyes—Service to buy, e.g. Cleaning. See pocket_market.list_services
category_idnameno—Shopping category, only needed when the service is sold in several categories
entity_identityIdno—Zoi who buys; its household pays (default: possessed)

Returns

Returns a JSON object with the following fields:

FieldTypeRequiredDescription
context_idintyesService context id; track it with phone.get_pending_actions
service_idstringyesPurchased service
category_idstringyesCategory it was bought from
paid_amountintyesAmount charged to the household

Usage

await inzoi.cli.execute('pocket_market.purchase_service', {
service_id: '',
category_id: '', // optional
entity_id: 0, // optional
});