prestashop orders client
1.0.0
Prestashop訂單客戶端是一個簡單,經過徹底測試的客戶端,用於Prestashop API,旨在無縫提取訂單數據。最初創建的目的是滿足我們對諸如向我們的郵政服務發送新的付費訂單等任務的自動化需求,我們決定與社區分享這個易於使用的客戶。我們希望它也證明對他人也有用!
> >> from prestashop_orders_client import PrestaShopOrderClient
> >> client = PrestaShopOrderClient ( shop_link = "myshop.com" , api_key = "my_api_key" )
> >> client . get_order ( 1 )
Order ( id = 1 , total_paid = 500.0 , reference = 'ABCD'
order_state = 'Shipped' , email = '[email protected]' ,
first_name = 'John' , last_name = 'Doe' ,
company_name = None , phone = '+12345678' ,
address = 'Example address' ,
city = 'Example city' , post_code = '123456' ,
country = 'Example country' , state = None )
> >> client . get_all_orders ()
[
Order ( id = 1 , total_paid = 500.0 , reference = 'ABCD'
order_state = 'Shipped' , email = '[email protected]' ,
first_name = 'John' , last_name = 'Doe' ,
company_name = None , phone = '+12345678' ,
address = 'Example address' ,
city = 'Example city' , post_code = '123456' ,
country = 'Example country' , state = None ),
Order ( id = 2 , total_paid = 1000.0 , reference = 'ABCD'
order_state = 'Shipped' , email = '[email protected]' ,
first_name = 'John' , last_name = 'Doe' ,
company_name = None , phone = '+12345678' ,
address = 'Example address' ,
city = 'Example city' , post_code = '123456' ,
country = 'Example country' , state = None ),
....
]
>> > client . orders_amount
8確保您的服務器安裝了SSL證書,因為Prestashop API需要它,並且我們的客戶端使用“ HTTPS”來執行請求。
客戶可在PYPI上找到,需要Python 3.10+
$ python -m pip install prestashop_orders_client 該項目是根據Apache 2.0許可證獲得許可的。