borderless Docs

borderless Docs

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

›Queries

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

paymentSession

Overview

This query gets the active payment session information. The query works for payment and paymentForRequest sessions.

Special Considerations

  • A payment session must be active before you can query

Inputs

N/A

Returns

Promise<PaymentSessionResult>

A promise containing the following object / data:

PaymentSessionResult: {
  payer: PaymentPayer
  beneficiary: PaymentBeneficiary
  tempExchangeRate: TempFxRates
  tempValueDate: DateTime
  reviewPayment: ReviewPayment
}

Example

Running this query:

query {
  paymentSession {
    payer {
      bankAccount {
        id
        currency
      }
    }
    beneficiary {
      currency
      contact {
        account {
          slug
        }
      }
    }
    reviewPayment {
      paymentObject {
        payer {
          totalAmount
        }
      }
    }
  }
}

Gives us:

{
  "data": {
    "paymentSession": {
      "payer": {
        "bankAccount": {
          "id": "ckb6tx8tn00ho07723ir1f6ak",
          "currency": "USD"
        }
      },
      "beneficiary": {
        "currency": "CAD",
        "contact": {
          "account": {
            "slug": "testbusiness"
          }
        }
      },
      "reviewPayment": {
        "paymentObject": {
          "payer": {
            "totalAmount": 35
          }
        }
      }
    }
  }
}

Common Errors

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

  • There is not a payment session with this id. (I-4716)
    • You may not have created a payment session before trying to query information for the payment session
← paymentRequestByIdrequestedPayments →
  • Overview
  • Special Considerations
  • Inputs
  • Returns
    • Promise<PaymentSessionResult>
  • Example
  • Common Errors
borderless Docs
Docs
Account SetupAccount ServicesVerificationPaymentsRefundsDeveloper Tools
More
LoginBlogGitLabLinkedInInstagramTwitter
Facebook Open Source
Copyright © 2022 borderless