question

kcinfuse avatar image
kcinfuse asked brokenoval answered

Expanding nested discounts for order items

Hello, currently reading the API documentation and it says that when hitting the /orders API endpoint, if we want to fetch the line item discounts, we should make a GET request to the /orders/:id/order_items endpoint separately, making sure to add `?expand=discounts`.





However, I am able to hit the /orders endpoint with the following expansion query param and get the line item discounts: `?expand=lineItems,lineItems.discounts`. I'm wondering why the API docs say I need to make a separate call if this method works. Is this production ready? It would save me a bunch of API calls if so.
OrdersREST APIclover developer communityDiscounts
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

brokenoval avatar image
brokenoval answered
Yes this is production ready, the API is specifically constructed to allow this and won't change in v3
10 |2000

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