Exchange a connect code
Completes the account-connection handshake. After a user approves your application, CardNexus redirects them back to you with a one-time code. Exchange that code here — authenticated with your application credential — to learn which account was connected and what it granted you.
The code is single-use and expires 5 minutes after it is issued. The account id you receive is what you send in the CardNexus-Account header on every subsequent request for that account.
Body
required
application/json
- Type: stringcodemin length:1required
The one-time code you received on the connect redirect, as the
codequery parameter. Valid for 5 minutes and usable once.
Responses
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
Request Example for post/connect/exchange
curl https://public-api.cardnexus.com/v1/connect/exchange \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"code": ""
}'
{
"accountId": "65f3a2b1c8d4e9f7a6b5c4d3",
"scopes": [
"inventory:read",
"inventory:write"
],
"grantedAt": "2026-02-03T18:42:55.000Z"
}