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
| Field | Value |
|---|---|
| Display | Purchase PocketMarket Service |
| Category | pocket_market |
| Access | ScriptCheat |
| Scope | B2Authority |
| Tags | Experimental |
| Aliases | — |
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| service_id | name | yes | — | Service to buy, e.g. Cleaning. See pocket_market.list_services |
| category_id | name | no | — | Shopping category, only needed when the service is sold in several categories |
| entity_id | entityId | no | — | Zoi who buys; its household pays (default: possessed) |
Returns
Returns a JSON object with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
context_id | int | yes | Service context id; track it with phone.get_pending_actions |
service_id | string | yes | Purchased service |
category_id | string | yes | Category it was bought from |
paid_amount | int | yes | Amount charged to the household |
Usage
await inzoi.cli.execute('pocket_market.purchase_service', {
service_id: '',
category_id: '', // optional
entity_id: 0, // optional
});