finerworks is a Python 3 package for the Finerworks art printing & drop shipping service through their REST API.
- You will need to request an API key through Finerworks here.
- Read Finerworks API docs here.
- Make note that initially your API keys aren't considered live until you check the box on your account profile.
>>> import json
>>> import finerworks
>>> f = finerworks.api(web_api_key='foo', app_key='bar')
>>> f.login()
>>> f.order_status(123456)
addr = {
"first_name":"Harry",
"last_name":"Potter",
"address_1":"350 Fifth Avenue",
"city":"New York City",
"state_code":"NY",
"zip_postal_code":"10118",
"country_code":"US"
}
>>> resp = f.address_validate(addr)
>>> print(json.dumps(resp,indent=4))
{
"status": {
"success": true,
"status_code": 200,
"message": "",
"debug": null
},
"address": {
"first_name": "Harry",
"last_name": "Potter",
"company_name": null,
"address_1": "350 Fifth Avenue",
"address_2": null,
"address_3": null,
"city": "New York City",
"state_code": "ny",
"province": "",
"zip_postal_code": "10118",
"country_code": "us",
"phone": null,
"email": null,
"address_order_po": null
}
}
addr = {
"first_name":"Harry",
"last_name":"Potter",
"address_1":"350 Fifth Avenue",
"city":"New York City",
"state_code":"NY",
"zip_postal_code":"10118",
"country_code":"US"
}
product = {
"product_qty":1,
"product_sku":"AP89646P264575"
}
resp = f.order_submit(product=product, recipient=addr, order_no="12345679", shipping_code="EC", test=True, validate_only=True)
>>> print(json.dumps(resp,indent=4))
{
"status": {
"success": true,
"status_code": 200,
"message": "",
"debug": null
},
"orders": null,
"debug": null,
"misc": null
}
NOTE: There are two important flags here
validate_only
andtest
which both roughly mean this isn't a real order. Also, theproduct_sku
can be pre-generated by populating your Virtual Inventory in the Web UI of your Finerworks account.
>>> resp = f.order_update(123456, 'cancel') # options: pending, hold, cancel
>>> print(json.dumps(resp, indent=4))
{
"success": true,
"status_code": 400,
"message": "Your order status has been changed to cancel.",
"debug": null
}
- Add support for
/update_customer
endpoint - Add support for
/frame_builder
endpoint - Add support for
/order_shipping
endpoint - Add support for
/submit_note
endpont - Add support for
/get_product_details
endpoint - Improve handling of function args for submitting orders
- Improve structure and objects for order submission
Open to any & all issues, suggestions, or contributions.
@cmd-not-found