Skip to content

Instantly share code, notes, and snippets.

@enamhasan
Created May 4, 2019 12:42
Show Gist options
  • Save enamhasan/eb7b3474553a2809254cfb2c16285e11 to your computer and use it in GitHub Desktop.
Save enamhasan/eb7b3474553a2809254cfb2c16285e11 to your computer and use it in GitHub Desktop.
Shopfy Private App using PythonAPI 5.0.1
import shopify
API_KEY = 'api_key_from_shopify_adimin'
PASSWORD = 'app password'
SHOP_NAME = 'xyz'
shop_url = "https://SHOP_NAME.myshopify.com/admin"
shopify.ShopifyResource.set_user(API_KEY)
shopify.ShopifyResource.set_password(PASSWORD)
shopify.ShopifyResource.set_site(shop_url)
shop = shopify.Shop.current()
order = shopify.Order()
order.email = "foo@foo.com"
order.note = "a test note here"
order.fulfillment_status = "fulfilled"
order.send_receipt = True
order.send_fulfillment_receipt = False
order.line_items = [{"variant_id": 10356126449700, "quantity": 1}]
success = order.save()
print(success)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment