Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should SalesItemLineDetail have a UnitPrice property? #291

Open
chrpai opened this issue Feb 14, 2023 · 3 comments
Open

Should SalesItemLineDetail have a UnitPrice property? #291

chrpai opened this issue Feb 14, 2023 · 3 comments

Comments

@chrpai
Copy link

chrpai commented Feb 14, 2023

According to the JSON documentation at https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/SalesReceipt, the SalesItemLineDetail should have a UnitPrice property. I see the one for Qty but not UnitPrice. Should the model in this SDK have it or is the JSON sample incorrect?

@ServicePal
Copy link

ServicePal commented Feb 14, 2023

A Sales Receipt SHOULD not have a UnitPrice, but it COULD have one. Try the following. Create a sales receipt for a sandbox company, and on the line only specify the Product/Service + Amount. Leave Qty and Unit Price blank. If you query that in the API explorer, you will see the following.

"Line": [
{
"Id": "1",
"LineNum": 1,
"Amount": 220,
"DetailType": "SalesItemLineDetail",
"SalesItemLineDetail": {
"ItemRef": {
"value": "21",
"name": "Boxes of Yellow Lemon bars"
},
"ItemAccountRef": {
"value": "121",
"name": "Services"
},
"TaxCodeRef": {
"value": "NON"
}
}
},
{
"Amount": 220,
"DetailType": "SubTotalLineDetail",
"SubTotalLineDetail": {}
}
],

So, Qty and UnitPrice are optional. You might see them in the JSON or not. Likewise, when you create items for invoices and sales receipts, you can decide whether to include those properties or not. Having said that, it appears to have been omitted from the Sales Receipt documentation.

@chrpai
Copy link
Author

chrpai commented Feb 14, 2023

If it's an optional property, shouldn't the class in the .net SDK define that property? I don't see it in intellisense or the debugger. I see Qty defined in ItemLineDetail which SalesItemLineDetail inherits from. But I don't see UnitPrice (or UnitPriceSpecified) in either. I'm looking at FMS.cs

https://github.com/intuit/QuickBooks-V3-DotNET-SDK/blob/master/IPPDotNetDevKitCSV3/Tools/XsdExtension/Intuit.Ipp.Data/CDMEntities/Fms.cs

@chrpai
Copy link
Author

chrpai commented Feb 19, 2023

In searching these issues we found that it seems to be to set the AnyIntuitObject property and then set another property saying that it's a UnitPrice. Not very intuitive but it works. You still have to provide the total amount and the API will throw an error if Total Amount != Qty * UnitPrice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants