I'm attempting to create a draft order, however when I attempt to set its name in the fields, Shopify seems to be overwriting it.
"draft_order" => [ "name" => "Test134" "line_items" => [ 0 => array:2 [ "variant_id" => "20545084948534" "quantity" => 1 ] ] "customer" => [ "id" => 2289395662902 ] "tax_exempt" => false ] ]
However hen I look the order up in the UI, I see something like "#D187", which is a far cry from what I was trying to set it.
Looking at the documentation, I don't see where name shouldn't be provided, so I'm wondering if it's a field that is intentionally ignored or if this is a bug?
Context, I'm using this spec.
name is not a writeable field on Orders or Draft Orders, therefore it is ignored on the creation which is why your call works but doesn't set the name. The only way to edit the formatting of the name is to add a prefix or suffix to the standard naming. You can specify these in /admin/settings/general of the store's admin, note this only applies for orders, and not draft orders which I believe will always be #D1, #D2... etc
Hope this helps,
When creating a new (non-draft) Order if you supply the Name field it will correctly name the order. If you try to update the Order with a new name it does nothing.
With draft orders it doesn't have any effect if you supply a name during creation or during an edit. The documentation does not say anywhere that Name is read-only for draft orders.
Is there some other way to get a draft order or regular order named correctly?