# Create Order API error when specifying discount uid on line item

**URL:** <https://developer.squareup.com/forums/t/create-order-api-error-when-specifying-discount-uid-on-line-item/23366>\
**Category:** Questions\
**Tags:** orders-api\
**Created:** [July 25, 2025, 6:41pm UTC](https://developer.squareup.com/forums/t/create-order-api-error-when-specifying-discount-uid-on-line-item/23366 "2025-07-25T18:41:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaron\_sabs](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@aaron\_sabs](https://developer.squareup.com/forums/u/aaron_sabs)\
**Post date:** [July 25, 2025, 6:41pm UTC](https://developer.squareup.com/forums/t/create-order-api-error-when-specifying-discount-uid-on-line-item/23366/1 "2025-07-25T18:41:06Z")

</div>

I’m having an issue where I’m passing in discount information when creating an order through the API. I get back an error message that says: “There is no discount on this order with uid 6883b540475b4”  
However, in my request the uid is clearly present. Here is the request I’m sending:  
{  
“idempotency\_key”: “6883b540475b3”,  
“order”: {  
“line\_items”: [  
{  
“quantity”: “1”,  
“catalog\_object\_id”: “2CMEDTXIGBXO3JJJFPET4IPB”,  
“item\_type”: “ITEM”,  
“name”: “Cryotherapy”,  
“base\_price\_money”: {  
“amount”: 5000,  
“currency”: “USD”  
},  
“applied\_discounts”: [  
{  
“discount\_uid”: “6883b540475b4”  
}  
]  
}  
],  
“location\_id”: “L4BNBNQ0ZEPC0”  
},  
“customer\_id”: “MMR1RSMY2E4GYCQW69MJ9G5Y9R”,  
“discounts”: [  
{  
“uid”: “6883b540475b4”,  
“catalog\_object\_id”: “64MHW76UHXXO7QL57XCRGRZR”,  
“scope”: “LINE\_ITEM”  
}  
]  
}

Any ideas as to what I’m doing wrong? I also tested these same values on the calculate order endpoint and it worked as expected. So I feel like this is either a bug, or something very specific to my discount uid.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [July 25, 2025, 6:41pm UTC](https://developer.squareup.com/forums/t/create-order-api-error-when-specifying-discount-uid-on-line-item/23366/2 "2025-07-25T18:41:24Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[Order Discounts](https://developer.squareup.com/docs/orders-api/discounts)**
>
> Learn how to apply discounts to an order using the Orders API.

> **[Apply Square-Defined Discounts to Orders](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-discounts)**
>
> An example walkthrough showing how to apply preconfigured discounts to an order (the Orders API).

> **Additional Documentation**
>
> [Create Customer Group Discounts](https://developer.squareup.com/docs/catalog-api/configure-customer-group-discounts)  
> [Create Bundled Discounts](https://developer.squareup.com/docs/catalog-api/cookbook/auto-apply-discounts/bundle-discounts)  
> [Apply Taxes, Discounts, and Service Charges](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![aaron\_sabs](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@aaron\_sabs](https://developer.squareup.com/forums/u/aaron_sabs)\
**Post date:** [July 25, 2025, 7:07pm UTC](https://developer.squareup.com/forums/t/create-order-api-error-when-specifying-discount-uid-on-line-item/23366/3 "2025-07-25T19:07:59Z")

</div>

I figured this out. The problem was that the discounts array I added was not inside of the order object. D’oh!

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [July 25, 2025, 7:18pm UTC](https://developer.squareup.com/forums/t/create-order-api-error-when-specifying-discount-uid-on-line-item/23366/4 "2025-07-25T19:18:26Z")

</div>

Glad to hear that you figured it out. Please feel free to reach out if you have any additional questions, we’re always happy to help. 🙂
