Skip to content
Intents Route
POST/v0/connect/check

Check 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.

A secret key (ik_) as a Bearer token. The prefix sets the mode: _test_ or _live_. Publishable keys (pk_) cannot call it.

  • platformstringRequired

    One of woocommerce, whmcs, prestashop, opencart, magento

  • site_urlstringRequired

    The store, e.g. https://shop.example.com

  • return_urlstringRequired

    Where the browser goes back to. Must share site_url's origin.

  • statestringRequired

    The plugin's own random value, echoed back

  • code_challengestringRequired

    base64url(SHA-256(code_verifier))

  • code_challenge_methodS256Optional
  • modetest \| liveOptional

    Default test

  • partnerstringOptional

    Agency Partner ID, when present

  • 200A request the consent screen may show
  • 400INVALID_REQUEST, with details.field
curl
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"
}'
TypeScript
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();
Python
import os
import 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()
{ "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.