Skip to content
API referenceAccount links

API reference · App API

Account links

Connect one of your users to their Flow Affiliate account, so they can follow what they referred.

POST/v1/account-links/sessions

A one-time page where your signed-in user connects their account in your app to their Flow Affiliate account. Open the url in the system browser, not a WebView: the person signs in there, with BankID by default. It works once, for 15 minutes, and needs a production key.

AuthSigned request with an app key, fg_live_… or fg_test_…

Request body

appUserIdstringrequired≤ 200 chars

Your pseudonymous id for the user. Never an email address or phone number.

returnUrlstring≤ 500 chars

Where the page sends the person when they are done: your https page or an app-scheme URL.

Returns · 201

urlstringrequireduri

Open this for the user.

expiresAtstringrequireddate-time

Errors

400validation_error

The request does not match the schema. details says which fields failed and why.

401missing_signature

One of x-fg-key, x-fg-timestamp and x-fg-signature is missing.

401invalid_timestamp

x-fg-timestamp is not Unix time in seconds.

401stale_timestamp

x-fg-timestamp is more than 300 seconds from the server clock. Sign each attempt again, and keep your clock in sync.

401invalid_key

The key id is unknown or revoked, or the app is archived.

401invalid_signature

The signature does not match. Sign the exact bytes you send.

409production_only

Sent with a sandbox key. Account links are real identities.

Request
BODY='{"appUserId":"u_8F2K","returnUrl":"nordshop://settings/flow"}'
TS=$(date +%s)
SIG=$(printf '%s.%s' "$TS" "$BODY" | openssl dgst -sha256 -hmac "$FG_SECRET" | sed 's/^.*= //')

curl -X POST "https://api.flowgroup.se/v1/account-links/sessions" \
  -H "content-type: application/json" \
  -H "x-fg-key: $FG_KEY_ID" \
  -H "x-fg-timestamp: $TS" \
  -H "x-fg-signature: $SIG" \
  --data-raw "$BODY"
201 Created
{
  "url": "https://partners.flowgroup.se/connect/3Jx9…",
  "expiresAt": "2026-11-09T09:45:00.000Z"
}
GET/v1/account-links

Whether one of your users has linked their account, so the app can show "connected" instead of the button.

AuthSigned request with an app key, fg_live_… or fg_test_…

Query parameters

appUserIdstringrequired≤ 200 chars

Your pseudonymous id for the user. Never an email address or phone number.

Returns · 200

linkedbooleanrequired
linkedAtstringrequireddate-timenullable

Errors

400validation_error

The request does not match the schema. details says which fields failed and why.

401missing_signature

One of x-fg-key, x-fg-timestamp and x-fg-signature is missing.

401invalid_timestamp

x-fg-timestamp is not Unix time in seconds.

401stale_timestamp

x-fg-timestamp is more than 300 seconds from the server clock. Sign each attempt again, and keep your clock in sync.

401invalid_key

The key id is unknown or revoked, or the app is archived.

401invalid_signature

The signature does not match. Sign the exact bytes you send.

Request
TS=$(date +%s)
SIG=$(printf '%s.' "$TS" | openssl dgst -sha256 -hmac "$FG_SECRET" | sed 's/^.*= //')

curl "https://api.flowgroup.se/v1/account-links?appUserId=u_1042" \
  -H "x-fg-key: $FG_KEY_ID" \
  -H "x-fg-timestamp: $TS" \
  -H "x-fg-signature: $SIG"
200 OK
{
  "linked": true,
  "linkedAt": "2026-11-09T09:41:12.000Z"
}