Skip to content
On this page

/auth

Instead of using the Connect Product to handle collecting and verifying credentials, the auth endpoint can be used in conjunction with webhook events and the auth step endpoint to have full control of the user experience. Due to the complexity of the auth process, the webhook events that support this are not enabled by default. Please reach out to your customer support contact to discuss using this feature.

Create auth submits a request to validate given credentials then performs a swap. When userPresenceRequired is true, this means the client is set up on the company's site to use code or prompt based MFA.

HTTP Request

POST https://api.q2open.io/v1/auth

Arguments

ParameterDescription
clientIdID of client to create the auth for.
companyIdID of the company to validate credentials for.
itemsMust be set to 'swap'. What to do after validating credentials.
paymentIdentifierOptional - custom identifier for external system correlation.
meta.paymentMethodIdOptional - ID of payment method to assign.
meta.billIdDEPRECATED Optional - ID of existing bill. Should not be used with swapId.
meta.swapIdOptional - ID of existing swap. Should not be used with billId.
formRequired login fields that are unique to each company. Usually email/username and password, but sometimes it can be more such as phone number or account number

Returns

A success message and the new or existing authId for the given company.

Example Request

shell
curl "https://api.q2open.io/v1/auth" \
  -H "Authorization: Bearer dc220490-e6ee-11e5-8a94-e7385a8d929e" \
  -H "Content-Type: application/json" \
  -d '{
    "items": ["swap"],
    "paymentIdentifier": "PaymentIdentifier001",
    "meta": {
        "paymentMethodId": "56e1ddbd1a05319bc198d36f",
    },
    "clientId": "579b695decfa11012711875d",
    "companyId": "579b695decea110719b1874d",
    "form": {
        "email": "example@example.com",
        "password": "12345678"
    }
  }'

Example Response

json
{
    "success": true,
    "message": "Auth has been queued and will respond via webhooks.",
    "authId": "579b695decea110719b1874d"
}