Get lineitem discounted unit price

_SZ
Tourist
3 0 1

Hi guys ..

 

We've developed an integration for a client with a 3PL partner, the integration handles the usual logistical aspects including managing refunds.

So one we get a request to refund an item, we'd fetch the GraphqlOrder & Look for the specified item and then use the value of discountedUnitPrice to calculate the refund amount.

 

This mostly works, except for cases when the line item is discounted (discount code or shopify script), in which case, the discountedUnitPrice value equals the originalUnitPrice

So we'd better use the originalUnitPrice instead & calculate the discounted unit price manually using the discountAllocations property.

 

My question is : Is this is expected behaviour for discountedUnitPrice ? or is it a bug from the Graphql API ?

 

Thank you.

 

 

polozerance
New Member
2 0 1

I experienced a similar issue.

Is it possible to have an official response from Shopify about this MAJOR ISSUE that is impacting calculation of the amount of refunds on discounted products 

Regards

0 Likes
SBD_
Shopify Staff
Shopify Staff
1081 146 193

Hey @_SZ 

discountedUnitPrice should indeed be the discounted price: "The price of a single variant unit after line item discounts are applied in shop and presentment currencies."

I'm unable to replicate on a test store - can you please provide an example shop/order ID?

0 Likes
_SZ
Tourist
3 0 1

Hey SBD_,

 

Here are 2 examples for Shop (40728559766) :

- 3741155852438 : the discount applied through the discount code applies to specific items

- 3730827673750 : the discount is applied to the entier shopping cart.

 

In both cases the value of  discountedUnitPrice each line itme equals that of originalUnitPrice.

 

Thank you for your help in advance

0 Likes
_SZ
Tourist
3 0 1

@SBD_, please let me know if the provided examples are helpful, or if you need any more information.

 

- Thanks

0 Likes
SBD_
Shopify Staff
Shopify Staff
1081 146 193

Hey @_SZ 

That does seem inaccurate. Thanks for flagging this, I've raised an issue internally.

For the meantime, continue using the discountAllocations workaround.

0 Likes
SBD_
Shopify Staff
Shopify Staff
1081 146 193

Hey @_SZ 

The pricing team have confirmed this is a bug. Will have more information soon.

0 Likes
xmimoun
New Member
4 0 0

Hello, any updates on that thread ?

0 Likes