RTF
RTF

Reputation: 6504

How to send an invoice email to customer using Quickbooks Online v3 Java SDK?

I would like to send an email regarding a newly created invoice to a customer programmatically using the Java SDK for QuickBooks Online. After successfully creating an invoice e.g.

com.intuit.ipp.data.Customer customer = getCustomer();
com.intuit.ipp.data.Invoice invoice = createInvoice(customer);
// what do I do now ??

The Invoice object doesn't seem to have any function that would send the email. I've looked through the QBO v3 JavaDoc and I can't see any relevant class that would help me do this (maybe something that expects an Invoice as parameter).

The preamble for the Invoice class in that JavaDoc says ...Invoice can be printed and emailed to a customer... which is why I'm assuming it is possible to do with the SDK, but I don't know that for sure.

I've also tried setting the EmailStatus field on the Invoice during creation, e.g.

invoice.setBillEmail( customer.getPrimaryEmailAddr() );
invoice.setEmailStatus( EmailStatusEnum.NEED_TO_SEND );

The only other possible values for that ENUM are NOT_SET and EMAIL_SENT. I've created a test invoice but no email has come through.

I know that there is a Restful endpoint at:

https://quickbooks.api.intuit.com/v3/company/[companyID]/invoice/[invoiceId]/send

...that can be used to email an invoice, but my question is specifically whether or not it's possible to do this using the Java v3 SDK and if so, how?

Upvotes: 1

Views: 1160

Answers (1)

Robert Yeager
Robert Yeager

Reputation: 108

I seem to have found the answer here: https://intuitdeveloper.lc.intuit.com/questions/810174-qbo-v3-api-sending-and-linking-to-invoices

Within the Javadoc for the QBO Java SDK, see this folder: ipp-v3-java-devkit-javadoc-2.5.0

Look at the index.html and find the DataService class. It has various sendEmail() methods.

Hope this helps!

Upvotes: 2

Related Questions