Bank Transfers


Overview

URL https://api.xero.com/api.xro/2.0/BankTransfers
Methods Supported GET, PUT
Description Allows you to retrieve any bank transfers
Allows you to create bank transfers
Allows you to attach files to bank transfers

GET BankTransfers

The following elements are returned in the BankTransfers response

FromBankAccountSee FromBankAccount
ToBankAccountSee ToBankAccount
AmountThe amount being transferred
DateThe date of the Transfer YYYY-MM-DD
BankTransferIDThe identifier of the Bank Transfer
CurrencyRateThe currency rate
FromBankTransactionIDThe Bank Transaction ID for the source account
ToBankTransactionIDThe Bank Transaction ID for the destination account
HasAttachmentsBoolean to indicate if a Bank Transfer has an attachment
CreatedDateUTCUTC timestamp of creation date of bank transfer
Elements for FromBankAccount and ToBankAccount
CodeThe Account Code of the Bank Account
AccountIDThe ID of the Bank Account
NameThe Name Bank Account

Optional parameters

Record filter You can specify an individual record by appending the BankTransferID to the endpoint, i.e.
GET https://.../BankTransfers/297c2dc5-cc47-4afd-8ec8-74990b8761e9
Modified After The ModifiedAfter filter is actually an HTTP header: 'If-Modified-Since'.
A UTC timestamp (yyyy-mm-ddThh:mm:ss) . Only bank transfers created or modified since this timestamp will be returned e.g. 2009-11-12T00:00:00
Where Filter by an any element (see Filters)
order Order by any element returned (see Order By)

Example response when retrieving all BankTransfers

GET https://api.xero.com/api.xro/2.0/BankTransfers
<BankTransfers>
  <BankTransfer>
    <BankTransferID>d79f3e07-5f11-45e4-9d1a-30be536d0e13</BankTransferID>
    <CreatedDateUTC>2014-02-25T19:27:15</CreatedDateUTC>
    <Date>2014-02-26T00:00:00</Date>
    <FromBankAccount>
      <AccountID>ac993f75-035b-433c-82e0-7b7a2d40802c</AccountID>
      <Name>Business Bank Account</Name>
    </FromBankAccount>
    <ToBankAccount>
      <AccountID>ebd06280-af70-4bed-97c6-7451a454ad85</AccountID>
      <Name>Business Savings Account</Name>
    </ToBankAccount>
    <Amount>20.00</Amount>
    <FromBankTransactionID>b11794bc-775b-4f78-9b28-8f13240082ff</FromBankTransactionID>
    <ToBankTransactionID>f589fb5e-34b3-4392-8207-4ba5a093eae</ToBankTransactionID>
  </BankTransfer>
</BankTransfers>

Example response when retrieving a single BankTransfer

GET https://api.xero.com/api.xro/2.0/BankTransfers/f589fb5e-34b3-4392-8207-4ba5a093ea6e
<BankTransfers>
  <BankTransfer>
    <BankTransferID>f589fb5e-34b3-4392-8207-4ba5a093ea6e</BankTransferID>
    <CreatedDateUTC>2014-02-25T19:27:15</CreatedDateUTC>
    <Date>2014-02-26T00:00:00</Date>
    <FromBankAccount>
      <AccountID>ac993f75-035b-433c-82e0-7b7a2d40802c</AccountID>
      <Code>090</Code>
      <Name>Business Bank Account</Name>
    </FromBankAccount>
    <ToBankAccount>
      <AccountID>ebd06280-af70-4bed-97c6-7451a454ad85</AccountID>
      <Code>091</Code>
      <Name>Business Savings Account</Name>
    </ToBankAccount>
    <Amount>20.00</Amount>
    <FromBankTransactionID>b11794bc-775b-4f78-9b28-8f13240082ff</FromBankTransactionID>
    <ToBankTransactionID>f589fb5e-34b3-4392-8207-4ba5a093ea6e</ToBankTransactionID>
    <CurrencyRate>1.000000</CurrencyRate>
  </BankTransfer>
</BankTransfers>

PUT BankTransfers

Use this method to create a bank transfer

  • The two sides of each bank transfer will automatically be recorded as RECEIVE-TRANSFER and SPEND-TRANSFER types in the GET BankTransactions endpoint
  • The BankTransationIDs are returned in responses for successful PUTs.


Note the following functionality is not currently supported
  • You cannot specify the reference field
  • You cannot transfer between accounts in different currencies
The following are required to create a bank transfer
FromBankAccountSee FromBankAccount
ToBankAccountSee ToBankAccount
Amount
The following are optional to create a bank transfer
DateThe date of the Transfer YYYY-MM-DD. Defaults to current date.
Elements for FromBankAccount and ToBankAccount
CodeThe Account Code of the Bank Account. If Code is not included then AccountID is required.
AccountIDThe ID of the Bank Account. If AccountID is not included then Code is required.

Example of creating a bank transfer between accounts

PUT https://api.xero.com/api.xro/2.0/BankTransfers
<BankTransfers>
  <BankTransfer>
    <FromBankAccount>
      <Code>090</Code>
    </FromBankAccount>
    <ToBankAccount>
      <Code>091</Code>
    </ToBankAccount>
    <Amount>20.00</Amount>
  </BankTransfer>
</BankTransfers>

Uploading an Attachment

You can upload up to 10 attachments(each up to 3mb in size) per bank transfer, once the bank transfer has been created in Xero. To do this you'll need to know the ID of the bank transfer which you'll use to construct the URL when POST/PUTing a byte stream containing the attachment file. e.g. https://api.xero.com/api.xro/2.0/BankTransfers/f0ec0d8c-6fce-4330-bb3b-8306278c6fd8/Attachments/image.png. See the Attachments page for more details.

Example of uploading an attachment

POST /api.xro/2.0/BankTransfers/f0ec0d8c-4330-bb3b-83062c6fd8/Attachments/Image002932.png
Headers:
Authorization: OAuth...
Content Type: image/png
Content-Length: 10293
Body:
{RAW-IMAGE-CONTENT}