cards

Read a purchase turn that was still running

Reads back a turn from POST /buy-with-saved-card that came back state: running. Poll every few seconds until state is done or failed; the response has the same shape as the POST.

A failed confirm may still have placed the order. Read GET /get-purchase-conversation before sending it again.

get/get-purchase-turn

Request

  • Base URL: https://laso.finance
  • URL: https://laso.finance/get-purchase-turn
  • Auth: API key in header Authorization

Query parameters

turn_idstring required

The turn_id from POST /buy-with-saved-card.

Response

The turn.

turn_idstring

This turn's id. Poll GET /get-purchase-turn with it while state is running.

state'running' | 'done' | 'failed'

running means the turn is still talking to the merchant; the fields below appear once it is done.

created_atinteger

Milliseconds since the epoch.

conversation_idstring

Send it back on every follow-up and on the confirm.

status'needs_input' | 'awaiting_approval' | 'in_progress' | 'order_placed' | 'declined' | 'conflict'

What to do next. needs_input: a question or a cart waiting on a confirm. awaiting_approval: send approval_url to the holder, then repeat the same confirm. in_progress: the order is already being placed; read GET /get-purchase-conversation instead of confirming again. order_placed. declined: see decline_code. conflict: nothing ran, see error_code and confirm the fresh cart's hash. Never branch on reply.

replystring

The shopping assistant's turn as prose, ready to show the holder.

order_idstring nullable

Set when this turn placed an order.

decline_codestring nullable

The machine reason behind declined, e.g. items_unavailable.

approval_urlstring nullable

Send to the holder when status is awaiting_approval. Never open it yourself.

charge_status'none' | 'confirming' | 'settled' | 'unknown' | 'null' nullable

Whether money moved: none, confirming, settled, or unknown (do not retry; read the conversation).

card_last4string nullable

The saved card that paid, for naming it to the holder.

error_codestring nullable

On conflict: cart_changed, turn_in_progress, delivery_address_changed, or delivery_address_bound_after_cart.

errorstring

Present when state is failed.

notestring

The next step.

Changes

No recorded changes to this operation across all 3 revisions of this API.