Development discussions around Shopify APIs
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.
https://help.shopify.com/en/api/reference/orders/draftorder#create-2019-07
Hi @trowland_noram,
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,
Ryan
Ryan | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
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?
That doesn't help. Who on earth wants something going to the customer saying D1 or D2 etc (especially D1 gee customer, we've never done this before.... 😞 ) All developers should be forced to open up a business and use their product.
I'm having thew exact same issue! I have a wholesale order to send titled 'D3'. How do we change it??
A possible work-around for this might be to set a custom "note_attributes" item, such as:
"note_attributes": [
{
"name": "custom_name",
"value": "My Custom Order"
}
]
we can set an order name by define and Assign name index in order_array/order_json.
like this : name = 'order_name',
Is this still the case? Having to send a generic "#D1" invoice to a customer is not a great experience.
Is this still not fixed? This seems to be such a simple problem for shopify to fix on their backend to allow us the option to rename Draft names to our own choosing.
User | RANK |
---|---|
10 | |
4 | |
3 | |
3 | |
3 |
As a business owner, have you ever wondered when your customer's first impression of yo...
By Skye Jun 6, 2023We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023