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

refundSession

Overview

This query gets the information about the current refund session.

Special Considerations

  • Takes no input, but requires an active refund session.

Inputs

None.

Returns

Promise<RefundSessionResult>

A promise containing the following object / data:

payer: PaymentPayer
beneficiary: PaymentBeneficiary
tempExchangeRate: TempFxRates
tempValueDate: DateTime
reviewRefund: ReviewRefund
reason: RefundReason
refundType: RefundType
maxRefundAmount: Float

Example

Running this query:

query {
  refundSession {
    payer {
      bankAccount {
        id
        accountNumber
        routingNumber
        bankName
        currency
        country
        preferredBankAccount
        status
        accountType
        faviconUrl
      }
    }
    beneficiary {
      currency
      contact {
        account {
          accountType
          currency
          displayName
          slug
        }
        email
      }
    }
    tempExchangeRate {
      rate
      invertedRate
    }
    tempValueDate
    reviewRefund{
      paymentObject {
        type
        isSettlementQuote
        expiresIn
        quoteId
        valueDate
        payerToBeneficiaryFX
        savings {
          borderlessAmount
          bankAmount
          savingsAmount
          currency
        }
        payer {
          currency
          subAmount
          totalAmount
          totalFeeAmount
        }
        beneficiary {
          currency
          subAmount
          totalAmount
          totalFeeAmount
        }
      }
      description
      message
    }
    reason
    refundType
    maxRefundAmount
  }
}

Gives us:

{
  "data": {
    "refundSession": {
      "payer": {
        "bankAccount": {
          "id": "ck66w149700s70a62pj8ml8v1",
          "accountNumber": "**1111",
          "routingNumber": "**1111",
          "bankName": "Dag Site",
          "currency": "USD",
          "country": "US",
          "preferredBankAccount": true,
          "status": "FULLY_VERIFIED",
          "accountType": "CHECKING",
          "faviconUrl": "examplefavicon.com"
        }
      },
      "beneficiary": {
        "currency": "GBP",
        "contact": {
          "account": {
            "accountType": "BUSINESS",
            "currency": "GBP",
            "displayName": "Uk Business",
            "slug": "Uk-business"
          },
          "email": null
        }
      },
      "tempExchangeRate": {
        "rate": 0.7982,
        "invertedRate": 1.2528
      },
      "tempValueDate": "2020/06/19",
      "reviewRefund": {
        "paymentObject": {
          "type": "INTERNATIONAL",
          "isSettlementQuote": false,
          "expiresIn": 20,
          "quoteId": "11744152",
          "valueDate": "2020-06-19T00:00:00",
          "payerToBeneficiaryFX": 0.7941,
          "savings": null,
          "payer": {
            "currency": "USD",
            "subAmount": 6.3,
            "totalAmount": 6.3,
            "totalFeeAmount": 0
          },
          "beneficiary": {
            "currency": "GBP",
            "subAmount": 5,
            "totalAmount": 5,
            "totalFeeAmount": 0
          }
        },
        "description": "test",
        "message": "Testing"
      },
      "reason": "DUPLICATE",
      "refundType": "PARTIAL_REFUND",
      "maxRefundAmount": 3245.96
    }
  }
}

Common Errors

  • No active refund session. (I-4721)
    • There needs to be an active refund session to run this query.
← PreviousclearRefundSession →
  • Overview
  • Special Considerations
  • Inputs
  • Returns
    • Promise<RefundSessionResult>
  • Example
  • Common Errors
borderless Docs
Docs
Account SetupAccount ServicesVerificationPaymentsRefundsDeveloper Tools
More
LoginBlogGitLabLinkedInInstagramTwitter
Facebook Open Source
Copyright © 2022 borderless