User Tools

Site Tools


udropship:umarketplace:m2:split-rate-api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
udropship:umarketplace:m2:split-rate-api [2019/10/23 21:38]
wtsergo [Estimate guest cart shipping]
udropship:umarketplace:m2:split-rate-api [2019/10/23 21:48]
wtsergo
Line 9: Line 9:
 If you check results of this API call you will notice a presence of udropship_vendor, vendor_id, udropship_default fields.\\ If you check results of this API call you will notice a presence of udropship_vendor, vendor_id, udropship_default fields.\\
 **vendor_id** - reference id of the vendor that this item relates to.\\ **vendor_id** - reference id of the vendor that this item relates to.\\
-**udropship_default** - indicates if this method selected by default or using previos calls to ///V1/guest-carts/:cartId/shipping-information//\\+**udropship_default** - indicates if this method selected by default or using previos calls to ///V1/guest-carts/:cartId/shipping-information// or ///V1/guest-carts/:cartId/totals-information//\\ 
 Item needs to be treated differently depending on udropship_vendor field value:\\ Item needs to be treated differently depending on udropship_vendor field value:\\
 **udropship_vendor=0** - should be skipped. normaly it's a system carrier method that not used in per vendor shipping\\ **udropship_vendor=0** - should be skipped. normaly it's a system carrier method that not used in per vendor shipping\\
Line 140: Line 140:
 }] }]
 </code> </code>
 +
 +===== Save guest cart totals =====
 +
 +Guest cart totals information save uses customized request.\\
 +In request we add **shipping_method_all** field which holds per vendor selection of shipping methods
 +
 +''
 +Example:
 +''
 +<code>
 +POST /rest/default/V1/guest-carts/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/totals-information
 +{"addressinformation": {
 +    "address": {"countryid": "us", "region": "california", "regionid": "12", "postcode": "90210"},
 +    "shipping_method_code": "total",
 +    "shipping_carrier_code": "udsplit",
 +    "shipping_method_all": {
 +        "0": {
 +            "udropship_vendor": "0",
 +            "udropship_default": null,
 +            "vendor_id": null,
 +            "carrier_code": "udsplit",
 +            "method_code": "total",
 +            "carrier_title": "drop shipping (split)",
 +            "method_title": "total",
 +            "amount": 31.3,
 +            "base_amount": 31.3,
 +            "available": true,
 +            "error_message": "",
 +            "price_excl_tax": 31.3,
 +            "price_incl_tax": 31.3
 +        },
 +        "1": {
 +            "udropship_vendor": "1",
 +            "udropship_default": "0",
 +            "vendor_id": "1",
 +            "carrier_code": "fedex",
 +            "method_code": "fedex_2_day",
 +            "carrier_title": "federal express",
 +            "method_title": "2 day",
 +            "amount": 19.59,
 +            "base_amount": 19.59,
 +            "available": true,
 +            "error_message": "",
 +            "price_excl_tax": 19.59,
 +            "price_incl_tax": 19.59
 +        },
 +        "2": {
 +            "udropship_vendor": "2",
 +            "udropship_default": "1",
 +            "vendor_id": "2",
 +            "carrier_code": "ups",
 +            "method_code": "03",
 +            "carrier_title": "united parcel service",
 +            "method_title": "ups ground",
 +            "amount": 11.71,
 +            "base_amount": 11.71,
 +            "available": true,
 +            "error_message": "",
 +            "price_excl_tax": 11.71,
 +            "price_incl_tax": 11.71
 +        }
 +    }
 +}}
 +</code>
 +''
 +RESPONSE
 +''
 +<code>
 +{
 +    "grand_total": 133.19,
 +    "base_grand_total": 133.19,
 +    "subtotal": 101.89,
 +    "base_subtotal": 101.89,
 +    "discount_amount": 0,
 +    "base_discount_amount": 0,
 +    "subtotal_with_discount": 101.89,
 +    "base_subtotal_with_discount": 101.89,
 +    "shipping_amount": 31.3,
 +    "base_shipping_amount": 31.3,
 +    "shipping_discount_amount": 0,
 +    "base_shipping_discount_amount": 0,
 +    "tax_amount": 0,
 +    "base_tax_amount": 0,
 +    "weee_tax_applied_amount": null,
 +    "shipping_tax_amount": 0,
 +    "base_shipping_tax_amount": 0,
 +    "subtotal_incl_tax": 101.89,
 +    "base_subtotal_incl_tax": 101.89,
 +    "shipping_incl_tax": 31.3,
 +    "base_shipping_incl_tax": 31.3,
 +    "base_currency_code": "USD",
 +    "quote_currency_code": "USD",
 +    "items_qty": 2,
 +    "items": [{
 +        "item_id": 6,
 +        "price": 52.62,
 +        "base_price": 52.62,
 +        "qty": 1,
 +        "row_total": 52.62,
 +        "base_row_total": 52.62,
 +        "row_total_with_discount": 0,
 +        "tax_amount": 0,
 +        "base_tax_amount": 0,
 +        "tax_percent": 0,
 +        "discount_amount": 0,
 +        "base_discount_amount": 0,
 +        "discount_percent": 0,
 +        "price_incl_tax": 52.62,
 +        "base_price_incl_tax": 52.62,
 +        "row_total_incl_tax": 52.62,
 +        "base_row_total_incl_tax": 52.62,
 +        "options": "[{\"value\":\"vendor1\",\"label\":\"Vendor\"}]",
 +        "weee_tax_applied_amount": null,
 +        "weee_tax_applied": null,
 +        "name": "Overnight Duffle"
 +    }, {
 +        "item_id": 7,
 +        "price": 49.27,
 +        "base_price": 49.27,
 +        "qty": 1,
 +        "row_total": 49.27,
 +        "base_row_total": 49.27,
 +        "row_total_with_discount": 0,
 +        "tax_amount": 0,
 +        "base_tax_amount": 0,
 +        "tax_percent": 0,
 +        "discount_amount": 0,
 +        "base_discount_amount": 0,
 +        "discount_percent": 0,
 +        "price_incl_tax": 49.27,
 +        "base_price_incl_tax": 49.27,
 +        "row_total_incl_tax": 49.27,
 +        "base_row_total_incl_tax": 49.27,
 +        "options": "[{\"value\":\"vendor2\",\"label\":\"Vendor\"}]",
 +        "weee_tax_applied_amount": null,
 +        "weee_tax_applied": null,
 +        "name": "Push It Messenger Bag"
 +    }],
 +    "total_segments": [{"code": "subtotal", "title": "Subtotal", "value": 101.89}, {
 +        "code": "shipping",
 +        "title": "Shipping & Handling (Drop Shipping (Split) - Total)",
 +        "value": 31.3
 +    }, {
 +        "code": "tax",
 +        "title": "Tax",
 +        "value": 0,
 +        "extension_attributes": {"tax_grandtotal_details": []}
 +    }, {"code": "grand_total", "title": "Grand Total", "value": 133.19, "area": "footer"}]
 +}
 +</code>
 +
udropship/umarketplace/m2/split-rate-api.txt · by wtsergo