项目作者: brianjp93

项目描述 :
Python wrapper for the 3dcart restful api.
高级语言: Python
项目地址: git://github.com/brianjp93/cart3d.git
创建时间: 2018-02-07T17:58:55Z
项目社区:https://github.com/brianjp93/cart3d

开源协议:MIT License

下载


Hello

Only parts of the Product and Order API wrapper are written so far cuz I’m a lazy boi and I don’t need them yet.

Usage

  • Initialize the client.
  • Either access_token or token can be given.
    1. >>> import cart3d
    2. >>> client = cart3d.Client(<client_id>, <client_secret>, token=<token>, access_token=<access_token>, secureURL=<secureURL>)

Products

  • Get all products

    1. >>> r = client.products.get()
    2. >>> r.json()
    3. {... json data ...}
  • Get specific product by SKU

    1. >>> r = client.products.get(sku='ab1234')
    2. >>> r.json()
    3. {... json data ...}
  • Update product inventory

    1. >>> data = [
    2. {
    3. 'SKUInfo': {
    4. 'CatalogID': 9,
    5. 'Stock': 20,
    6. 'Price': 15.99
    7. }
    8. },
    9. {
    10. 'SKUInfo': {
    11. 'CatalogID': 10,
    12. 'Stock': 10,
    13. 'Price': 20.99
    14. }
    15. }
    16. ]
    17. >>> r = client.products.update(data)
    18. >>> r.json()
    19. {... json data ...}