An AI coding agent can order a test album from the Albums & Books guide. You need a test key, a project to work in, a few photos to upload, and some time to arrange the album 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 album-ordering integration in this project: create an
album, let me design it in WHCC's Album Editor, and order it.
Read https://www.whcc.com/developer/docs/guides/albums/index.html.md (the Albums & Books
guide) 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 Albums 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
guide's: list the products and find the Album (ref album) as its Step 1
says, read its detail and pick a size as its Step 2 says, create the
album with only that size and no images (I'll add my photos and choose
the rest in the editor), ask for its edit link, and once I've finished
the album, 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, album 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 album's latest token, record
that album as finished. Start the tunnel and the handler, and check
that the tunnel answers, before you create the album.
When you create the album, ask for its edit link, show it to me in the
chat, and stop. I'll design the album in the editor, which sends me
back to the complete URL, and then tell you I'm done. Don't touch the
album through the API while you wait, and never create it again: a new
album is an empty 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 album's isValidForOrder true.
If it doesn't, show me the validationSummary, ask for a fresh edit link
and stop again. One order per run.
Follow the docs on action links rather than your instincts. The album
create response's actions.submit says the items are ready; for an album,
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 album to you. The agent reads everything else from the Albums guide 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, upload your photos, fill the spreads and the cover until the editor lets you finish and 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 πBuild with our API
Start adding our products into your app today. You don't need to talk to us first. Platforms and individual photographers or studios building for their own business are all welcome. Test API key access is available for every WHCC account. New to WHCC? Create an account first.
Established businesses with existing print volume
Tell us about your business and the partnership you have in mind, and we'll be in touch.
Tell us about your business and the partnership you have in mind, and we'll be in touch.