Apply multiple discounts on order create through rest API

Topic summary

Issue: Only the first discount code is applied when creating orders via the Shopify Admin REST API, even when sending multiple entries in discount_codes as the docs suggest.

Context: During historical order migration (NodeJS, latest stable REST API 2024-01), payloads with two discounts (e.g., fixed_amount) result in only the first being applied.

Confirmation: Multiple developers report the same behavior and cite the official documentation that indicates multi-discount support.

Specific case: Some historic orders include both line item discounts and a shipping discount. Teams can merge multiple line item discounts into one, but cannot merge a shipping discount with a line item discount because line item discounts do not affect shipping in Shopify.

Example payload shared includes a fixed_amount discount and a shipping-type discount in the same array.

Status: No workaround or resolution provided. Participants suspect a platform bug or a documentation mismatch. Discussion remains open. Code snippets are central to understanding.

Summarized with AI on December 27. AI used: gpt-5.

Hi, we are currently migrating our e-commerce to Shopify and I’m working on historical order sync using REST API (the latest stable version) and NodeJS, some of our orders have up to 2 discounts applied but when I pass more than 1 discount code only the first one is applied to the order, for ex:

const shopifyOrder = new shopify.rest.Order({ session });

...

sOrder.discount_codes = [
          {
            code: "CODE_1",
            amount: "20",
            type: "fixed_amount",
          },
{
            code: "CODE_2",
            amount: "30",
            type: "fixed_amount",
          },
        ];

...

is it possible to create an order with more than one discount? thanks.

5 Likes

Having the same issue as you. Only the first discount code is applied when sending in an array of discount codes.

Seems like a bug as the documentation clearly states we should be able to do this.

https://shopify.dev/docs/api/admin-rest/2024-01/resources/order#Createanorderandapplyadiscount

3 Likes

We’re facing same problem, Let us know if you find a solution.

2 Likes

We are also experiencing this issue despite the documentation to the contrary (mentioned by Mattyonice). We are trying to import historic orders and in some cases the order has both a line item discount and a shipping discount. We are already grouping multiple line item discounts into one because of this issue, but we cannot group the shipping discount with the line item discount as line item discounts do not get applied to shipping values in Shopify.

[
{"code":"DISCOUNT","amount":240,"type":"fixed_amount"},{"code":"SHIPPING_DISCOUNT","amount":10,"type":"shipping"}
]