Product attributes details

Hi team,
We would like to have some more details regarding the products attributes available in the GraphQL API.
Could you please come back to us with the types (bool, int, string) and data validation rules for the following fields :

  • Barcode
  • Country Of Manufacture
  • Customs Description
  • Customs Value
  • Height
  • Length
  • Name
  • Price
  • Product Note
  • Reorder Amount
  • Reorder Level
  • SKU
  • Tags
  • Tariff Code
  • Thumbnail
  • Value
  • Value Currency
  • Weight
  • Width

Thank you !

Hi @paul-wing

Those should be available when navigating through the schema with any of the client ides suggested

For example, in Altair this is how it looks like:

Which shows:

id String
legacy_id Int
account_id String
name String
sku String
price String
value String
value_currency String
barcode String
country_of_manufacture String
dimensions Dimensions
tariff_code String
kit Boolean
kit_build Boolean
no_air Boolean
final_sale Boolean
customs_value String
customs_description String
not_owned Boolean
dropship Boolean
needs_serial_number Boolean
thumbnail String
large_thumbnail String
created_at ISODateTime
updated_at ISODateTime
product_note String
virtual Boolean
ignore_on_invoice Boolean
ignore_on_customs Boolean
active Boolean
tags [String]

Let me know if that doesn’t help.
Thanks in advance!
Tom

Hi @thomasw thank you for your reply. In addition to the fields types, is there any data validation rules that we should be aware of (e.g. an email address without @ would be rejected) ?

Hi @paul-wing
For the validation errors you should get in return a valid message.
For example if you try to exceed the length of the SKU (128) you will see something like this

"message": "Field 'CreateProductRequest.sku' can't be longer than 128"

Hi @tomasw! I am trying to create a few virtual items but am having trouble. It looks like the “virtual” attribute is not found. Can you help with my mutation below?

mutation {
  product_create(
    data: {
      name: "Isaac Item Test3"
      sku: "113test"
      price: "23.00"
      warehouse_products: {
        warehouse_id: "<WH_ID>"
        on_hand: 0
      }
      value: "15.00"
      barcode: "2233443355chair"
      country_of_manufacture: "US"
      dimensions: { weight: "12", height: "25", width: "10", length: "25" }
      kit: false
      kit_build: false
      no_air: false
      final_sale: false
      customs_value: "1.00"
      not_owned: true
      dropship: false
      virtual: false
    }
  ) {
    request_id
    complexity
    product {
      id
      legacy_id
      account_id
      name
      sku
      price
      value
      barcode
      country_of_manufacture
      dimensions {
        weight
        height
        width
        length
      }
      tariff_code
      kit
      kit_build
      no_air
      final_sale
      customs_value
      customs_description
      not_owned
      dropship
      created_at
    }
  }
}

{
    "errors": [
        {
            "message": "Argument \"data\" has invalid value {name: \"Isaac Item Test3\", sku: \"113test\", price: \"23.00\", warehouse_products: {warehouse_id: \"<WH_ID>\", on_hand: 0}, value: \"15.00\", barcode: \"2233443355chair\", country_of_manufacture: \"US\", dimensions: {weight: \"12\", height: \"25\", width: \"10\", length: \"25\"}, kit: false, kit_build: false, no_air: false, final_sale: false, customs_value: \"1.00\", not_owned: true, dropship: false, virtual: false}.\nIn field \"virtual\": Unknown field.",
            "locations": [
                {
                    "line": 3,
                    "column": 11
                }
            ]
        }
    ]
}

Hi @isaac.wyatt
Yes, that is correct, the field is available for querying but not for creating a product/updating.
I believe the reason is that wey is because it might require first to set inventory to 0, or in the case of kits it might get a bit tricky (ref.: https://help.shiphero.com/knowledgeBase/10180321)
Let me know if you still need it to be added to the Mutations and I could log a Feature Request for it.
Thanks in advance!
Tom

Hi @tomasw thank you for confirming. Reading the knowledge base article, we should be able to create our item master and perform a bulk upload of any skus that need to be set as virtual.

This would still be helpful in the future though. Thank you sir!

Sounds good @isaac.wyatt!
I just posted the Feature Request for the ability to change the flag with the product create and update mutations.
I will let you know as soon as I get a response to it.
Thanks again!
Tom

1 Like

Hi @isaac.wyatt!
Our apologies for the delayed resolution of this, but we wanted to let you know that this mutation should be updated with the virtual flag now.

This would be:

mutation {
  product_create(
    data: {
      name: "Item Test"
      sku: "virtual1234"
      price: "23.00"
      warehouse_products: { warehouse_id: "someID", on_hand: 0 }
      virtual: true
    }
  ) {
    request_id
    complexity
    product {
      id
    }
  }
}

Thanks again for the patience while we implemented this!
Tom