question

jagdish avatar image
jagdish asked bryanvargas answered

where to get a discount in order ?


I have the following order receipt and response.




URL : https://www.clover.com/r/7RJ87M4RDY6EC


Below is the response for above order receipt is getting using /v3/merchants/{mId}/orders/{orderId}/line_items?expand=discounts api
Array

(
    [elements] => Array
        (
            [0] => Array
                (
                    [id] => 66XN4CN38FVVM
                    [orderRef] => Array
                        (
                            [id] => 7RJ87M4RDY6EC
                        )
 
                    [item] => Array
                        (
                            [id] => 7C4JVFSFBA9Z6
                        )
 
                    [colorCode] => #AE9009
                    [name] => Wood Product
                    [price] => 1000
                    [printed] => 
                    [createdTime] => 1712061877000
                    [orderClientCreatedTime] => 1712061875000
                    [exchanged] => 
                    [refunded] => 
                    [isRevenue] => 1
                    [isOrderFee] => 
                )
 
            [1] => Array
                (
                    [id] => SG2DPF738MPGR
                    [orderRef] => Array
                        (
                            [id] => 7RJ87M4RDY6EC
                        )
 
                    [item] => Array
                        (
                            [id] => 7C4JVFSFBA9Z6
                        )
 
                    [colorCode] => #AE9009
                    [name] => Wood Product
                    [price] => 1000
                    [printed] => 
                    [createdTime] => 1712061877000
                    [orderClientCreatedTime] => 1712061875000
                    [exchanged] => 
                    [refunded] => 
                    [isRevenue] => 1
                    [isOrderFee] => 
                )
 
            [2] => Array
                (
                    [id] => PBZYEB25DZJYM
                    [orderRef] => Array
                        (
                            [id] => 7RJ87M4RDY6EC
                        )
 
                    [item] => Array
                        (
                            [id] => 7C4JVFSFBA9Z6
                        )
 
                    [colorCode] => #AE9009
                    [name] => Wood Product
                    [price] => 1000
                    [printed] => 
                    [createdTime] => 1712061877000
                    [orderClientCreatedTime] => 1712061875000
                    [exchanged] => 
                    [refunded] => 
                    [isRevenue] => 1
                    [isOrderFee] => 
                )
 
        )
 
    [href] => http://api.clover.com/v3/merchants/xxxxxxxxx/orders/7RJ87M4RDY6EC/line_items?limit=100
)

So my question is where to get a discount $3.00 as shown in the order receipt screenshot in the above response ?

Discounts
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
bryanvargas avatar image
bryanvargas answered

The order has a order discount not an line item discount, please use:


{ {baseUrl}}/v3/merchants/{ {merchantId}}/orders/{ {orderId}}?expand=lineItems&expand=discounts

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community