<?xml version="1.0"?>
<!--
/**
 * Mageplaza
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Mageplaza.com license that is
 * available through the world-wide-web at this URL:
 * https://www.mageplaza.com/LICENSE.txt
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Mageplaza
 * @package     Mageplaza_Osc
 * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
 * @license     https://www.mageplaza.com/LICENSE.txt
 */
-->
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
    <route url="/V1/guest-carts/:cartId/update-item" method="POST">
        <service class="Mageplaza\Osc\Api\GuestCheckoutManagementInterface" method="updateItemQty"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
    <route url="/V1/carts/mine/update-item" method="POST">
        <service class="Mageplaza\Osc\Api\CheckoutManagementInterface" method="updateItemQty"/>
        <resources>
            <resource ref="self"/>
        </resources>
        <data>
            <parameter name="cartId" force="true">%cart_id%</parameter>
        </data>
    </route>
    <route url="/V1/guest-carts/:cartId/remove-item" method="POST">
        <service class="Mageplaza\Osc\Api\GuestCheckoutManagementInterface" method="removeItemById"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
    <route url="/V1/carts/mine/remove-item" method="POST">
        <service class="Mageplaza\Osc\Api\CheckoutManagementInterface" method="removeItemById"/>
        <resources>
            <resource ref="self"/>
        </resources>
        <data>
            <parameter name="cartId" force="true">%cart_id%</parameter>
        </data>
    </route>
    <route url="/V1/guest-carts/:cartId/update-gift-wrap" method="POST">
        <service class="Mageplaza\Osc\Api\GuestCheckoutManagementInterface" method="updateGiftWrap"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
    <route url="/V1/carts/mine/update-gift-wrap" method="POST">
        <service class="Mageplaza\Osc\Api\CheckoutManagementInterface" method="updateGiftWrap"/>
        <resources>
            <resource ref="self"/>
        </resources>
        <data>
            <parameter name="cartId" force="true">%cart_id%</parameter>
        </data>
    </route>
    <route url="/V1/guest-carts/:cartId/payment-total-information" method="POST">
        <service class="Mageplaza\Osc\Api\GuestCheckoutManagementInterface" method="getPaymentTotalInformation"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
    <route url="/V1/carts/mine/payment-total-information" method="POST">
        <service class="Mageplaza\Osc\Api\CheckoutManagementInterface" method="getPaymentTotalInformation"/>
        <resources>
            <resource ref="self"/>
        </resources>
        <data>
            <parameter name="cartId" force="true">%cart_id%</parameter>
        </data>
    </route>
    <route url="/V1/guest-carts/:cartId/checkout-information" method="POST">
        <service class="Mageplaza\Osc\Api\GuestCheckoutManagementInterface" method="saveCheckoutInformation"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
    <route url="/V1/carts/mine/checkout-information" method="POST">
        <service class="Mageplaza\Osc\Api\CheckoutManagementInterface" method="saveCheckoutInformation"/>
        <resources>
            <resource ref="self"/>
        </resources>
        <data>
            <parameter name="cartId" force="true">%cart_id%</parameter>
        </data>
    </route>
    <route url="/V1/guest-carts/:cartId/save-email-to-quote" method="POST">
        <service class="Mageplaza\Osc\Api\GuestCheckoutManagementInterface" method="saveEmailToQuote"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
    <route url="/V1/guest-carts/:cartId/isEmailAvailable" method="POST">
        <service class="Mageplaza\Osc\Api\GuestCheckoutManagementInterface" method="isEmailAvailable"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
    <route url="/V1/guest-carts/:cartId/discount-payment-method" method="POST">
        <service class="Mageplaza\Osc\Api\GuestCheckoutManagementInterface" method="paymentMethodDiscount"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
    <route url="/V1/carts/mine/discount-payment-method" method="POST">
        <service class="Mageplaza\Osc\Api\CheckoutManagementInterface" method="paymentMethodDiscount"/>
        <resources>
            <resource ref="self"/>
        </resources>
        <data>
            <parameter name="cartId" force="true">%cart_id%</parameter>
        </data>
    </route>
</routes>
