/v0/connect/checkCheck a Connect request before showing it
Validates what a plugin sent to dashboard.intents.fi/connect: a known platform, https URLs, a return_url on the same origin as site_url, a state and an S256 code_challenge. A refused request is never shown and the browser is never sent to its return_url. Needs no authentication and reads nothing.
Authentication
Section titled “Authentication”A secret key (ik_) as a Bearer token. The prefix sets the mode: _test_ or _live_. Publishable keys (pk_) cannot call it.
Body parameters
Section titled “Body parameters”platformstringRequiredOne of woocommerce, whmcs, prestashop, opencart, magento
site_urlstringRequiredThe store, e.g.
https://shop.example.comreturn_urlstringRequiredWhere the browser goes back to. Must share
site_url's origin.statestringRequiredThe plugin's own random value, echoed back
code_challengestringRequiredbase64url(SHA-256(code_verifier))
code_challenge_methodS256Optionalmodetest\|liveOptionalDefault
testpartnerstringOptionalAgency Partner ID, when present
Responses
Section titled “Responses”- 200A request the consent screen may show
- 400INVALID_REQUEST, with
details.field
Request
Section titled “Request”curl https://api.intents.fi/v0/connect/check \ -X POST \ -H 'authorization: Bearer $INTENTS_SECRET_KEY' \ -H 'content-type: application/json' \ -d '{ "platform": "woocommerce", "site_url": "https://shop.northwood.example", "return_url": "https://shop.northwood.example/wp-admin/admin-post.php?action=intentsfi_connect_return", "state": "Vb3k9QxR2mT7LpZ4cW8nYaKd", "code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM", "mode": "test" }'const response = await fetch("https://api.intents.fi/v0/connect/check", { method: "POST", headers: { authorization: `Bearer ${process.env.INTENTS_SECRET_KEY}`, "content-type": "application/json", }, body: JSON.stringify({ "platform": "woocommerce", "site_url": "https://shop.northwood.example", "return_url": "https://shop.northwood.example/wp-admin/admin-post.php?action=intentsfi_connect_return", "state": "Vb3k9QxR2mT7LpZ4cW8nYaKd", "code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM", "mode": "test" }),});
if (!response.ok) { const { error } = await response.json(); throw new Error(`${error.code}: ${error.message}`);}const data = await response.json();import osimport httpx
response = httpx.post( "https://api.intents.fi/v0/connect/check", headers={"authorization": f"Bearer {os.environ['INTENTS_SECRET_KEY']}"}, json={ "platform": "woocommerce", "site_url": "https://shop.northwood.example", "return_url": "https://shop.northwood.example/wp-admin/admin-post.php?action=intentsfi_connect_return", "state": "Vb3k9QxR2mT7LpZ4cW8nYaKd", "code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM", "mode": "test" },)response.raise_for_status()data = response.json()Errors
Section titled “Errors”{ "error": { "code": "INVOICE_EXPIRED", "message": "This invoice has expired" } }Switch on code, not on the message: every code has a page under Error codes. Base URL https://api.intents.fi; the whole reference is on one page.