Skip to content

Conversation

@iu2frl
Copy link

@iu2frl iu2frl commented Apr 15, 2025

This is a one-shot implementation of #38 and #39. I added the API to retrieve the shipping details and corrected a typo in the RestApi routine. The old name was kept using the as clause of Python to ensure backward compatibility

Test code:

from aliexpress_api import AliexpressApi
from aliexpress_api import models

appKey = "xxxxxx"
appSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
trackingId = "xxxxxxxxx"

ext_aliexpress = AliexpressApi(appKey, appSecret, models.Language.EN, models.Currency.EUR, trackingId)
product = ext_aliexpress.get_hotproducts(max_sale_price=3000, category_ids="44", target_currency="EUR", ship_to_country="IT").products[0]
shipping = ext_aliexpress.get_affiliate_product_shipping_info(product_id=product.product_id, sku_id=product.sku_id, ship_to_country="IT", target_currency="EUR", target_sale_price=product.target_sale_price, tax_rate=0.01)
print(f"Product link: {product.promotion_link}")
print(f"Shipping info for product {product.product_id}:")
print(f"Delivery days: {shipping.delivery_days}")
print(f"Shipping fee: {shipping.shipping_fee}")
print(f"Max delivery days: {shipping.max_delivery_days}")
print(f"Min delivery days: {shipping.min_delivery_days}")
print(f"Shipping from: {shipping.ship_from_country}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant