CONNECT_CODE_INVALID
A store plugin tried to exchange a Connect code for its keys, and the code can’t be used.
details.reason says why (see Plugin Connect for the flow):
reason |
What happened |
|---|---|
unknown |
No such code was issued. |
used |
The code was already exchanged. A code works once, and only once. |
expired |
More than 5 minutes passed between approving and exchanging. |
verifier |
The code_verifier is not the one the code’s code_challenge was made from. |
site |
The site_url is not the store the code was issued to. |
Every exchange spends the code, right or wrong, so a code that leaked can’t be tried twice. If a code that was already exchanged is presented again, the connection it made is revoked (its keys and webhooks stop at once): only someone replaying the code would send it a second time.
What to do
Section titled “What to do”- Merchants: press Connect intents.fi in your store’s settings again. It takes a few seconds, and nothing from the failed attempt is left behind.
- Plugin authors: make a fresh
stateandcode_verifierfor every attempt, keep the verifier on your server, exchange the code as soon as the browser comes back, send the samesite_urlyou put in the request, and never retry an exchange with the same code.
Example response
Section titled “Example response”{ "error": { "code": "CONNECT_CODE_INVALID", "message": "…" } }