Skip to content

Instantly share code, notes, and snippets.

@deniscsz
Last active May 2, 2017 21:26
Show Gist options
  • Select an option

  • Save deniscsz/f3205df6874532748209eb503d5c49a6 to your computer and use it in GitHub Desktop.

Select an option

Save deniscsz/f3205df6874532748209eb503d5c49a6 to your computer and use it in GitHub Desktop.
Design do Json para WS de impostos
// Envio
{
"store_id" : "000001",
"customerDocument" : "23752357118",
"items" : [
{"sku": "teste-produto-20", "price": 159.90, "qty": 1},
{"sku": "teste-produto-30", "price": 213.40, "qty": 2}
],
"discount" : 0,
"shippingMethod" : "correios_pac",
"shipping" : 23.5
}
// Retorno
// Caso simples (caso não façamos com imposto por item)
{
"totals" : [
{ "ICMS": 15.65 },
{ "PIS": 3.77 }
]
}
// Retorno
// Caso para impostos individuais por item do carrinho
{
"totals" : [
{ "ICMS": 15.65 },
{ "PIS": 3.77 }
],
"items": [
{
"sku": "teste-produto-20",
"tax": [
{ "ICMS": 4.65 },
{ "PIS": 0.89 }
]
},
{
"sku": "teste-produto-30",
"tax": [
{ "ICMS": 11.00 },
{ "PIS": 2.88 }
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment