# Line\_item id and partner\_line\_item\_id is different

**URL:** <https://community.shiphero.com/t/line-item-id-and-partner-line-item-id-is-different/447>\
**Category:** GraphQL API\
**Created:** [May 1, 2020, 4:02pm UTC](https://community.shiphero.com/t/line-item-id-and-partner-line-item-id-is-different/447 "2020-05-01T16:02:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![prince](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@prince](https://community.shiphero.com/u/prince)\
**Post date:** [May 1, 2020, 4:02pm UTC](https://community.shiphero.com/t/line-item-id-and-partner-line-item-id-is-different/447/1 "2020-05-01T16:02:07Z")

</div>

We use grapql API to create\_order, we send partner\_line\_item\_id along with API, After create order success we get the response from shiphero and also store line\_item id that return from shiphero to our end for reference.

The problem is both partner\_line\_item\_id and id is different from create the order and get order api. See example below  
Response from create\_order api  
{  
“order\_create”: {  
“request\_id”: “5e9ba44e2a46d9fa6b9815ba”,  
“complexity”: 10,  
“order”: {  
“id”: “T3JkZXI6MTIzMTYyMjM5”,  
“order\_number”: “100162”,  
“line\_items”: {  
“edges”: [  
{  
“node”: {  
**"id": “TGluZUl0ZW06MzYxOTU5MjE1”,**  
" **partner\_line\_item\_id": “25”,**  
}  
}  
}  
}

When get\_order id **T3JkZXI6MTIzMTYyMjM5** this is the response that we got

{  
“data”: {  
“order”: {  
“request\_id”: “5ea7fc448d74b1ffed5cda41”,  
“complexity”: 201,  
“data”: {  
“id”: “T3JkZXI6MTIzMTYyMjM5”,  
“line\_items”: {  
“pageInfo”: {  
“hasNextPage”: false,  
“startCursor”: “YXJyYXljb25uZWN0aW9uOjA=”,  
“endCursor”: “YXJyYXljb25uZWN0aW9uOjA=”  
},  
“edges”: [  
{  
“node”: {  
“line\_item”: {  
**"id": “TGluZUl0ZW06MzYyNDA1MTM3”,**  
**"partner\_line\_item\_id": “25-123162239-1”,**  
“quantity”: 1  
}  
}  
}  
}  
}

You see both **id** and **partner\_line\_item\_id** is different? we want this id to map between data line from our site and your site,

Any suggestion why the id and partner\_line\_item\_id is different? what should we do?  
Thanks

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [May 2, 2020, 2:01pm UTC](https://community.shiphero.com/t/line-item-id-and-partner-line-item-id-is-different/447/2 "2020-05-02T14:01:25Z")

</div>

Hi @prince!

That might be because the SKU you use to create the Order:

```
"id": "TGluZUl0ZW06MzYxOTU5MjE1",
"partner_line_item_id": "25",

```

Is a build kit, that has:

```
"id": “TGluZUl0ZW06MzYyNDA1MTM3”,
"partner_line_item_id": “25-123162239-1”,

```

As a component. If you try the following Query you should be able to see both, and their relationship:

```
{
  order(id: "T3JkZXI6MTIzMTYyMjM5") {
    request_id
    complexity
    data {
      id
      order_number
      shop_name
      line_items {
        edges {
          node {
            id
            partner_line_item_id
            sku
            quantity
            product_name
            product {
              kit
              components {
                sku
                name
              }
            }
          }
        }
      }
    }
  }
}

```

Let me know if this is not what you were referring to, or if I can help you with anything else.  
Thanks!,  
Tom

---

<div class="post-metadata">

**Author:** ![prince](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@prince](https://community.shiphero.com/u/prince)\
**Post date:** [May 3, 2020, 12:20am UTC](https://community.shiphero.com/t/line-item-id-and-partner-line-item-id-is-different/447/3 "2020-05-03T00:20:19Z")

</div>

After I try to query I got this information, Kit = False So I don’t sure it is the case or not  
{  
“node”: {  
“line\_item”: {  
“product”: {  
**"kit": false,**  
“sku”: “ZLP-1”,  
},  
“id”: “TGluZUl0ZW06MzYyNDA1MTM3”,  
“partner\_line\_item\_id”: “25-123162239-1”,  
“sku”: “ZLP-1”,  
“quantity”: 1  
}  
}  
}

I think you miss my point here

1. Wh. line\_item **id** is different when we got from **create\_order** response and when we get from **get\_order** , It should not right? it should unique
2. Why **partner\_line\_item\_id** is changed from your-site when we create we send 25, and response from **create\_order** return 25, But when we use get\_order or webhook we get “25-123162239-1”

The main Idea is we need to know which line\_item that shipped So we can match it with ourside, Because our E-commerce store support multiple line per Order Also.

Thanks.  
Prince

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [May 5, 2020, 11:54am UTC](https://community.shiphero.com/t/line-item-id-and-partner-line-item-id-is-different/447/4 "2020-05-05T11:54:43Z")

</div>

Hi @prince  
I apologize if I got that wrong.  
So this is what you should be getting in response for that Query I posted above:

```
{
  "data": {
    "order": {
      "request_id": "5eb151b3540555a86348a3b8",
      "complexity": 101,
      "data": {
        "id": "T3JkZXI6MTIzMTYyMjM5",
        "order_number": "100162",
        "shop_name": "public-api",
        "line_items": {
          "edges": [
            {
              "node": {
                "id": "TGluZUl0ZW06MzYxOTU5MjE1",
                "partner_line_item_id": "25",
                "sku": "ZLP-ADU",
                "quantity": 1,
                "product_name": "Zleep",
                "product": {
                  "kit": true,
                  "components": [
                    {
                      "sku": "ZLP-1",
                      "name": "Zleep Sleep Patches"
                    }
                  ]
                }
              }
            },
            {
              "node": {
                "id": "TGluZUl0ZW06MzYyNDA1MTM3",
                "partner_line_item_id": "25-123162239-1",
                "sku": "ZLP-1",
                "quantity": 1,
                "product_name": "Zleep Sleep Patches",
                "product": {
                  "kit": false,
                  "components": []
                }
              }
            }
          ]
        }
      }
    }
  }
} 

```

For which you see the Kit:

```
 "id": "TGluZUl0ZW06MzYxOTU5MjE1",
                    "partner_line_item_id": "25",
                    "sku": "ZLP-ADU",

```

That has this component Inside:

```
"id": "TGluZUl0ZW06MzYyNDA1MTM3",
                    "partner_line_item_id": "25-123162239-1",
                    "sku": "ZLP-1",

```

And that is because it was turned into a Kit and the component was added on 04/20/2020 09:16 AM.

Maybe you are making a query for the shipment instead of the order?  
That way, if its a Build Kit (such as this one), it will return the component, instead of the Kit

---

<div class="post-metadata">

**Author:** ![prince](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@prince](https://community.shiphero.com/u/prince)\
**Post date:** [May 5, 2020, 7:59pm UTC](https://community.shiphero.com/t/line-item-id-and-partner-line-item-id-is-different/447/5 "2020-05-05T19:59:48Z")

</div>

@tomasw

Yeah we use `shipment` The main goal that we query the order

1. we want to find which order and line item in order has been ship and we want to mark the line item in our system for tracking label and tracking number,
2. We want the `unique id` the we can match line item that have been shipped from your system and our system, So we can mark it as shipped in our system and send customer about the tracking info via email.
3. Imagine that Order have multiple line and each line have it own tracking, like partial order, So we need the `unique id` that we can use to match it from your system with our system about shipment info, now both `id` and `partner_line_item_id` has been change due to it return to kit(I dont know about kit, can you explain more about this? what is this and why `id` and `partner_line_item_id` has been changed? )
4. Do you have any suggestion that what query that we should use to solve the scenario above? the main goal is match shipping info for line items between your system and our system.

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [May 7, 2020, 2:31pm UTC](https://community.shiphero.com/t/line-item-id-and-partner-line-item-id-is-different/447/6 "2020-05-07T14:31:52Z")

</div>

Hi @prince  
So the reason you are seeing this is because that SKU: ZLP-ADU is a [Build Kit](https://help.shiphero.com/knowledgeBase/10178779) which means it is split into components.  
And that’s why, for the Shipment, we register the Component’s SKU, instead of the Kit’s SKU

On the other hand, for Kits that are not Build Kits, when you create a Shipment it will register the Kit’s SKU instead of its components.

So a possible solution might be either to turn this Kit into a `Build Kit: No` so when you get check the shipment it matches the SKU you are expecting.  
Or you could query for the line items “outside” of the shipment and check the `quantity_shipped` & `quantity_pending_fulfillment` with something like this:

```
{
  order(id: "125923578") {
    request_id
    complexity
    data {
      id
      order_number
      shop_name
      line_items {
        edges {
          node {
            id
            partner_line_item_id
            sku
            quantity
            product_name
            quantity_shipped
            quantity_pending_fulfillment              
            }
          }
        }
      }
    }
  }

```

This will return you something like this:

```
{
  "data": {
    "order": {
      "request_id": "5eb41b5898825afe23576962",
      "complexity": 101,
      "data": {
        "id": "T3JkZXI6MTI1OTIzNTc4",
        "order_number": "MO823",
        "shop_name": "Manual Order",
        "line_items": {
          "edges": [
            {
              "node": {
                "id": "TGluZUl0ZW06MzY4MTIyMjMy",
                "partner_line_item_id": "MO823-280895730",
                "sku": "Kit4Test12",
                "quantity": 1,
                "product_name": "Kit for Testing",
                "quantity_shipped": 0,
                "quantity_pending_fulfillment": 0
              }
            },
            {
              "node": {
                "id": "TGluZUl0ZW06MzY4MTIyMjQ5",
                "partner_line_item_id": "MO823-280895730-125923578-0",
                "sku": "1547733400",
                "quantity": 1,
                "product_name": "Product nr2 for Kit Testing",
                "quantity_shipped": 1,
                "quantity_pending_fulfillment": 0
              }
            },
            {
              "node": {
                "id": "TGluZUl0ZW06MzY4MTIyMjUw",
                "partner_line_item_id": "MO823-280895730-125923578-1",
                "sku": "KitTesting1234",
                "quantity": 4,
                "product_name": "Product nr1 for Kit Testing",
                "quantity_shipped": 4,
                "quantity_pending_fulfillment": 0
              }
            }
          ]
        }
      }
    }

```

Where you are able to see the Kit and its component with their corresponding quantity pending to fulfill

---

<div class="post-metadata">

**Author:** ![prince](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@prince](https://community.shiphero.com/u/prince)\
**Post date:** [May 8, 2020, 12:28am UTC](https://community.shiphero.com/t/line-item-id-and-partner-line-item-id-is-different/447/7 "2020-05-08T00:28:52Z")

</div>

@tomasw We want tracking\_numbber and carrier also for sending customer email. How we accomplish this?

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [May 12, 2020, 2:10pm UTC](https://community.shiphero.com/t/line-item-id-and-partner-line-item-id-is-different/447/8 "2020-05-12T14:10:29Z")

</div>

Hi @prince!  
I apologize for the delay on this.  
Is there any particular reason you are making this a Build Kit?  
You could always make it a Regular Kit and then you should be able to see the Kit when querying for the shipment instead of the components  
Thanks in advance!  
Tom
