Python API and Custom Fields for line items.

Boneoh
Tourist
10 0 3

Hi, all! I'm new to Shopify and working on my first customizations. I'm using the Python API with AWS Lambda to process the orders after payment has completed.

 

A few questions about Custom Fields. In our application, the fields are not for customer input and will not be displayed to the customer. They are for back end processing of the order.

 

1. I've added Custom Fields to the order. How can I fetch and update these values using the Python API?

 

2. I don't see where I can add Custom Fields to a line item. Is it possible? I don't see any place to add them.

 

3. I've searched and have seen line_item properties and can fetch them with the Python API. But I can't find an example of how to update existing property values or add them. 

 

Thanks in advance!

 

Pete

Replies 2 (2)

made4Uo
Shopify Partner
3807 713 1129

Hi @Boneoh,

 

You need to run this GET command using requests and get the json data. You do need a token which I assume you already know

Volunteering to assist you!  Likes and Accept as Solution  is highly appreciated.✌
Coffee fuels my dedication. If helpful, a small Coffee Tip would be greatly appreciated.
Need EXPERIENCED Shopify developer without breaking the bank?
Hire us at Made4Uo.com for quick replies.
Stay in control and maintain your security by avoiding unnecessary store access!
Boneoh
Tourist
10 0 3

Thank you for your reply! I should have been more clear. We are using the ShopifyAPI for Python that can be found here shopify_python_api  The docs are very limited but there was a test case for an order here order_test.py  that looks very similar to what I'm trying to do. I will give it a try and post back.