Exclude Tags/Attributes By Default When Duplicating Orders

Is there any way to exclude tags on the order when duplicating them by default? There are lot of third party apps that add tags like “exchange order”, “paid by store credit”, “group order”, etc, that should not be part of the new draft order when duplicating the order from Shopify admin and doing that will cause data issues such as overstating the number of exchange orders and potentially bugs such as applying the group order workflow toward an order that is not a group order.

Looks like an oversight by shopify again by including tags on duplicated draft orders by default, the same applies for order attributes :expressionless_face:

Could it be worked around with admin extension or flow like if an order is created from draft order rather than from checkout, then remove the tags or attributes that should not be there for orders created through draft order?

Hey @Andrew_Jaanuu :waving_hand: - hopefully I’m understanding correctly, but is this happening just when the orders are duplicated in the admin?

At the moment, I can confirm that if you use the “Duplicate” action in on an order in the admin to convert the original order into a a draft order, it does include the tags, but these can be removed from the order manually before the draft order is completed and converted into a new “full” order (by clicking the little X next to the tag).

In terms of workarounds, you could technically use the Orders API to set this up if you were interested in creating a custom app or potentially through Flow.

You could query the order you’d like to duplicate through the API, grab its details and then use either the OrderCreate mutation or the draftOrderCreate mutation to create the new order, but omitting the tags.

That said, I do get where you’re coming from and can see how a toggle to include/exclude tags before the draft order is created from the original order would be helpful. Just wanted to know if I’m understanding the issue correctly here - happy to put through a feature request on my end at the very least so we can record your feedback properly, just ping me here if you’d like me to set that up

Hope this helps! :slight_smile:

Yes, it is related to orders are duplicated in the admin and I do really need the feature request, it has been an ongoing frustration and error prone process by having to remove the tags manually each time we duplicate an order because 99% of the time the tags should not belong to the new draft order like exchange_order, which makes us want to tell people just not to use Shopify admin for order management at all and manage orders through an app instead.

Hey again @Andrew_Jaanuu - Thanks for confirming this. I completely understand your frustration, and I’ll submit that feature request right away on my end here.

In the meantime, just wanted to share a full possible way you could achieve this via the API if you wanted to look at that as an option:

# First, query the original order (excluding tags)
query getOrderForDuplication($orderId: ID!) {
  order(id: $orderId) {
    customer { id }
    email
    lineItems(first: 250) {
      edges {
        node {
          variantTitle
          quantity
          customAttributes { key value }
        }
      }
    }
    shippingAddress {
      address1
      address2
      city
      province
      country
      zip
      firstName
      lastName
      phone
      company
    }
    # Note: just to confirm, here we're deliberately not querying for the tags
  }
}

# Then create a new draft order without the tags based on the data you pulled from above
mutation createCleanDraftOrder($input: DraftOrderInput!) {
  draftOrderCreate(input: $input) {
    draftOrder {
      id
      name
    }
    userErrors {
      field
      message
    }
  }
}

If you needed to work with someone to implement this (either through a custom app or Flow), I believe the best spot to reach out would be here in our Partners’ Directory: https://www.shopify.com/ca/partners/directory

My understanding is that this should be possible to implement fairly easily through either method. I’ll get that feature request set up on my end here ASAP, but please let me know if I can clarify anything more on my end, happy to help!