User Tools

Site Tools


udropship:umarketplace:m2:split-rate-api

This is an old revision of the document!


uMarketplace Split-Rate add-on API

Introduction

Split-rate add-on customizes magento native checkout API to produce data in a bit different format to match specifics of split-rate cart functionality. The add-on gives functionality to a customer to select different shipping method per vendor. Customer cart can contain products from multiple vendors. Each group of products that belongs to a different vendor can have a separate shipping method assigned that will be later used in order fulfillment.

Estimate guest cart shipping

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.
udropship_default - indicates if this method selected by default or using previos calls to /V1/guest-carts/:cartId/shipping-information
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=-1 - special item that holds vendor information for the following results with udropship_vendor=“vendor_id of this item”
udropship_vendor⇒0 - reference id of the vendor that this shipping method belongs to
Example:

POST /rest/default/V1/guest-carts/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/estimate-shipping-methods
{"address":{"region_id":"12","region":"California","country_id":"US","postcode":"90210"}}

RESPONSE

[{
    "udropship_vendor": "0",
    "udropship_default": null,
    "vendor_id": null,
    "carrier_code": "udsplit",
    "method_code": "total",
    "carrier_title": "Drop Shipping (Split)",
    "method_title": "Total",
    "amount": 11.71,
    "base_amount": 11.71,
    "available": true,
    "error_message": "",
    "price_excl_tax": 11.71,
    "price_incl_tax": 11.71
}, {
    "udropship_vendor": "-1",
    "udropship_default": null,
    "vendor_id": "1",
    "carrier_code": null,
    "method_code": null,
    "carrier_title": "vendor1",
    "method_title": "los angeles, US CA",
    "amount": null,
    "base_amount": null,
    "available": null,
    "error_message": null,
    "price_excl_tax": null,
    "price_incl_tax": null
}, {
    "udropship_vendor": "1",
    "udropship_default": "1",
    "vendor_id": "1",
    "carrier_code": "fedex",
    "method_code": "FEDEX_GROUND",
    "carrier_title": "Federal Express",
    "method_title": "Ground",
    "amount": 0,
    "base_amount": 0,
    "available": true,
    "error_message": "",
    "price_excl_tax": 0,
    "price_incl_tax": 0
}, {
    "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
}, {
    "udropship_vendor": "1",
    "udropship_default": "0",
    "vendor_id": "1",
    "carrier_code": "fedex",
    "method_code": "PRIORITY_OVERNIGHT",
    "carrier_title": "Federal Express",
    "method_title": "Priority Overnight",
    "amount": 25.26,
    "base_amount": 25.26,
    "available": true,
    "error_message": "",
    "price_excl_tax": 25.26,
    "price_incl_tax": 25.26
}, {
    "udropship_vendor": "-1",
    "udropship_default": null,
    "vendor_id": "2",
    "carrier_code": null,
    "method_code": null,
    "carrier_title": "vendor2",
    "method_title": "rome, US GA",
    "amount": null,
    "base_amount": null,
    "available": null,
    "error_message": null,
    "price_excl_tax": null,
    "price_incl_tax": null
}, {
    "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
}, {
    "udropship_vendor": "2",
    "udropship_default": "0",
    "vendor_id": "2",
    "carrier_code": "ups",
    "method_code": "02",
    "carrier_title": "United Parcel Service",
    "method_title": "UPS Second Day Air",
    "amount": 36.3,
    "base_amount": 36.3,
    "available": true,
    "error_message": "",
    "price_excl_tax": 36.3,
    "price_incl_tax": 36.3
}]
udropship/umarketplace/m2/split-rate-api.1571866691.txt.gz · by wtsergo