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.

Internal error on orderInvoiceSend graphql api

Solved

Internal error on orderInvoiceSend graphql api

Y4TO
Shopify Partner
12 2 0

Hello,

I am getting this error after using orderInvoiceSend graphql api

 

 

{"errors":[{"message":"Internal error. Looks like something went wrong on our end.\nRequest ID: cda305fd-284f-452b-a889-dafb445938ce (include this in support requests).","extensions":{"code":"INTERNAL_SERVER_ERROR","requestId":"cda305fd-284f-452b-a889-dafb445938ce"}}]}

 

 



this is how im building my query and consuming the api

 

 

 

 const GraphClient = new Shopify.Clients.Graphql(StoredSession.shop, StoredSession.accessToken);
        const queryString ={"query":`mutation orderInvoiceSend($id: ID!) {orderInvoiceSend(id: $id) {order {id} userErrors {field message}}}`,
            "variables": {
                "email": {
                    "bcc": [""],
                    "body": "hi",
                    "customMessage": "hi",
                    "from": "example@hotmail.com",
                    "subject": "invoice",
                    "to": "example@hotmail.com"
                },
                "id": "gid://shopify/Order/4814922940652"

          }
        };
        console.log(queryString);
  
        const orderInvoice = await GraphClient.query({
          

                data:queryString,
                extraHeaders:{"Content-Type":"application/json"}
});

 

 

 

can someone help? thanks

Ahmed Vohra
You can email me at: ahmedvohra1@hotmail.com

Hire me on upwork
Accepted Solution (1)

Y4TO
Shopify Partner
12 2 0

This is an accepted solution.

The email argument  was missing in the mutation and the EmailInput.bcc was empty which was causing the error.

this is my updated query

const queryString = {
            "query": `mutation orderInvoiceSend($id: ID!, $email: EmailInput) {orderInvoiceSend(id: $id, email:$email) {order {id email} userErrors {field message}}}`,
            "variables": {
                "email": {
                    "bcc": ["example@hotmail.com"],
                    "body": "hi",
                    "customMessage": "hi",
                    "from": "example@elationerp.com",
                    "subject": "invoice",
                    "to": "example@hotmail.com"
                },
                "id": "gid://shopify/Order/4814922940652"

            }
        };
Ahmed Vohra
You can email me at: ahmedvohra1@hotmail.com

Hire me on upwork

View solution in original post

Reply 1 (1)

Y4TO
Shopify Partner
12 2 0

This is an accepted solution.

The email argument  was missing in the mutation and the EmailInput.bcc was empty which was causing the error.

this is my updated query

const queryString = {
            "query": `mutation orderInvoiceSend($id: ID!, $email: EmailInput) {orderInvoiceSend(id: $id, email:$email) {order {id email} userErrors {field message}}}`,
            "variables": {
                "email": {
                    "bcc": ["example@hotmail.com"],
                    "body": "hi",
                    "customMessage": "hi",
                    "from": "example@elationerp.com",
                    "subject": "invoice",
                    "to": "example@hotmail.com"
                },
                "id": "gid://shopify/Order/4814922940652"

            }
        };
Ahmed Vohra
You can email me at: ahmedvohra1@hotmail.com

Hire me on upwork