borderless Docs

borderless Docs

  • Account Setup
  • Account Services
  • Verification
  • Payments
  • Refunds
  • Developer Tools

›Mutations

Account Setup

    Queries

    • accountIdentificationTypes
    • accountSetupSession
    • allCountries
    • businessTypes
    • isValidBusinessTaxId
    • isValidPersonalTaxId
    • isValidSlug
    • jobTitles
    • naics
    • supportedCountries
    • zoneCodes

    Mutations

    • addAccountToPerson
    • addCompanyOfficerToAccount
    • createAccountSetupSession
    • createLoginPersonAndAccount
    • deactivateAccount
    • resendEmailVerification
    • submitAccountSetupSession
    • submitCompanyOfficers
    • updateAccountSetupSession

Account Services

    Queries

    • account
    • accounts
    • bankAccounts
    • companyOfficers
    • person
    • publicAccountBySlug

    Mutations

    • addBankAccount
    • changePassword
    • changePreferredBankAccount
    • login
    • logout
    • requestPasswordReset
    • sendInvitationEmail
    • sendInvitedRegisterEmail
    • switchAccounts
    • updateAccount
    • updatePerson

Verification

    Mutations

    • addOnfidoDocumentToPerson
    • embedOnfido

Payments

    Queries

    • contacts
    • paymentActivity
    • paymentActivityById
    • paymentRequestById
    • paymentSession
    • requestedPayments
    • tradeConfirmationForPayment

    Mutations

    • clearPaymentSession
    • createPaymentForRequestSession
    • createPaymentSession
    • declinePaymentRequest
    • generatePayMeRequest
    • requestPayment
    • resendPaymentRequest
    • submitPaymentSession
    • updatePaymentSession
    • updateQuote

Refunds

    Queries

    • refundSession

    Mutations

    • clearRefundSession
    • createRefundSession
    • submitRefundSession
    • updateRefundSession

Developer Tools

    Queries

    • accountWebhooks
    • embedVerificationService

    Mutations

    • createWebhook
    • healthCheck
    • testWebhook

switchAccounts

Overview

This mutation switches to another account (whose account ID you input) owned by the person logged in during the current login session.

Special Considerations

  • Must input a valid AccountId of an account owned by the current logged in person.

Inputs

SwitchAccountsArgs

Required Data

accountId: string

Returns

Promise<AuthPayload>

A promise containing the following object / data:

user: {
  account: switchedAccount (PrivateAccount),
  person: PrivatePerson,
  loginId: ID,
}

Example

Running this mutation:

mutation {
  switchAccounts(accountId: "ckbb5u1tf00640729cvtp0awh") {
    user {
      account {
        id
        name
      }
      person {
        id
        firstName
        email
      }
      loginId
    }
  }
}

Gives us:

{
  "data": {
    "switchAccounts": {
      "user": {
        "account": {
          "id": "ckbb5u1tf00640729cvtp0awh",
          "name": null
        },
        "person": {
          "id": "ckbayt7re001g072936avt48y",
          "firstName": null,
          "email": "lydia.g.you@gmail.com"
        },
        "loginId": "5ee2544bee2be40013fdada8"
      }
    }
  }
}

Common Errors

When running this mutation some of the common errors encountered include:

  • You do not own this account. (I-4410)
    • An account was found but you do not have access to that account.
← sendInvitedRegisterEmailupdateAccount →
  • Overview
  • Special Considerations
  • Inputs
    • SwitchAccountsArgs
  • Returns
    • Promise<AuthPayload>
  • Example
  • Common Errors
borderless Docs
Docs
Account SetupAccount ServicesVerificationPaymentsRefundsDeveloper Tools
More
LoginBlogGitLabLinkedInInstagramTwitter
Facebook Open Source
Copyright © 2022 borderless