FROM CACHE - zh-cn_header

The returnCreate GQL API always return "invalid id"

westyle
访客
2 0 0

Can someone help me? I use GQL API to create a return, but I always got error: "invalid id", the following is my code:

 

my query:

mutation returnCreate($returnInput: ReturnInput!) {
  returnCreate(returnInput: $returnInput) {
    return {
      name
      status
      totalQuantity
    }
    userErrors {
      field
      message
    }
  }
}

and my variables:

{
  "returnInput": {
    "notifyCustomer": true,
    "orderId": "gid://shopify/Order/xxxxx",
    "returnLineItems": [
      {
        "fulfillmentLineItemId": "gid://shopify/LineItem/xxxxx",
        "quantity": 1,
        "returnReason": "SIZE_TOO_SMALL",
        "returnReasonNote": ""
      }
    ]
  }
}

and the return of api:

{
  "data": {
    "returnCreate": null
  },
  "errors": [
    {
      "message": "invalid id",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "returnCreate"
      ]
    }
  ],
  "extensions": {
    "cost": {
      "requestedQueryCost": 10,
      "actualQueryCost": 1,
      "throttleStatus": {
        "maximumAvailable": 10000,
        "currentlyAvailable": 9999,
        "restoreRate": 500
      }
    }
  }
}

 

1 条回复1

Stephen49
访客
2 0 0

Hello, I have also encountered the same problem. Have you resolved it now?