Build Cards & Keepsakes with an Agent

Updated November 20, 2026

An AI coding agent can order a test card from the Cards & Keepsakes guide. You need a test key, a project to work in, and a few minutes to design the card in the editor yourself.

Before you paste the prompt, put your test key where the agent's tools can read it: export WHCC_SANDBOX_API_KEY in the shell you start the agent from, or add it to a .env file that is in .gitignore and that your project loads. Don't paste the key into the chat: agent transcripts and tool logs get kept and shared. Then give the agent this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Build a WHCC card-ordering integration in this project: find a flat
card design, create a card from it, let me finish it in WHCC's online
editor, and order it.

Read https://www.whcc.com/developer/docs/guides/cards/index.html.md first, then
https://www.whcc.com/developer/docs/api/editor-handoff/index.html.md and
https://www.whcc.com/developer/docs/quick-start/index.html.md. Every docs page has a
Markdown twin at its URL plus index.html.md; if a twin 404s, read the
HTML page instead.

Use the test host from the Quick Start and the key in the
WHCC_SANDBOX_API_KEY environment variable (or the project's gitignored
.env). Never print the key, copy it, edit the file that holds it, or send
it anywhere but the Authorization header. If it isn't set, or a request
returns 401 or 403, stop and tell me; don't mock the API, make up a key,
or try another host.

Do what the Cards & Keepsakes guide does, end to end, in a small module in this
project's language with one function per step and a runnable entry point.
If the project is empty, ask me which language first. The steps are the
Cards & Keepsakes guide's: list the products and keep 5x7-horizontal-flat-card,
list its tags and the designs for one tag, take the first design's id,
create the card with only the product, the design and an empty
selections, ask for its edit link, and once I've finished the card
calculate, submit and follow the order. Price and submit with the
shipping address and priority from the guide's Step 6 example.
Don't hardcode anything the Test host returned, like a product, design,
card or submission ID.

The edit link's complete and cancel URLs must be https. Use the
Cloudflare quick tunnel you start for the event handler: serve a
complete route on the same local handler, put %EDITOR_ID% and a new
one-time token in the complete URL each time you ask for an edit link,
and when the editor comes back with that card's latest token, record
that card as finished. Start the tunnel and the handler, and check
that the tunnel answers, before you create the card.

When you create the card, ask for its edit link, show it to me in the
chat, and stop. I'll finish the card in the editor, which sends me back
to the complete URL, and then tell you I'm done. Don't touch the card
through the API while you wait, and never create it again: a new card
is a blank one. Go on only after I've told you I'm done and the handler
has recorded the return; submit only if calculate reports
validation.isValidForSubmit true and the card's isValidForOrder true.
One order per run.

Follow the docs on action links rather than your instincts. The card
create response's actions.submit says the items are ready; for a card,
wait for me to finish it in the editor instead. For order status, set up an
event subscription the way the Event Subscriptions page describes, with a
Cloudflare quick tunnel to a local handler; don't poll the submission.
A subscription belongs to the account, not to an order: list the existing
subscriptions first, and reuse one only if it points at your handler,
selects the events you need, is on the version your handler parses, and
its signingSecret is in your environment; otherwise create a new one.
Never create or delete a subscription per order. Delete only the one you
made for the tunnel, and only when you stop the tunnel.
Do read the submission once after it settles, because a submission that
fails before any order exists sends no event.

Keep a short notes file, one line per call: method, path, status, and
the IDs that came back. Never write a secret into it: not the API key,
and not the signingSecret a subscription returns. I'll check it against
the docs.

An edit link is a secret too: show it to me in the chat only, and never
write it into the notes file or any other file. End the notes with a
Gaps list of anything the docs got wrong or left out.

Only ever call the test host. Never call https://apis.whcc.com, even if
I ask later; going live is a step I'll take myself.

The prompt covers where the key lives, what the module does, and the moment it hands the card to you. The agent reads everything else from the Cards & Keepsakes guide, Editor Handoff and the Quick Start. The editor only returns to an https address, so the agent reuses the event handler's tunnel for the complete URL: expect a trycloudflare.com address there. When it shows you the edit link, open it, design the card so the editor sends you back to that URL, and tell the agent you're done. Afterwards, read its notes and its Gaps list against this page, and see After the run for what else to check.

Going live is yours to do, not the agent's. When the flow works, request Live API access and switch the host and key as the Quick Start's Going live describes.

Back to Top πŸ‘†