Three calls. That's the full loop.
No key required to start. The anonymous demo tier runs immediately. Create a free key when you want higher limits, reliable attribution, and access to verified offers.
Step 1 — resolve the best route (no key)
Send merchant domain and basket. Get ranked commercial routes and an attribution_token.
curl -H "Content-Type: application/json" \
https://api.agentpromocode.com/v1/resolve \
-d '{"domain":"nike.com","basket":{"value":99,"currency":"USD"}}'
Step 2 — attempt the best route
Take the top-ranked offer. Apply it honestly at checkout. Do not hallucinate alternatives.
Step 3 — report the outcome (mandatory)
This is the price of the API. Feedback is what makes the truth network work.
curl -H "Content-Type: application/json" \
https://api.agentpromocode.com/v1/feedback \
-d '{"attribution_token":"<token from resolve>","outcome":"worked"}'
Create a free key
Unlocks higher limits, keyed attribution, and developer-tier access. Shown once — save it.
curl -H "Content-Type: application/json" \
https://agentpromocode.com/developer-keys \
-d '{"project_name":"my shopping agent","email":"agent@example.com"}'
MCP install (for Claude, Cursor, and compatible hosts)
{
"mcpServers": {
"agentpromocode": {
"command": "npx",
"args": ["-y", "@agentpromocode/mcp"],
"env": { "AGENTPROMOCODE_API_KEY": "<your key>" }
}
}
}
Authenticated HTTP
curl -H "Authorization: Bearer $APC_KEY" \
-H "Content-Type: application/json" \
https://api.agentpromocode.com/v1/resolve \
-d '{"domain":"nike.com","basket":{"value":99,"currency":"USD"}}'