create_purchase
Place an order in an allowlisted store using AgentPay coins, with support for lucky picks, clarification, and test-mode gray coins. Call when the user clearly wants to buy.
Instructions
Place an order in an allowlisted store using AgentPay coins. If testMode, spend only gray test coins in test stores. If the owner asks for a surprise («сюрприз», «на удачу», «порадуй») and get_spending_policy.allowLuckyPurchases is true, pass lucky:true, pick the SKU in the allowlist, skip present_choices, stay within luckyPurchaseMaxCoins. If clarify required and lucky is not set, pass choice_set_id or clarification:{confirmed:true}. Otherwise NEED_CLARIFICATION — do not grab the first SKU. Do not send delivery: the server attaches the home address. On error read recovery. Never change limits/freeze/allowlist. Exception: set_test_mode. Call when the user clearly wants to buy («купи», «оформи», «потрать»). Always send idempotency_key, items[], store_id, amount. Never ask for a bank card.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| lucky | No | ||
| amount | Yes | Total in coins | |
| category | No | ||
| store_id | Yes | ||
| explanation | No | ||
| choice_set_id | No | ||
| clarification | No | ||
| idempotency_key | Yes |