-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
OrderTaxLine is missing rate_percent. No such property inside docs. #687
Comments
@lukasan - did you solve this problem. I stumbled across the same exactly. |
hey @zeug-it maybe a solution for you is to query it yourself? I had to do that with objects in |
Hi, I found the solution - I think - in the metadata, there is the taxId, with this one you can query the tax from the taxes. |
oh yeah maybe, in my solution I got it like this: var taxlist = await wc.TaxRate.GetAll();
double tax = 0;
if (taxlist.Count == 1)
{
tax = double.Parse(taxlist.SingleOrDefault().rate, System.Globalization.CultureInfo.InvariantCulture);
} with config: AddonRestAPI rest = new(store.Uri + "/wp-json/wc/v3/", store.ApiKey, store.ApiSecret);
WCObject.MetaValueProcessor = ProcessMetaValue;
WCObject wc = new(rest);
...
public class AddonRestAPI : RestAPI
{
public AddonRestAPI(string url, string key, string secret, bool authorizedHeader = true,
Func<string, string> jsonSerializeFilter = null,
Func<string, string> jsonDeserializeFilter = null,
Action<HttpWebRequest> requestFilter = null) : base(url, key, secret, authorizedHeader, jsonSerializeFilter, jsonDeserializeFilter, requestFilter)
{
}
... that was enough for my purposes. |
Same I did after analyzing the result Json and reading documentation :-) |
Hello.
I'm using
The docs have no such
rate_percent
property inOrder - Tax lines properties
https://woocommerce.github.io/woocommerce-rest-api-docs/#order-propertiesWhen I query a single order with Postman, which includes a
tax_lines
array, its object has everything, includingrate_percent
.OrderTaxLine
has no such property.WooCommerce.NET/WooCommerce/v2/Order.cs
Lines 532 to 589 in e90213c
I doubt some plugin adds it, although I didn't test that. Another plugin alongside WooCommerce usually adds everything to
meta_data
.Thanks.
The text was updated successfully, but these errors were encountered: