Null value for product Vendor through Orders API but populated via Products API

Null value for product Vendor through Orders API but populated via Products API

randyh
Visitor
2 0 0

The Shopify admin site shows a populated vendor string for my products and I can see the vendor name when I query the Products API, but the vendor name is null when queried through the Orders API in the line items array:

{
  "orders": [
    {
      "id": 3085186039972,
      "financial_status": "paid",
      "name": "#1091",
      "order_number": 1091,
      "line_items": [
        {
          "id": 6649644744867,
          "variant_id": 35125709602979,
          "title": "Roaster's Choice Blend",
          "quantity": 1,
          "sku": "",
          "variant_title": null,
          "vendor": null,
          "product_id": 5410581545123,
...

 Compare this with the Products API query of product id 5410581545123:

{
  "product": {
    "id": 5410581545123,
    "title": "Roaster's Choice Blend",
    "body_html": "...",
    "vendor": "Breeze Roasters",
    "product_type": "Coffee",
    "created_at": "2020-07-17T15:44:45-07:00",
...

Any idea why the vendor field wouldn't be populated? Is there an easy fix?

Thanks.

Replies 5 (5)

syf_
Shopify Staff
95 21 25

Hi @randyh,

I did a little investigation into this, and I'd be happy to share my findings with you so far.

We are currently seeing such behaviour on orders which are subscriptions, and our team of Developers are currently investigating this issue. You would notice that for orders made from the online store (you can find this information underneath the order number on the order details page), the vendor field is populated appropriately.

Like I indicated earlier, our team of developers are currently investigating the said behaviour, and I would get back to you immediately I hear back from them.

Though not the ideal situation, I'd suggest a workaround where you grab the product_id from the order, and make another call to the /products endpoint of the API to get the vendor information.

Please don't hesitate to get back to me if you have any questions or need clarification on this issue.

Best,
Seth.

syf_ | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

randyh
Visitor
2 0 0

Seth,

I should have mentioned that we are using Bold Subscriptions... so that is likely the cause. I have noticed that the first order that a customer places with the subscription package shows the vendor field but the subsequent orders do not (i.e. null value).

Let me know if you implement a fix. Until then I will look into querying the products API.

Thanks for getting back to me. 

Randy

 

meetmitulrathod
Visitor
2 0 0

Hello @syf

any update on above? coz we are also facing the same and have been awaiting to see your response above.

shohara
Shopify Partner
1 0 0

Hello @syf_ 

We also have the same problem.

But we cannot get also product id and variant id in "lineitems" when subscription order.

 

"line_items": [
{
"id": 1047005760xxxx,
"admin_graphql_api_id": "gid://shopify/LineItem/1047005760xxxx",
"fulfillable_quantity": 0,
"fulfillment_service": "manual",
"fulfillment_status": "fulfilled",
"gift_card": false,
"grams": 0,
"name": "CORE KOSO Basic",
"price": "8360",
"price_set": {
"shop_money": {
"amount": "8360",
"currency_code": "JPY"
},
"presentment_money": {
"amount": "8360",
"currency_code": "JPY"
}
},
"product_exists": false,
"product_id": null,
"properties": [],
"quantity": 1,
 
:
 
"variant_id": null,
"variant_inventory_management": null,
"variant_title": null,
"vendor": null,
sellercrafttest
Shopify Partner
2 0 0

It's the exact same issue I'm facing, any solutions?