I’d like to use the API to export items from my account, then clear the account, then use the API to import the items back in. Would appreciate if you can tell me if this would work.
What I want to do broadly is:-
Reset the account,
Put in opening balances
Bring in the existing contacts
Bring in only invoices for the last financial year.
Now, I’ve had a look at the backed up excel spreadsheet that FreeAgent produces and I can’t see how I can use it because it doesn’t contain identifying IDs for the information.
So what I was thinking of doing was using the API. I’ve used in the past to create invoices and could see a way to do it.
Use the API to select and export the contacts and invoices (including their id references) in JSON.
Reset the account and put in opening balances.
Use the API to import the contacts with the same IDs they had before.
Use the API to import certain invoices (which have references to the contact IDs)
I need someone who understands the APIs to tell me if this would work, or if there would be a problem trying to use the same IDs.
The API doesn’t give you a way to create IDs for new items. In the API documentation, what you’re referring to as IDs are called URLs.
As an example, if you look at how to create an invoice, you’ll see you can pass a contact URLs into the invoice creation process , but you can’t specify what you want the ID of the new invoice to be.
If I understand your request, I think you could tweak your suggested process to make it work though.
- Use the API to select and export the contacts and invoices (including their id references) in JSON
- Reset the account and put in opening balances.
- Use the API to import the contacts, and pull down the new URLs/IDs as an extra field in your stored the JSON
- Use the API to import invoices with references to the contact URLs/IDs you want, referring to the new URLs when you’re importing them
Step 2 is clearly the dangerous step here, so I’d recommend getting a sandbox account to get the process to the point that you’re comfortable with it. If you haven’t already done this, the process is outlined in the quick start section of the docs.
I hope that helps, and good luck with it!