Can't complete a draft order if it was created in a different currency

I can create a draft order fine. I send in the customer id and some line items with a discount.

However, if the customer’s currency is different from my base currency, it seems like the draft order “recalculates” and then updates all the pricing to match the customers currency.

The problem is that this happens when I try to complete the draft order quickly after creating the draft order.

I always take this approach when creating orders;

  1. Create the draft order. Retrieve it’s ID
  2. Poll the status of the draft order, wait until it’s status is “ready”
  3. Complete the draft order via ID.

The draft order comes back as “ready”, but when I go to complete it I get a bunch of error messages.

{
    "data": {
        "draftOrderComplete": {
            "draftOrder": {
                "id": "gid://shopify/DraftOrder/1507734389120",
                "order": null,
                "__typename": "DraftOrder"
            },
            "userErrors": [
                {
                    "field": null,
                    "message": "The previously proposed price for this merchandise was invalid and has been updated.",
                    "__typename": "UserError"
                },
                {
                    "field": null,
                    "message": "The previously proposed price for this merchandise was invalid and has been updated.",
                    "__typename": "UserError"
                },
                {
                    "field": null,
                    "message": "The previously proposed price for this merchandise was invalid and has been updated.",
                    "__typename": "UserError"
                },
               { ... continued for 130 lines ... }
                {
                    "field": null,
                    "message": "The supplied custom discount was not honoured.",
                    "__typename": "UserError"
                },
                {
                    "field": null,
                    "message": "The supplied custom discount was not honoured.",
                    "__typename": "UserError"
                },
                {
                    "field": null,
                    "message": "The supplied custom discount was not honoured.",
                    "__typename": "UserError"
                },
                { ... continued for 130 lines ... }
            ],
            "__typename": "DraftOrderCompletePayload"
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 11,
            "actualQueryCost": 11,
            "throttleStatus": {
                "maximumAvailable": 2000,
                "currentlyAvailable": 1989,
                "restoreRate": 100
            }
        }
    }
}

This seems more likely to happen when there are more lines items on the order.

I would expect that the draft order should not return “ready” if it is going to change prices on me.

If I view the draft order in the admin section, everything looks fine, and the prices show up in the customer’s currency (different from the store’s base currency).

This is happening on a client’s store. Using API version 2025-01.

Update:

We actually can’t complete this draft order even from the admin section…

So I don’t think this actually has anything to do with the draft order not being “ready”.

I found the issue.

I had inadvertently sent in an empty “appliedDiscount” field when creating the draft order. And in this appliedDiscount field I supplied the store’s base currency.

When this differed from the customer’s currency the draft order was not able to be completed.

After removing this from the draft order creation process, it all worked as expected.

Great to hear you figured this out and thanks for updating the post here Ozzy!