Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

GraphQL ReturnCreate Notify Customer is not working

GraphQL ReturnCreate Notify Customer is not working

FerhatCengiz
Shopify Partner
9 1 2

Hi everyone, when we try to create a return and send notifications to customers through GraphQL, we successfully can send the request, the status of the order is changed in admin, but the customer is not notified for some reason. Does anyone know how to fix it? The most crusial part is to notify customer.

 

 

 

  returnCreate(returnInput: $returnInput) {
    return {
      id
      status
      returnLineItems(first: 1) {
        edges {
          node {
            id
            returnReason
            customerNote
          }
        }
      }
      order {
        id
      }
    }
    userErrors {
      field
      message
    }
  }
}
{
  "returnInput": {
    "notifyCustomer": true,
    "orderId": "gid://shopify/Order/5539718136121",
    "returnLineItems": [
      {
        "fulfillmentLineItemId": "gid://shopify/FulfillmentLineItem/12285018603833",
        "quantity": 1,
        "returnReason": "WRONG_ITEM",
        "returnReasonNote": "Sorry, I ordered the wrong item. Could I get a refund or store credit?"
      }
    ]
  }
}

 

 

 

 

Any help would be appreciated. Thank you so much

Replies 7 (7)

ShopifyDevSup
Shopify Staff
1453 238 527

Hey @FerhatCengiz ! Thanks for bringing this to our attention. 

 

I tested as well, with a near identical mutation as you shared here and was also not able to send a notification, even with "notifyCustomer": true, . 

 

This has been brought to our developers to investigate further. I don't have a timeline on a resolution. I would recommend to keep an eye on the specific returnCreate docs and our developers changelog in the event there are changes to this specific mutation. 

 

Hope that helps 

 

- Kyle G.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

FerhatCengiz
Shopify Partner
9 1 2

Thank you for your reply Kyle, I appreciate your answer. I have one more question, are there any chance that we can use notify customer on requestReturn aswell?

 

Would be perfect to have.

 

Thanks.

ShopifyDevSup
Shopify Staff
1453 238 527

Hey @FerhatCengiz that's a great suggestion. I can see how that would be useful to ensure to the buyer that the request is acknowledged. 

I've passed that suggestion on to our product teams! 

 

Thanks! 

 

- Kyle G.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

petr2
Shopify Partner
1 0 0

Hi Kyle, I also have this problem. Has your team come up with any solutions?

ShopifyDevSup
Shopify Staff
1453 238 527

Hi @petr2,

I can confirm that this behaviour is still occurring on my test store as well, and at this time there is no current solutions to this. Our developers are aware of this issue and are looking into resolving this further. That said due to the technical nature of issues such as these and the various parts of the platform a fix may affect, we are unable to provide any estimated timeframes for when this behaviour will be resolved, though I can assure you are developers are working on this with the correct priority as quickly as possible!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

polygonwindow
Shopify Partner
12 0 8

Hi! Is there any progress on this matter? We have the same issue that we need to send return-notifications to users using the ReturnCreate mutation.. 

 

Thank you

WKS
Shopify Partner
5 0 0

Hi everyone, I have tried this mutation to creat a return but I have a wired error. 

the error says the fulfillment line item id  nnot found, I m sure i have inserted the correct fulfillment line item ID, and the order ID. any idea please ? 

Dear shopify support team can you help in this. 

 

here is my mutation : 

mutation = '''
mutation returnCreate($returnInput: ReturnInput!) {
returnCreate(returnInput: $returnInput) {
return {
id
status
returnLineItems(first: 1) {
edges {
node {
id
returnReason
customerNote
}
}
}
order {
id
}
}
userErrors {
field
message
}
}
}
'''

# Using the correct fulfillmentLineItemId
variables = {
"returnInput": {
"notifyCustomer": True,
"orderId": "gid://shopify/Order/6173298426186",
"returnLineItems": [
{
"fulfillmentLineItemId": "gid://shopify/FulfillmentLineItem/15876747952458",
"quantity": 1,
"returnReason": "WRONG_ITEM",
"returnReasonNote": "Sorry, I ordered the wrong item. Could I get a refund or store credit?"
}
]
}
}

 

and here is the response 

{
  "data": {
    "returnCreate": {
      "return": null,
      "userErrors": [
        {
          "field": [
            "returnInput",
            "returnLineItems",
            "0",
            "fulfillmentLineItemId"
          ],
          "message": "Fulfillment Line Item was not found."
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 14,
      "actualQueryCost": 10,
      "throttleStatus": {
        "maximumAvailable": 2000.0,
        "currentlyAvailable": 1990,
        "restoreRate": 100.0
      }
    }
  }
}
Data:
{
  "returnCreate": {
    "return": null,
    "userErrors": [
      {
        "field": [
          "returnInput",
          "returnLineItems",
          "0",
          "fulfillmentLineItemId"
        ],
        "message": "Fulfillment Line Item was not found."
      }
    ]
  }
}