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;
- Create the draft order. Retrieve it’s ID
- Poll the status of the draft order, wait until it’s status is “ready”
- 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.