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

randyh
New Member
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.

0 Likes
syf_
Shopify Staff
Shopify Staff
54 11 9

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

0 Likes
randyh
New Member
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

 

0 Likes