Hi there.
I’ve been searching through the forums here about shipping rates and weights by item (or item variation) in the square API, But I’ve only found manual options or [functionality to be added]’s from years ago.
Is there currently a way to reach the item variation/s child object weight via the api? It seems like a valuable add to me, and I’m wondering why I can’t find more about it.
I’ll recreate my item catalog in any way that supports me being able to pass in a weight for every orderable item on my online square page. Or have my ‘Shipping rate by weight"‘ be mapped to a custom attribute that I call shipping_weight and set myself.
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
As of the latest information available, the Square Catalog API does not natively support a specific field for item weight within the item variation or item objects. However, you can achieve your goal by using custom attributes to store and manage the weight of each item variation.
Here’s how you can proceed:
Create a Custom Attribute Definition: Use the Catalog API to create a custom attribute definition for weight. This will allow you to store weight information for each item variation. You can define this attribute as a number type to store the weight value.
Assign Custom Attributes to Item Variations: Once the custom attribute definition is created, you can assign a weight value to each item variation using the custom attribute. This will allow you to manage and retrieve the weight information programmatically.
Use the Custom Attribute in Your Application: When calculating shipping rates, you can retrieve the weight custom attribute for each item variation in an order and use it to determine the shipping cost based on the total weight.
By using custom attributes, you can effectively manage and utilize item weights in your application, even though the Catalog API does not directly support a weight field. This approach provides flexibility and allows you to integrate weight-based shipping calculations into your workflow.
Thank you so much, Bryan! Your suggestion works to pass in a custom field I generate called Weight. Unfortunately it doesn’t solve my use case, as I’m looking to calculate shipping rates on my square store using weight per item variation.
It appears that custom variable’s aren’t able to be accessed by something like a shipping rate calculation on square’s online stores. The weight field under Item Library > Item > Edit Variation is the one I wish to populate dynamically. Are there any plans on the dev roadmap to add this functionality to the catalog API?
That is correct. At this time that isn’t currently available. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team.