I'm getting a 404 response but the invoice is right there and I see it when I login to my hubspot account. I even tried setting invoice_id to that of the invoice in hubspot and to that of the invoice in quickbooks but still nothing.
And the documentation of the hubspot api client in python is not functional. 1. There's a weird import: from hubspot.crm.extensions.accounting.invoice import and that's it, it doesn't say what to import
2. If I copy paste the example the exact way and make the api call, I get the following Exception:
AttributeError: 'Discovery' object has no attribute 'invoice'
You were also right about the two points on the Python code on the official documentation page.
Try client.crm.extensions.accounting.invoice_api.get_by_id instead of client.crm.extensions.accounting.invoice.invoice_api.get_by_id.
I will advice you to read the raw code of the hubspot-api-client library to avoid being stuck on the discrepencies of the documentation. The python library is otherwise pretty robust (since it is auto generated from API schema)
@dennisedson Sorry fo missing the notification and for late reply.
What you're proposing is not really doable right now for budget purposes.
We just want to code it using hubspot's api, and I've had a look at the solutoins you've proposed and none of them work.
InvoiceApi.get_by_id(invoiceId, accountId)
this throws the following exception
AttributeError: 'HubSpot' object has no attribute 'client_side_validation'
So it doesn't solve the issue.
And concerning the second problem, the last "/" is not needed since there's no more routing that needs to be done and I did try it but still nothing.
And just FYI, I tried using invoice ID from both platforms, e.g Quickbooks and Hubspot.
One last question, where would I get "accountId" from, because now I'm just getting it from opening up an invoice's pdf directly from hubspot, and I fetch it from the URL.
Ambiguous documentation of the accounting API extension
Sorry @Caterpy that my solution does not work for you. But it works for me. I thought if it would help you.
One last question, where would I get "accountId" from, because now I'm just getting it from opening up an invoice's pdf directly from hubspot, and I fetch it from the URL.
I can not provide detailed process of how to implementet webhook and use Oauth token as it will take too much time out of me. I guess @dennisedson can help you to provide any extra-detailed official documentation or training/tutorial (if available) of CRM Accounting Extension API. Or I guess you may check/post in Hubspot slack channel.