Skip to main content
Cookbooks

Overview

Nineteen runnable recipes. Each one is a working agent that solves one real commerce problem end to end, with the refusals you will actually hit.

1 min read
View MarkdownEdit on GitHub

Find the shape of your problem

Each row is a kind of problem, not a kind of agent. Find the sentence that sounds like what you are building: every recipe sits in exactly one row, and the time beside it is the one the recipe declares.

Pay outYour software already decided who gets paid, and how much.
BuyYour agent is the buyer, on a checkout somebody else owns.
CollectSomeone else has to pay you, and you need to know when they did.
Act on settlementThe work starts only once the money actually landed.
Bound authorityAn agent may spend, but only inside something a person signed.
Hold for a humanSome spends have to stop and wait for a decision.
Open an accountSomebody has to exist before money can move.
Prove afterwardsSomeone will ask what happened, and you have to show it.
Find the capabilityYou know the intent, not the tool name.

How a recipe works

Each one is a single runnable file, not pseudo-code. Copy it, put your csk_test_ key in the environment, and run it: a test key resolves to a sandbox project, so the whole flow completes without provider OAuth and without moving real money.

Each one also documents the order its handlers run in, what already exists when a refusal arrives, and which refusal a retry can fix. That is usually the part you need at 2am.

For output that never touches an upstream, declare per-session fixtures with cs.create({ mocks: {...} }). Test Mode has the strict-mode contract and the envelope reference.

Next steps

Overview | CodeSpar