Open jtrotsky opened 9 years ago
This was intentional thus far and I would like to get you opinion on how to solve the following challenge:
"taxes": [
{
"outlet_id": "yyy",
"tax_id": "zzz"
},
]
If a retailer has 9000 products, given the structure of taxes array inside a product response ... it requires a lookup to get the names, that means a whole bunch of lookups and with the api rate limiting I think the report may never finish!
But hmmm.... if I just fetch all the taxes in advance then its just one extra pre-emptive api call isn't it? You know what ... on second thought this may be feasible!
@jtrotsky - Can you help me out and paste some data or snapshot of what it looks like when the value won't be Default tax
... does it use the tax name, or tax id or the actual tax numerical value?
Hi @pulkitsinghal ,
It uses the tax name.
/api/taxes
:
taxes: [
{
id: "b8ca3a65-0109-11e4-fbb5-5d6838e3db38",
name: "AU GST",
rate: 0.1,
default: false,
active: true,
rates: [
{
id: "38e3c309-5d68-11e4-9bb5-b8ca3a65011c",
rate: 0.1,
name: "AU GST"
}
]
}
The way I do it is to gather all the taxes from /api/taxes
and then whilst writing the product info I go through each outlet and find the tax with default: true
, if I find a match then I can put Default tax
, otherwise I use the tax_name
from the product.
It looks like this for a tax exclusive store with various taxes on different products/outlets: (ignore the blanks, this is for composite product entries)
It looks like the
outlet_tax
for each outlet is showing blank. If theoutlet_tax
is just the outlet default then it should showDefault tax
, otherwise it should show the specific outlet tax.