Difference between product IDs from returns query

Hey everyone. I’m running the following query and was wondering what the difference was between the product_id available in ReturnLineItem vs LineItem:

query Returns($order_id: String!, $first: Int!, $after: String) {
  returns(order_id: $order_id) {
    data(first: $first, after: $after) {
      edges {
        node {
          id
          created_at
          reason
          status
          line_items {
            quantity
            quantity_received
            restock
            product_id
            line_item {
              product {
                id
                legacy_id
              }
              sku
            }
          }
        }
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}

Produces a node in my case with the following data:

"node": {
  "id": "UmV0dXJuOjU3ODUzODI=",
  "created_at": "2023-11-21T18:22:32",
  "reason": "",
  "status": "pending",
  "line_items": [
    {
      "quantity": 1,
      "quantity_received": 0,
      "restock": 0,
      "product_id": "UHJvZHVjdEluZm86NDIwOTU2NDg3",
      "line_item": {
        "product": {
          "id": "UHJvZHVjdEluZm86MzExNDI0OTA2",
          "legacy_id": 311424906
        },
        "sku": "P1"
      }
    }
  ]
}

Hey @hencha85,

Thanks for reaching out and welcome to our Developer Community!
I’ll look into this and see if I can offer any insight as to why those id’s are different.

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

Best,
RayanP

1 Like

Hey @hencha85,

Thanks for hanging in there!

UHJvZHVjdEluZm86NDIwOTU2NDg3 - is the id associated with the warehouse product information (physical properties)

UHJvZHVjdEluZm86MzExNDI0OTA2 - is the id associated with the product information ( things like name, weight, virtual etc)

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

Best,
RayanP

Gotcha. So does the id UHJvZHVjdEluZm86NDIwOTU2NDg3 reference some graphql object? I was thinking it might correspond to a WarehouseProduct but I’m not seeing that on my side.

Hey @hencha85,

Thanks for hanging in there!

UHJvZHVjdEluZm86NDIwOTU2NDg3 decodes to ProductInfo:420956487 which looks to be the warehouse product id associated with SKU P2 in your account.

Most ID’s in the Public API are able to be decoded using a Base64 decoder.

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

Best,
RayanP