draw_session_spend
Right before you pay for one call in a session open_spend_session opened, draw the call's price from it. drawn true: pay for the call now. An error means do not pay for this call: the draws would pass the session's maximum (remaining says what is left), this one call costs more than the policy allows per purchase, your owner changed the policy and the session was closed (open a new one if it still allows), or the session is closed or expired. If the call then fails, settle_session_draw with outcome failed gives the draw back. Needs a Last Price credential with price compute scope. Needs a claimed workspace: a sandbox key from self-registration is refused (403) until a person claims the workspace.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | No | Optional: what this call buys. | |
| note | No | Optional: a request or payment reference. | |
| amount | Yes | This call's price, in the session's currency. | |
| pay_to | No | The account this call pays, when open_spend_session named pay_to (then required). Another account is refused with code payee_changed: do not pay; the session stays open. | |
| session_id | Yes | reservation.id from open_spend_session. |