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

updateRefundSession

Overview

This mutation takes inputs and updates the current refund session accordingly.

Special Considerations

  • All fields must be updated before the refund session can be submitted.

Inputs

MutationUpdateRefundSessionArgs

Required Data

amount: Float description: String message: String (Optional) valueDate: DateTime quoteBasis: String (Optional) reason: RefundReason

Returns

Promise<UpdateRefundSessionResult>

A promise containing either a success message:

message: string

or a call for more data:

dataNeeded: dataNeededForPayment
balanceRefreshRequired: balanceRefresh

Example

Running this mutation:

mutation {
  updateRefundSession(data: {
    amount: 5,
    description: "test",
    message: "Testing",
    valueDate: "2020-06-16",
    quoteBasis: "Arbitrary",
    reason: DUPLICATE
  }) {
    ...on SuccessResult {
      message
    }
    ...on ActionRequiredForPayment {
      dataNeeded {
        idUpload
        personalTaxId
      }
      balanceRefreshRequired {
        bankAccountId
        providerAccountId
        type
      }
    }
  }
}

Gives us:

{
  "data": {
    "updateRefundSession": {
      "message": "Refund session successfully updated"
    }
  }
}

or

{
  "data": {
    "updateRefundSession": {
      "dataNeeded": {
        "idUpload": false,
        "personalTaxId": false
      }
      balanceRefreshRequired {
        "bankAccountId": "1233"
        "providerAccountId": "1234"
        "type": USER_BALANCE_REFRESH_REQUIRED
      }
    }
  }
}

Common Errors

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

  • This is not a valid refund session. (I-4718)

    • The current refund session is not valid. Try to make a new session.
  • You cannot refund more than the original payment. Try an amount equal or less than the refundable amount. (I-4728)

    • The amount input is greater than the original payment.
  • You have reached your maximum refund attempts for this payment. (I-4720)

    • Too many attempts have been made for this refund.
← PreviousNext →
  • Overview
  • Special Considerations
  • Inputs
    • MutationUpdateRefundSessionArgs
  • Returns
    • Promise<UpdateRefundSessionResult>
  • Example
  • Common Errors
borderless Docs
Docs
Account SetupAccount ServicesVerificationPaymentsRefundsDeveloper Tools
More
LoginBlogGitLabLinkedInInstagramTwitter
Facebook Open Source
Copyright © 2022 borderless