rhythm Posted June 21, 2019 Share Posted June 21, 2019 Hello, I am fulfilling an order using Webservice API. The steps are: creating customer, creating address for the customer, creating cart with address and customer, and the last step - creating order using customer, address and cart i created prior. How do I get shipping calculation for the said cart / order? I know the carrier id. Link to comment Share on other sites More sharing options...
NemoPS Posted June 29, 2019 Share Posted June 29, 2019 If you have the cart object itself available, you can use its getPackageShippingCost() method. You can try multiple carrier ids if needed Link to comment Share on other sites More sharing options...
rhythm Posted July 1, 2019 Author Share Posted July 1, 2019 I am utilizing PS API from a remote server, can't edit PrestaShop files or use any of php methods in PrestaShop. I am basically stuck with this god awful medieval times API with no docs and basically no support 😕 Link to comment Share on other sites More sharing options...
rhythm Posted July 2, 2019 Author Share Posted July 2, 2019 Up. Anyone? Link to comment Share on other sites More sharing options...
rhythm Posted July 4, 2019 Author Share Posted July 4, 2019 Up, still looking. What's the thought process behind PrestaShop WebService? It's basically useless if you need to interact with it from outside Link to comment Share on other sites More sharing options...
rhythm Posted July 8, 2019 Author Share Posted July 8, 2019 Up the thread again, would be nice to get some information on this Link to comment Share on other sites More sharing options...
camillo777 Posted March 17, 2020 Share Posted March 17, 2020 I would be interested as well I have implemented everything and now i cannot save the order. Link to comment Share on other sites More sharing options...
Morph21 Posted April 28, 2020 Share Posted April 28, 2020 Hi, i don't know if you still have a problem with that but i will post it here anyway. I'm using Prestashop 1.7 when you call endpoint: [GET] /api/orders?output_format=JSON&display=full you will get list of your orders with all informations like that: { "id": 6, "id_address_delivery": "7", "id_address_invoice": "7", "id_cart": "7", "id_currency": "1", "id_lang": "1", "id_customer": "3", "id_carrier": "2", "current_state": "2", "module": "ps_checkpayment", "invoice_number": "1", "invoice_date": "2020-04-17 12:23:24", "delivery_number": "0", "delivery_date": "0000-00-00 00:00:00", "valid": "1", "date_add": "2020-04-17 12:23:24", "date_upd": "2020-04-17 12:23:24", "shipping_number": "", "id_shop_group": "1", "id_shop": "1", "secure_key": "9dfbd1c971286da8c10955126a3ef1d6", "payment": "Czek", "recyclable": "0", "gift": "0", "gift_message": "", "mobile_theme": "0", "total_discounts": "0.000000", "total_discounts_tax_incl": "0.000000", "total_discounts_tax_excl": "0.000000", "total_paid": "1410.320000", "total_paid_tax_incl": "1410.320000", "total_paid_tax_excl": "1146.600000", "total_paid_real": "1410.320000", "total_products": "1139.600000", "total_products_wt": "1401.710000", "total_shipping": "8.610000", "total_shipping_tax_incl": "8.610000", "total_shipping_tax_excl": "7.000000", "carrier_tax_rate": "23.000", "total_wrapping": "0.000000", "total_wrapping_tax_incl": "0.000000", "total_wrapping_tax_excl": "0.000000", "round_mode": "2", "round_type": "2", "conversion_rate": "1.000000", "reference": "VPUOCMPMG", "associations": { "order_rows": [ { "id": "8", "product_id": "19", "product_attribute_id": "0", "product_quantity": "20", "product_name": "Customizable mug", "product_reference": "demo_14", "product_ean13": "", "product_isbn": "", "product_upc": "", "product_price": "13.900000", "id_customization": "0", "unit_price_tax_incl": "17.097000", "unit_price_tax_excl": "13.900000" }, { "id": "9", "product_id": "2", "product_attribute_id": "9", "product_quantity": "30", "product_name": "Hummingbird printed sweater - Rozmiar : S", "product_reference": "demo_3", "product_ean13": "", "product_isbn": "", "product_upc": "", "product_price": "35.900000", "id_customization": "0", "unit_price_tax_incl": "35.325600", "unit_price_tax_excl": "28.720000" } ] } } Check "total_shipping" for shipping cost "total_products_wt" for sum of your cart/order products cost and if you wonder how to get customer address for shipping and invoice you can get it by calling /api/adresses/{id} so in that example you have: "id_address_delivery": "7", "id_address_invoice": "7", so for delivery adderss call /api/adresses/7, same for invoice address (it's possible for them to be different) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now