Return not found based on data from return webhook

In the return webhook’s body, it includes a return_id and return_uuid. I then do a return query to look for the full return order information, but using either value in the id* field bounces with the message

[
    {
      "message": "Return not found",
      "operation": "return",
      "field": "data",
      "request_id": "6346f1cf359a3585d3b32ece",
      "code": 5
    }
  ]

Send help?

Further insight, this was working until the 10th when I got the first error.

Hey @szushii,

Thanks for reaching out. Looking into this now!

Best,
RayanP

Hey @szushii,

Sorry for the delay.

I’m also running into this error and I’m unable to find this Return through appdot and our database. Do you have the order id that’s associated with this return and the webhook body by chance?

Please let me know if you have any questions or concerns.

Best,
RayanP

Hi @sh-agent,

More insights, I did a uuid look up and the returned record has no id. I suspect this is the issue.

The request that failed

Request

{
  "query": "query($return_id: String!) {return(id: $return_id) {\ndata {\n   id\nlegacy_id\naccount_id\nstatus\ncreated_at\nreason\norder {\nlegacy_id\norder_number\n}\n}\n}\n}\n",
  "variables": {
    "return_id": 3830582
  }
}

Response

{
  "errors": [
    {
      "message": "Return not found",
      "operation": "return",
      "field": "data",
      "request_id": "63485ae6caeab2b10bb3819e",
      "code": 5
    }
  ],
  "data": {
    "return": {
      "data": null
    }
  },
  "extensions": {
    "throttling": {
      "estimated_complexity": 2,
      "cost": 1,
      "cost_detail": {
        "return": {
          "items_count": 0,
          "cost": 1,
          "total_cost": 1,
          "fields": {}
        }
      },
      "user_quota": {
        "credits_remaining": 2001,
        "max_available": 2002,
        "increment_rate": 30
      }
    }
  }
}

The UUID query

query MyQuery {
  uuid(entity: Return, legacy_id: 3830582) {
    data {
      id
      legacy_id
    }
  }
}

The UUID Response

{
  "data": {
    "uuid": {
      "data": {
        "id": null,
        "legacy_id": 3830582
      }
    }
  },
  "extensions": {
    "throttling": {
      "estimated_complexity": 2,
      "cost": 2,
      "cost_detail": {
        "uuid": {
          "items_count": 1,
          "cost": 1,
          "total_cost": 2,
          "fields": {}
        }
      },
      "user_quota": {
        "credits_remaining": 2000,
        "max_available": 2002,
        "increment_rate": 30
      }
    }
  }
}
1 Like

Hey @szushii,

Thanks for the quick reply!
Going to see if I can find out what’s causing this issue.

Please let me know if you have any questions or concerns,

Best,
RayanP

I don’t have the webhook in JSON body form but here is where i got both return_id and return_uuid.
Some records are working again using return_uuid,

order_id: 289088098
order_uuid: T3JkZXI6Mjg5MDg4MDk4

1 Like

Hey @szushii,

Going to go ahead and escalate this one to our Engineering Team. I might come back to you with suggestions and will do my best to keep you informed of updates as this ticket progresses.

Thanks for hanging in there, let me know if you have any questions or concerns.

Best,
RayanP

Hi @sh-agent,

Thanks for the update. On our side it seems like I’m getting less and less errors, likely that just the batch of returns during that period did not have the correct ID and UUID mapped so they threw errors. New data coming in is mostly working.

Thanks