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
Previous revision
udropship:umarketplace:m2:split-rate-api [2019/10/23 21:48]
wtsergo
udropship:umarketplace:m2:split-rate-api [2019/10/23 22:04]
wtsergo
Line 4: Line 4:
  
 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. ​ 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. ​
 +The list of customized APIs
 +  * /​V1/​carts/​mine/​estimate-shipping-methods
 +  * /​V1/​carts/​mine/​estimate-shipping-methods-by-address-id
 +  * /​V1/​guest-carts/:​cartId/​estimate-shipping-methods
 +  * /​V1/​guest-carts/:​cartId/​shipping-information
 +  * /​V1/​carts/​mine/​shipping-information
 +  * /​V1/​carts/:​cartId/​shipping-information
 +  * /​V1/​carts/:​cartId/​totals-information
 +  * /​V1/​guest-carts/:​cartId/​totals-information
 +  * /​V1/​carts/​mine/​totals-information
 +
  
 ===== Estimate guest cart shipping ===== ===== Estimate guest cart shipping =====
Line 290: Line 301:
 } }
 </​code>​ </​code>​
 +
 +===== Save guest cart shipping information =====
 +
 +This request has a customized field **shipping_method_all**.
 +
 +''​
 +Example:
 +''​
 +<​code>​
 +POST /​rest/​default/​V1/​guest-carts/​f742mL2qWS9ksO9vyadhoLNJoA61A5GW/​shipping-information
 +{
 +    "​addressInformation":​ {
 +        "​shipping_address":​ {
 +            "​countryId":​ "​US",​
 +            "​regionId":​ "​12",​
 +            "​regionCode":​ "​CA",​
 +            "​region":​ "​California",​
 +            "​street":​ ["​test"​],​
 +            "​company":​ "",​
 +            "​telephone":​ "​911",​
 +            "​postcode":​ "​90210",​
 +            "​city":​ "Los Angeles",​
 +            "​firstname":​ "​test",​
 +            "​lastname":​ "​test"​
 +        },
 +        "​billing_address":​ {
 +            "​countryId":​ "​US",​
 +            "​regionId":​ "​12",​
 +            "​regionCode":​ "​CA",​
 +            "​region":​ "​California",​
 +            "​street":​ ["​test"​],​
 +            "​company":​ "",​
 +            "​telephone":​ "​911",​
 +            "​postcode":​ "​90210",​
 +            "​city":​ "Los Angeles",​
 +            "​firstname":​ "​test",​
 +            "​lastname":​ "​test",​
 +            "​saveInAddressBook":​ null
 +        },
 +        "​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>​
 +{
 +    "​payment_methods":​ [{"​code":​ "​checkmo",​ "​title":​ "Check \/ Money order"​}],​ "​totals":​ {
 +        "​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>​
 +
 +===== Logged in customers =====
 +
 +Logged in customers checkout requests use the same approach just different endpoints and different original format.
  
udropship/umarketplace/m2/split-rate-api.txt · Last modified: 2019/10/23 22:04 by wtsergo