Closed designscience closed 3 years ago
Huh, interesting. This is the first time I've seen a shipping cost field. I'm looking at the docs for the Invoice object and nothing is jumping out:
https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/invoice
By looking at the source code to the Quickbooks PHP library at:
https://github.com/consolibyte/quickbooks-php
It appears that PHP line is for QB Desktop integration and not for QB Online.
I would open a Support Ticket with QBO support and ask them if this field is available via the API (perhaps its undocumented?). If it is available let us know and we can add support for it.
It's not super well documented by Intuit (I've only seen it in the examples), but you need to send 'SHIPPING_ITEM_ID' as the ItemRef to apply shipping to that field on an invoice.
You can do something like this
shipping_line = Quickbooks::Model::InvoiceLineItem.new
shipping_line.sales_item! do |detail|
detail.item_ref = Quickbooks::Model::BaseReference.new('SHIPPING_ITEM_ID')
...
end
Thanks @gbkane it sounds like your solution can solve the OPs issue.
Loving this gem but I'm having trouble figuring out how to fill in the dedicated Shipping field in an invoice using quickbooks-ruby. Of course, a basic line-item could be added but I'm most interested in filling the dedicated shipping field provided by QBO (please see attached image). I was not successful finding an example for this in the API explorer.
One hint that this is possible was a PHP example forwarded by a colleague (source unknown).
Any thoughts or hints on how to do this with this gem would be most helpful. Thank you!