question

Jai avatar image
Jai asked quick18dev edited

Getting Discounts object using REST API

I have created order using clover sdk and I have applied the order level discount to the order using orderConnector. While setting the discount I set the discounts.discount reference the the Discount object . While getting the order from clover SDK I am getting discount.discount object.

 "discounts": {
"elements": [
  {
    "amount": -500,
    "id": "WY9DXWPB46VNM",
    "name": "test Order Discount",
    "discount": {
      "id": "com.test.discount"
    }
  }
]

}

But when I try to get the same order from the REST client I am not getting that Discount.discount object.

 "discounts": {
"elements": [ {
    "id": "WY9DXWPB46VNM", 
    "orderRef": {
      "id": "6FRX6WHY9QZV6"
    }, 
    "name": "test Order Discount", 
    "amount": -500
  }
]

},

I have tried using expanders to the REST request like discounts, discounts.discount.

OrdersDiscounts
1 comment
10 |2000

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

quick18dev avatar image quick18dev commented ·

We've experienced the same issue where the REST /orders endpoint does not return the discounts for the order when passing in expand=discounts. We can certainly call the discounts endpoint but it requires another call to the API which may cause us to hit the API call limits when building reports.

0 Likes 0 ·

0 Answers

Welcome to the
Clover Developer Community