Development Plan for Commerce Xero.

Created on 21 March 2013, about 12 years ago
Updated 9 January 2025, 3 months ago

I had started working on an integration with Xero using the Xero API module. However I had used a different method to you had used by creating Xero Invoices for Commerce Orders and then was going to add Xero Payments for Commerce Payment Transaction, however I have now thought that this would only work in two solutions.

API Limits

From the Xero API Guide there are recommended limits on for different items:

  • Invoices: The system is designed to cope with 200-500 invoices per month. If an Xero Invoice is being created from each Commerce Order this could be fine for small stores, or stores with small numbers of high value orders. The store I'm working on averages over 200 orders and that will only grow, so an alternative solution is needed.
  • Bank Transactions: The limit is for 1,000 per month, I assume this also means per account as well. However most payment methods pay in to a clearing account and then make a daily payment in to the bank account. If the transaction on each payment method are in the 1,000 per month region that this data can be sent to Xero. If not the daily total could be sent instead of the individual transactions. This may make reconciling accounts like PayPal more complicated.
  • Inventory Items: Again there is a recommended limit of 1,000, however line items sent to Xero from Commerce do not have to use Xero Inventory Items.
  • Contacts: There is a recommended limit of 5,000 contacts, this can be quickly reached with an e-commerce store. A contact is required to create a Xero Invoice but this could use a generic 'Drupal' contact for Commerce Orders.

The API also has a daily call limit and a maximum POST limit, this can both be handled using the Drupal Queue API.

Drupal Commerce and Financial Accounts

Drupal Commerce's financial reporting systems for accounts have not yet been fully developed and in the development of this module I believe there is opportunity to implement some of those requirements.

The closest example in Xero's integration guides to an e-commerce site is that for EPOS systems, How to integrate my Point of Sale (POS) system with Xero. Xero recommends posting daily totals to Xero as an invoice including both sales and payments in the invoice with a balance of zero.

The concept of an End of Day report, also know as a Z-read, is common in POS and is done when each POS is closed calculating the cash in the draw and other transactions. This isn't done in Commerce though, the Commerce Reporting module has gone some way to providing this information but still the orders are never 'closed' in Commerce.

Development Plan

My ideas for a development plan are as follows; the project is split in to sub module providing integrations with different parts of the Xero API. Then the main module or further sub-modules will control how the data is posted to Xero and what data is included.

Configuration

Tax Types/Rates

If Commerce Tax is enable there needs to be a method to link the Commerce Tax Rate with the Xero Tax Type. If it is not enabled the Xero Tax Type should default to 'NONE'

Payment Methods

As has been set up there needs to be a link between each payment method and the destination bank/clearing account

Income Account

There needs to be a default income account for orders and the possibility of of setting different income accounts for line items.

Sub-modules

Contact

Will provide methods to POST User/Commerce Profiles to Xero Contacts

Inventory

Will provide methods to POST Commerce Products to Xero Items

Invoice

Will provide methods to POST Commerce Orders to Xero Invoices
If Contact is enabled the Xero Contact will be included
If Inventory is enabled the Xero Items will be included

Will add more later, but out of time for today.

πŸ“Œ Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom dwkitchen London

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024