#santosh2585

1 messages · Page 1 of 1 (latest)

dreamy hearthBOT
real axle
#

Is the discount applied on line items or invoice? Can you share an example invoice ID (in_xxx)?

onyx inlet
#

The discount is applied on the products - coupans. I have created coupans and that coupans I am associating with the products while attaching products/line items to the invoice.
This is the invoice id (in_1NNDf0SF9C1b0htOGFmIzx99)

dim vessel
#

Hi, looking into this

#

If you looks at the Invoice Item inside the Invoice instead, and expand its discounts, what do you see?

#
onyx inlet
#

The discount_amounts in the line item object I see two discount values as I have used two coupans but the thing is how to know which discount amount is for this line items ?

dim vessel
#

Yes I know, but I mean inside Invoice Line Item there is also a field Invoice Item

#

invoice_item": "ii_1NNDfBSF9C1b0htOU1SF7cXK

#

Can you expand this?

onyx inlet
#

Do I have to expand the associated invoice line items while fetching the invoice ?

dim vessel
#

Yes!

onyx inlet
#

When I fetch the invoice and got line item id, hence i fetched the invoice line item then also I am still not getting the discount value based on the line items?
Is it possible that a line item associated to invoice I can directly get the discount/coupan value ?

dim vessel
#

It could. Let's try to expand it first. Following the Doc above you can do something like expand: ['lines.data.invoice_item']

onyx inlet
#

No by expanding the lines.data.invoice_item then also cannot get the discount value !!!
Here is the response I am getting by expanding
I can see only the discount_amounts value ???

dim vessel
#

Okie I see...

#

Sorry it looks like we don't have percentage information inside the Invoice

#

Then expand the coupon inside it to find any percentage

onyx inlet
#

When I expand the total_discount_amounts I can see the coupan ID, but the problem here is coupan is associated with the products and in invoice I am not getting the product id associated with the invoice rather then I am getting the invoice line item id, So how will I can know this coupan is associated with which line items ??