Skip to content
On this page

Connect

Connect is used to handle company search and realtime authentication when using the API directly. Realtime Authentication is the hardest piece to build from scratch and most choose to use Connect to get to market faster. Connect handles realtime communication with the user when credentials are invalid, or MFA such as a one time code is required.

It is possible use the White Label products alongside Connect and API with no side effects. Which allows A/B testing while developing your own custom solution.

Host

https://connect.q2open.io (production)
https://sb-connect.q2open.io (sandbox)

Connect is a drop-in module that provides a secure, elegant authentication flow for each company that the Q2 CardSwap API supports. Connect makes it secure and easy for clients to link their accounts, while doing the heavy lifting for the authentication.

View demo

Connect Events

Connect will emit events back to your app using the browser postMessage API, WKScriptMessageHandler on iOS, or addJavascriptInterface on Android, allowing you to decide what to do after the user is finished.

EventDescription
authThe user successfully authenticated with a company.
exitThe user exited the module without completing an authentication.
aliveEmitted every 30 seconds to indicate that the user is not idle.

userPresenceRequired

If the company requires that the user is present to pass through any security flows with every login, as indicated by the company.userPresenceRequired flag, there are a number of constraints to consider when designing your user experience:

  • Swaps must be completed in real-time with the user present.

Instead of calling the typical API routes, you'll need to open Connect to perform these actions immediately after a successful authentication. The user won't need to re-enter their username and password, but may need to step through security. Using the authId, items, and paymentMethodId URL parameters as documented below, you'll be able to make payments and swaps in real-time, while allowing users the liberty of maintaining their approach to account security.

URL parameters

The following URL parameters can be optionally passed into the Connect URL to customize the experience.

ParameterDescription
companyIdDeeplink to a specific companyId, skipping the search screen.
swapIdCan be used in conjunction with paymentMethodId to move a swap to a different payment method.
paymentMethodIdSets a previously added payment method to be used for a swap once an authentication is successful.

URL Examples

To authenticate with a company:

https://connect.q2open.io?token=123&companyId=123

To initiate a new swap:

https://connect.q2open.io?token=123&companyId=123&paymentMethodId=123

To move a swap to a different payment method:

https://connect.q2open.io?token=123&swapId=123&paymentMethodId=123