import Blink from "@blink/sdk"
const blink = new Blink(process.env.BLINK_KEY)
const cart = await agent.buildCart(request)
const { decision, receipt } = await blink.decisions.create({
productUrl: cart.item.url,
conditions: buyer.conditions,
})
if (decision === "ALLOW") await checkout(cart, { receipt })One call before checkout.
Structured return, shipping and refund terms for any store your agent shops, or a decision on your buyer’s conditions with the source text and a signed receipt.
Built for agents that pay per token.
Fast lookups
Read once per version, cached. One call, no crawling.
Cheaper calls
A small record, not pages of text. Fewer tokens.
Signed receipts
Every ALLOW, bound to the purchase. Verifiable offline.
Deterministic
Same evidence, same decision. Unknowns stay unknown.
Quickstart.
01
Get a key.
export BLINK_KEY="bk_live_…"
02
Look up a policy.
GET https://api.thankyoublink.com/v1/policies?url=store.example
{
"merchant": "store.example",
"policy_version": "2026-10-12",
"routes": [ … ],
"exclusions": [
{ "applies_to": "clearance", "rule": "final_sale",
"source": "Clearance items are final sale." }
],
"cached": true
}03
Decide and verify.
// Every ALLOW includes a receipt
{
"receipt": {
"decision": "ALLOW",
"route": "mail-free-card",
"purchase": "sha256:3b9c…",
"conditions": "sha256:c4f1…",
"evidence": "sha256:9a02…",
"policy_version": "2026-10-12",
"expires_at": "2026-10-18T22:15:00Z",
"signature": "ed25519:7Hq…"
}
}
// Before checkout
POST /v1/receipts/verify → { "valid": true }Start free. Pay per decision.
Endpoints.
- GET
/v1/policies?url=A store’s policy as data: every route, with sources.
- POST
/v1/decisionsALLOW, DENY or REVIEW for a purchase.
- GET
/v1/policies/{id}/versionsWhat changed, and when.
- POST
/v1/receipts/verifyCheck a receipt before checkout.
The response.
{
"decision": "DENY",
"reason": "no_single_route_meets_conditions",
"routes": [
{
"id": "mail-card",
"fee": { "value": "8.00 CAD", "state": "true" },
"window": { "days": 30, "from": "delivery" },
"refund_to": "original_payment",
"source": "A prepaid label costs $8…"
},
{
"id": "mail-credit",
"fee": { "value": "none", "state": "true" },
"refund_to": "store_credit",
"source": "Free returns are issued as store credit…"
}
],
"unknown": [],
"policy_version": "2026-10-12"
}- decision
- ALLOW, DENY or REVIEW.
- reason
- Why, as a code you can branch on.
- routes[]
- Each return option, apart. Facts: true, false or unknown.
- source
- The store’s own words behind the fact.
- unknown[]
- What the policy doesn’t say.
- policy_version
- The policy version used.
Questions.
What is a Blink receipt?
A small signed record Blink attaches to every allowed purchase: the route that met your conditions, hashes of the purchase, the conditions and the evidence, and the policy version. Anyone can check the signature against Blink’s public key without calling Blink.
What happens when a policy doesn’t say?
Blink marks it unknown. A missing fee is never read as a free return. When an unknown fact matters, the answer is REVIEW, with the missing fact named.
What does the API return?
A decision (ALLOW, DENY or REVIEW), the return route that satisfied your conditions if there is one, the facts behind it with their source text, and any facts that were unknown.
Why is it cheaper than letting an agent browse?
Browsing makes the model find and read policy pages on every decision. Blink collects the evidence once per policy version and reuses it, so each decision reads a small, structured record instead.
How is the API priced?
By usage. Tell us your expected volume when you request access and we’ll set you up.