Default bank account with API

Problem reported by Paul Green 1 month ago

Hi all, We are now using the API to generate our invoices and have found a potential feature/glitch.

When sending an invoice from our software to Clearbooks, it appears that there is no way to way "use the default bank account for the client" - if you don't include the bank account to use, invoices are generated with no payment details on them - obviously less than ideal.

Am I missing a trick here, or is this an omission in the design? I can't see anything in the docs. Ideally, I'd rather not expose any more permissions to our guarding app than is absolutely necessary.

4 Replies

Hi Paul,

Thanks for reaching out, and for following up with the additional note about the Stripe/PayPal flags.

To answer your questions directly: you aren't missing a trick, and neither of these are glitches. The API is currently designed to process exactly what is explicitly sent in the payload. It doesn't automatically pull in web interface defaults—like default bank accounts or payment gateway flags—if those fields are left out of the request.

I completely understand why you'd want it to work this way, especially to keep your app's permissions as locked down as possible. However, the development team explained that the API works this way to allow for intentional omissions. If the API automatically filled in missing values with account defaults, it would actually remove the ability for developers to intentionally leave those fields blank—a flexibility that many of our current API users rely on.

Because of this, you will need to explicitly include both the bank account details and your preferred Stripe/PayPal flags directly in your API calls if you want them applied to the generated invoices.

I’ve shared your use case with our development team. While we can't change this behaviour right now without breaking integrations for users who rely on leaving those fields empty, they are keeping a close eye on demand to see if we can figure out a different way to support this in the future.

All the best, John

No problem at all Paul!

I've spoken with our developers, and they advised that you can trigger the Stripe payment link by including the internetPaymentAccountIds (along with the Stripe bank account ID) when you create the invoice.

If that doesn't work, just drop us a ticket at support@clearbooks.co.uk with your details. and I can escalate with the team.

All the best, John

Thanks for coming back to me John.

Totally understand that you can't knee-jerk a solution. We can work around it and obviously the permission is there to pull the bank account list and pre-populate from this.

My suggestion for the future and the easiest way I can see to do it is being able to pass a non-existent bank account identifier, either -1, or 255 (assuming no client has 255 bank accounts) that would tell the system to pre-populate with the selected contact default if it has been populated with a fall through to the system default.

Now I have realised the behaviour, the lack of a stripe link is actually more annoying and this has just solved the mystery of why some fast payers have just turned into slow payers without me realizing over the last few months ?

Can I add to this - it'd be nice if it also respected the stripe/paypal flags too.

Reply to this problem

Attach images by dragging and dropping or upload
 

Your comments will be public and can be answered by anyone in the Clear Books community.

Find out what we do and who we are