<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/services.xsd">
    <description>Order Services</description>
    <vendor>OFBiz</vendor>
    <version>1.0</version>

    <!-- Order processing services -->
    <service name="orderNotificationInterface" engine="interface" location="" invoke="">
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="emailType" type="String" mode="OUT" optional="false"/>
        <attribute name="screenUri" type="String" mode="IN" optional="true"/>
        <attribute name="comments" type="String" mode="IN" optional="true"/>
        <attribute name="body" type="String" mode="OUT" optional="true"/>
        <attribute name="sendTo" type="String" mode="IN" optional="true"/>
        <attribute name="sendCc" type="String" mode="IN" optional="true"/>
        <attribute name="sendBcc" type="String" mode="IN" optional="true"/>
        <attribute name="note" type="String" mode="IN" optional="true"/>
        <attribute name="temporaryAnonymousUserLogin" type="org.apache.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
        <attribute name="messageWrapper" type="org.apache.ofbiz.service.mail.MimeMessageWrapper" mode="OUT" optional="true"/>
        <attribute name="orderId" type="String" mode="OUT" optional="true"/>
        <attribute name="subject" type="String" mode="OUT" optional="true"/>
        <attribute name="communicationEventId" type="String" mode="OUT" optional="true"/>
    </service>
    <service name="sendOrderConfirmation" engine="java" require-new-transaction="true" max-retry="3"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="sendOrderConfirmNotification">
        <description>Send a order confirmation</description>
        <implements service="orderNotificationInterface"/>
    </service>
    <service name="sendOrderChangeNotification" engine="java" require-new-transaction="true" max-retry="3"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="sendOrderChangeNotification">
        <description>Send a order notification</description>
        <implements service="orderNotificationInterface"/>
    </service>
    <service name="sendOrderCompleteNotification" engine="java" require-new-transaction="true" max-retry="3"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="sendOrderCompleteNotification">
        <description>Send a order notification</description>
        <implements service="orderNotificationInterface"/>
    </service>
    <service name="sendOrderBackorderNotification" engine="java" require-new-transaction="true" max-retry="3"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="sendOrderBackorderNotification">
        <description>Send a order notification</description>
        <implements service="orderNotificationInterface"/>
    </service>
    <service name="sendOrderPayRetryNotification" engine="java" require-new-transaction="true" max-retry="3"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="sendOrderPayRetryNotification">
        <description>Send a order notification</description>
        <implements service="orderNotificationInterface"/>
    </service>

    <service name="sendPOEmail" engine="java" require-new-transaction="true" max-retry="3"
             location="org.apache.ofbiz.order.order.OrderServices" invoke="sendPOEmail">
        <description>Send Purchase Order Email</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="emailTemplateSettingId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="sendProcessNotification" engine="java" require-new-transaction="true" max-retry="3"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="sendProcessNotification">
        <description>Limit Service for order processing workflow; sends activitiy notifications</description>
        <attribute name="workEffortId" type="String" mode="IN"/>
        <attribute name="adminEmailList" type="String" mode="IN"/>
        <attribute name="assignedPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="assignedRoleTypeId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="createOrderNotificationLog" engine="entity-auto" default-entity-name="OrderNotification" invoke="create">
        <description>Logs when a notification was sent</description>
        <auto-attributes include="pk" mode="OUT" optional="false"/>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="emailType" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingEmailType"/>
            </type-validate>
        </attribute>
        <attribute name="comments" type="String" mode="IN" optional="true"/>
    </service>

    <service name="storeOrder" engine="java" validate="true" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="createOrder">
        <description>Creates order entities</description>
        <attribute name="partyId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingPartyId"/>
            </type-validate>
        </attribute>
        <attribute name="placingCustomerPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="billToCustomerPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="shipToCustomerPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="endUserCustomerPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="billFromVendorPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="shipFromVendorPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="supplierAgentPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="orderName" type="String" mode="IN" optional="true"/>
        <attribute name="visitId" type="String" mode="IN" optional="true"/>
        <attribute name="affiliateId" type="String" mode="IN" optional="true"/>
        <attribute name="productStoreId" type="String" mode="IN" optional="true"/>
        <attribute name="originFacilityId" type="String" mode="IN" optional="true"/>
        <attribute name="transactionId" type="String" mode="IN" optional="true"/>
        <attribute name="terminalId" type="String" mode="IN" optional="true"/>
        <attribute name="workEffortId" type="String" mode="IN" optional="true"/>
        <attribute name="autoOrderShoppingListId" type="String" mode="IN" optional="true"/>
        <attribute name="webSiteId" type="String" mode="IN" optional="true"/>
        <attribute name="externalId" type="String" mode="IN" optional="true"/>
        <attribute name="internalCode" type="String" mode="IN" optional="true"/>
        <attribute name="agreementId" type="String" mode="IN" optional="true"/>
        <attribute name="distributorId" type="String" mode="IN" optional="true"/>
        <attribute name="orderTypeId" type="String" mode="INOUT" optional="false"/>
        <attribute name="salesChannelEnumId" type="String" mode="IN" optional="true"/>
        <attribute name="orderItemGroups" type="List" mode="IN" optional="true"/>
        <attribute name="orderItems" type="List" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderItems"/>
            </type-validate>
        </attribute>
        <attribute name="orderTerms" type="List" mode="IN" optional="true"/>
        <!-- workeffort contains the rental start/enddate, nbr of persons. WorkEfforts is mandatory for ordertype = RENTAL_ORDER_ITEM-->
        <attribute name="workEfforts" type="List" mode="IN" optional="true"/>
        <attribute name="orderAdjustments" type="List" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderAdjustments"/>
            </type-validate>
        </attribute>
        <attribute name="billingAccountId" type="String" mode="IN" optional="true"/>
        <attribute name="shippingAmount" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="firstAttemptOrderId" type="String" mode="IN" optional="true"/>
        <attribute name="currencyUom" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingCurrencyUom"/>
            </type-validate>
        </attribute>
        <attribute name="grandTotal" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="taxAmount" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="orderDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="orderItemShipGroupInfo" type="List" mode="IN" optional="true"/>
        <attribute name="orderItemAttributes" type="List" mode="IN" optional="true"/>
        <attribute name="orderAttributes" type="List" mode="IN" optional="true"/>
        <attribute name="orderPaymentInfo" type="List" mode="IN" optional="true"/>
        <attribute name="orderContactMechs" type="List" mode="IN" optional="true"/>
        <attribute name="orderItemContactMechs" type="List" mode="IN" optional="true"/>
        <attribute name="orderItemPriceInfos" type="List" mode="IN" optional="true"/>
        <attribute name="orderProductPromoUses" type="List" mode="IN" optional="true"/>
        <attribute name="orderProductPromoCodes" type="Set" mode="IN" optional="true"/>
        <attribute name="orderItemSurveyResponses" type="List" mode="IN" optional="true"/>
        <attribute name="trackingCodeOrders" type="List" mode="IN" optional="true"/>
        <attribute name="orderAdditionalPartyRoleMap" type="Map" mode="IN" optional="true"/>
        <attribute name="orderItemAssociations" type="List" mode="IN" optional="true"/>
        <attribute name="orderInternalNotes" type="List" mode="IN" optional="true"/>
        <attribute name="orderNotes" type="List" mode="IN" optional="true"/>
        <attribute name="supplierPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="orderId" type="String" mode="INOUT" optional="true"/>
        <attribute name="originOrderId" type="String" mode="IN" optional="true"/>
        <attribute name="isRushOrder" type="String" mode="IN" optional="true"/>
        <attribute name="priority" type="String" mode="IN" optional="true"/>
        <attribute name="statusId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="callProcessOrderPayments" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="callProcessOrderPayments" auth="false">
        <attribute name="shoppingCart" type="org.apache.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShoppingCart"/>
            </type-validate>
        </attribute>
        <attribute name="manualHold" type="Boolean" mode="IN" optional="true"/>
    </service>
    <service name="createOrderFromShoppingCart" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="createOrderFromShoppingCart" auth="false">
        <attribute name="shoppingCart" type="org.apache.ofbiz.order.shoppingcart.ShoppingCart" mode="INOUT" optional="false"/>
        <attribute name="orderId" type="String" mode="OUT" optional="false"/>
    </service>
    <service name="createSimpleNonProductSalesOrder" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="createSimpleNonProductSalesOrder" auth="true">
        <attribute name="paymentMethodId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingPaymentMethodId"/>
            </type-validate>
        </attribute>
        <attribute name="productStoreId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingProductStoreId"/>
            </type-validate>
        </attribute>
        <attribute name="currency" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingCurrency"/>
            </type-validate>
        </attribute>
        <attribute name="partyId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingPartyId"/>
            </type-validate>
        </attribute>
        <attribute name="itemMap" type="Map" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingItemMap"/>
            </type-validate>
        </attribute>
        <attribute name="orderId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="createOrderItemBilling" default-entity-name="OrderItemBilling" engine="entity-auto" invoke="create">
        <description>Create a new order item billing record</description>
        <auto-attributes mode="IN" include="pk"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
    </service>

    <service name="orderAdjustmentPermissionCheck" engine="simple"
            location="component://order/minilang/order/OrderSimpleMethods.xml" invoke="orderAdjustmentPermissionCheck">
        <description>Permission service for the creation and editing of order adjustments</description>
        <implements service="permissionInterface"/>
    </service>

    <service name="createOrderAdjustment" default-entity-name="OrderAdjustment" engine="entity-auto" invoke="create">
        <description>Creates a new order adjustment record</description>
        <permission-service service-name="orderAdjustmentPermissionCheck" main-action="CREATE"/>
        <auto-attributes mode="OUT" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <override name="orderAdjustmentTypeId" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderAdjustmentTypeId"/>
            </type-validate>
        </override>
        <override name="orderId" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </override>
    </service>
    <service name="updateOrderAdjustment" default-entity-name="OrderAdjustment" engine="entity-auto" invoke="update">
        <description>Update an order adjustment record</description>
        <permission-service service-name="orderAdjustmentPermissionCheck" main-action="UPDATE"/>
        <auto-attributes mode="IN" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <override name="orderId" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </override>
    </service>
    <service name="deleteOrderAdjustment" default-entity-name="OrderAdjustment" engine="entity-auto" invoke="delete">
        <description>Delete an order adjustment record</description>
        <permission-service service-name="orderAdjustmentPermissionCheck" main-action="DELETE"/>
        <auto-attributes mode="IN" include="pk" optional="false"/>
        <attribute name="orderId" type="String" mode="IN" optional="false">  <!-- needed for resetGrandTotal seca -->
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="productPromoCodeId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="createOrderAdjustmentBilling" default-entity-name="OrderAdjustmentBilling" engine="entity-auto" invoke="create">
        <description>Create a new order adjustment billing record</description>
        <auto-attributes mode="IN" include="pk"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
    </service>

    <service name="createPaymentFromPreference" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="createPaymentFromPreference">
        <description>Creates a payment using the order payment preference</description>
        <attribute name="orderPaymentPreferenceId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderPaymentPreferenceId"/>
            </type-validate>
        </attribute>
        <attribute name="paymentFromId" type="String" mode="IN" optional="true"/>
        <attribute name="paymentRefNum" type="String" mode="IN" optional="true"/>
        <attribute name="comments" type="String" mode="IN" optional="true"/>
        <attribute name="eventDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="paymentId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="updateTrackingNumber" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="updateTrackingNumber">
        <description>Sets the tracking number on a shipment preference</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipGroupSeqId"/>
            </type-validate>
        </attribute>
        <attribute name="trackingNumber" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingTrackingNumber"/>
            </type-validate>
        </attribute>
    </service>

    <service name="resetGrandTotal" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="resetGrandTotal" require-new-transaction="false">
        <!-- NOTE: require-new-transaction is false because this service is often run as a sync action on an ECA, so generally at the same time and in a separate TX it runs into locking problems -->
        <description>Reset the grandTotal of an existing order</description>
        <attribute name="orderId" type="String" mode="IN"/>
    </service>
    <service name="setEmptyGrandTotals" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="setEmptyGrandTotals">
        <description>Find all OrderHeaders with no grandTotal and call resetGrandTotal</description>
        <attribute name="forceAll" type="Boolean" mode="IN" optional="true"/>
    </service>

    <service name="recalcShippingTotal" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="recalcOrderShipping">
        <description>Adjust the order shipping amount</description>
        <attribute name="orderId" type="String" mode="IN"/>
    </service>
    <service name="recalcTaxTotal" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="recalcOrderTax">
        <description>Adjust the order tax amount</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="changeOrderStatus" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="setOrderStatus">
        <description>Change the status of an existing order</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="statusId" type="String" mode="IN"/>
        <attribute name="setItemStatus" type="String" mode="IN" optional="true"/>
        <attribute name="oldStatusId" type="String" mode="OUT" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOldStatusId"/>
            </type-validate>
        </attribute>
        <attribute name="orderStatusId" type="String" mode="OUT" optional="true"/>
        <attribute name="orderTypeId" type="String" mode="OUT" optional="true"/>
        <attribute name="needsInventoryIssuance" type="String" mode="OUT" optional="true"/>
        <attribute name="grandTotal" type="BigDecimal" mode="OUT" optional="true"/>
        <attribute name="changeReason" type="String" mode="IN" optional="true"/>
    </service>

    <service name="changeOrderItemStatus" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="setItemStatus">
        <description>Change the status of an existing order item.  If no orderItemSeqId is specified, the status of all order items will be changed.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="fromStatusId" type="String" mode="IN" optional="true"/>
        <attribute name="statusId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingStatusId"/>
            </type-validate>
        </attribute>
        <attribute name="statusDateTime" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="changeReason" type="String" mode="IN" optional="true"/>
    </service>

    <service name="cancelOrderItem" engine="java" auth="true" transaction-timeout="3000"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="cancelOrderItem">
        <description>Cancel an Order Item Quantity</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="cancelQuantity" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="itemReasonMap" type="Map" mode="IN" string-map-prefix="irm_" optional="true"/>
        <attribute name="itemCommentMap" type="Map" mode="IN" string-map-prefix="icm_" optional="true"/>
        <attribute name="itemQtyMap" type="Map" mode="IN" string-map-prefix="iqm_" optional="true"/>
    </service>
    <service name="cancelOrderItemNoActions" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="cancelOrderItem">
        <description>Cancel an Order Item Quantity. This is equal to cancelOrderItem but no ECAs are attached to this service.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="cancelQuantity" type="BigDecimal" mode="IN" optional="true"/>
    </service>

    <service name="updateOrderItems" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="updateApprovedOrderItems" transaction-timeout="7200">
        <description>Update the quantities/prices for an existing order</description>
        <attribute name="orderId" type="String" mode="INOUT" optional="false"/>
        <attribute name="supplierPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="orderTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="calcTax" type="Boolean" mode="IN" optional="true" default-value="true"/>
        <attribute name="itemDescriptionMap" type="Map" mode="IN" string-map-prefix="idm_" optional="true"/>
        <attribute name="itemQtyMap" type="Map" mode="IN" string-map-prefix="iqm_" optional="false"/>
        <attribute name="itemPriceMap" type="Map" mode="IN" string-map-prefix="ipm_" optional="false"/>
        <attribute name="overridePriceMap" type="Map" mode="IN" string-map-prefix="opm_" optional="false"/>
        <attribute name="itemReasonMap" type="Map" mode="IN" string-map-prefix="irm_" optional="true"/>
        <attribute name="itemCommentMap" type="Map" mode="IN" string-map-prefix="icm_" optional="true"/>
        <attribute name="itemAttributesMap" type="Map" mode="IN" string-map-prefix="iam_" optional="true"/>
        <attribute name="itemShipDateMap" type="Map" mode="IN" string-map-prefix="isdm_" optional="true"/>
        <attribute name="itemDeliveryDateMap" type="Map" mode="IN" string-map-prefix="iddm_" optional="true"/>
        <attribute name="itemReserveAfterDateMap" type="Map" mode="IN" string-map-prefix="iradm_" optional="true"/>
        <attribute name="shoppingCart" type="org.apache.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
    </service>
    <service name="loadCartForUpdate" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="loadCartForUpdate">
        <description>Load an existing shopping cart</description>
        <attribute name="orderId" type="String" mode="INOUT" optional="false"/>
        <!-- <attribute name="userLogin" type="String" mode="IN" optional="false"/> -->
        <attribute name="shoppingCart" type="org.apache.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
    </service>
    <service name="saveUpdatedCartToOrder" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="saveUpdatedCartToOrder">
        <description>Update the quantities/prices for an existing order</description>
        <attribute name="orderId" type="String" mode="INOUT" optional="false"/>
        <attribute name="shoppingCart" type="org.apache.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShoppingCart"/>
            </type-validate>
        </attribute>
        <attribute name="calcTax" type="Boolean" mode="IN" optional="true" default-value="true"/>
        <attribute name="deleteItems" type="Boolean" mode="IN" optional="true" default-value="false"/>
        <attribute name="changeMap" type="Map" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingChangeMap"/>
            </type-validate>
        </attribute>
    </service>
    <service name="appendOrderItem" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="addItemToApprovedOrder">
        <description>Append an item to an existing order</description>
        <attribute name="orderId" type="String" mode="INOUT" optional="false"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipGroupSeqId"/>
            </type-validate>
        </attribute>
        <attribute name="productId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingProductId"/>
            </type-validate>
        </attribute>
        <attribute name="prodCatalogId" type="String" mode="IN" optional="true"/>
        <attribute name="basePrice" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingQuantity"/>
            </type-validate>
        </attribute>
        <attribute name="amount" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="overridePrice" type="String" mode="IN" optional="true"/>
        <attribute name="reasonEnumId" type="String" mode="IN" optional="true"/>
        <attribute name="orderItemTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="changeComments" type="String" mode="IN" optional="true"/>
        <attribute name="itemDesiredDeliveryDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="itemAttributesMap" type="Map" mode="IN" optional="true"/>
        <attribute name="calcTax" type="Boolean" mode="IN" optional="true" default-value="true"/>
        <attribute name="shoppingCart" type="org.apache.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
    </service>

    <service name="recreateOrderAdjustments" engine="simple" auth="true"
            location="component://order/minilang/order/OrderServices.xml" invoke="recreateOrderAdjustments">
        <description>Remove all existing order adjustments, recalc them and persist in OrderAdjustment.</description>
        <permission-service service-name="orderAdjustmentPermissionCheck" main-action="UPDATE"/>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
    </service>

    <service name="processOrderPayments" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="processOrderPayments">
        <description>Process payments for an order</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
    </service>

    <service name="updateOrderPaymentPreference" engine="java" auth="true" default-entity-name="OrderPaymentPreference"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="updateOrderPaymentPreference">
        <auto-attributes mode="INOUT" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <attribute name="checkOutPaymentId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="checkOrderItemStatus" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="checkItemStatus">
      <description>Check the status of all items and cancel/approve/complete the order if we can</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
    </service>

    <service name="updateOrderStatusFromReceipt" engine="simple"
            location="component://order/minilang/order/OrderSimpleMethods.xml" invoke="updateOrderStatusFromReceipt">
        <description>Updates the (purchase) order/order item status based on receipt</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="currentStatusId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="autoCancelOrderItems" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="cancelFlaggedSalesOrders">
            <description>Batch service which automatically cancels sales order and/or sales order items.
                Sales orders : These will be cancelled if the order status equals CREATED and it has been
                  either 30 days or ProductStore.daysCancelNoPay since the order was created. A value of 0 for
                  ProductStore.daysCancelNoPay means do not auto-cancel.
                Sales order items : This is only for orders on the APPROVED status. Items will be cancelled if the
                  item is flagged with an autoCancelDate and does not have a dontCancelDate and dontCancelUserLogin
                  associated with it, and it is past the autoCancelDate.</description>

        <!-- this service has no parameters IN or OUT -->
    </service>

    <service name="setAllowOrderSplit" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="allowOrderSplit">
        <description>Set the Allow Split Flag To 'Y' (true)</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipGroupSeqId"/>
            </type-validate>
        </attribute>
    </service>

    <service name="getOrderItemShipGroupEstimatedShipDate" engine="simple"
            location="component://order/minilang/order/OrderServices.xml" invoke="getOrderItemShipGroupEstimatedShipDate" auth="true">
        <description>Compute and return the OrderItemShipGroup estimated ship date based on the associated items.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipGroupSeqId"/>
            </type-validate>
        </attribute>
        <attribute name="estimatedShipDate" type="Timestamp" mode="OUT" optional="true"/>
    </service>

    <service name="addOrderRole" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="addRoleType">
        <description>Adds a RoleType to an order</description>
        <attribute name="removeOld" type="Boolean" mode="IN" optional="true"/>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="partyId" type="String" mode="IN"/>
        <attribute name="roleTypeId" type="String" mode="IN"/>
    </service>

    <service name="removeOrderRole" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="removeRoleType">
        <description>Removes a RoleType from an order</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="partyId" type="String" mode="IN"/>
        <attribute name="roleTypeId" type="String" mode="IN"/>
    </service>

    <service name="createOrderPaymentPreference" default-entity-name="OrderPaymentPreference" engine="entity-auto" invoke="create">
        <description>Creates an order payment preference</description>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <auto-attributes include="pk" mode="OUT"/>
    </service>

    <service name="createOrderNote" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="createOrderNote" auth="true">
        <description>Create a note item and associate with a order header</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="note" type="String" mode="IN" allow-html="safe"/>
        <attribute name="internalNote" type="String" mode="IN"/>
        <attribute name="noteName" type="String" mode="IN" optional="true"/>
    </service>

    <service name="updateOrderNote" engine="simple" default-entity-name="OrderHeaderNote"
            location="component://order/minilang/order/OrderServices.xml" invoke="updateOrderNote" auth="true">
        <description>Toggle Order Note and make it either Public or Private</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="noteId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingNoteId"/>
            </type-validate>
        </attribute>
        <attribute name="internalNote" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingInternalNote"/>
            </type-validate>
        </attribute>
    </service>

    <!-- Order (digital) Fulfillment Services -->
    <service name="checkDigitalItemFulfillment" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="checkDigitalItemFulfillment" auth="true">
        <description>Check an order for digital items and invoice/capture + fulfill the items</description>
        <attribute name="orderId" type="String" mode="IN"/>
    </service>
   <service name="fulfillDigitalItems" engine="java" require-new-transaction="true" transaction-timeout="300"
       location="org.apache.ofbiz.order.order.OrderServices" invoke="fulfillDigitalItems">
       <description>Order Fulfillment</description>
       <attribute name="orderId" type="String" mode="IN" optional="false">
           <type-validate>
               <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
           </type-validate>
       </attribute>
       <attribute name="orderItems" type="java.util.List" mode="IN" optional="false">
           <type-validate>
               <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderItems"/>
           </type-validate>
       </attribute>
   </service>
   <service name="itemFulfillmentInterface" engine="interface" invoke="" location="" auth="false" >
       <auto-attributes entity-name="ProductContent" include="pk" mode="IN" optional="false"/>
       <attribute name="orderItem" type="org.apache.ofbiz.entity.GenericValue" mode="IN" optional="false">
           <type-validate>
               <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderItem"/>
           </type-validate>
       </attribute>
   </service>
    <service name="invoiceServiceItems" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="invoiceServiceItems" auth="true">
        <description>Check an order for service items and invoice the items</description>
        <attribute name="orderId" type="String" mode="IN"/>
    </service>
    <!-- Order View Services -->
    <service name="getOrderedSummaryInformation" engine="groovy"
            location="component://order/src/main/groovy/org/apache/ofbiz/order/order/OrderServicesScript.groovy" invoke="getOrderedSummaryInformation">
        <description>Get Ordered Summary Information</description>
        <attribute name="partyId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingPartyId"/>
            </type-validate>
        </attribute>
        <attribute name="roleTypeId" type="String" mode="IN" optional="true"/> <!-- defaults to PLACING_CUSTOMER -->
        <attribute name="orderTypeId" type="String" mode="IN" optional="true"/> <!-- defaults to SALES_ORDER -->
        <attribute name="statusId" type="String" mode="IN" optional="true"/> <!-- defaults to ORDER_COMPLETED -->
        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="monthsToInclude" type="Integer" mode="IN" optional="true"/> <!-- if monthsToInclude specified along with fromDate/thruDate, will override fromDate/thruDate -->
        <attribute name="totalOrders" type="Long" mode="OUT" optional="false"/>
        <attribute name="totalGrandAmount" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="totalSubRemainingAmount" type="BigDecimal" mode="OUT" optional="false"/>
    </service>

    <service name="getOrderHeaderInformation" engine="java" validate="false"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="getOrderHeaderInformation">
        <description>Get basic order header information.</description>
        <auto-attributes entity-name="OrderHeader" include="pk" mode="INOUT" optional="false"/>
        <auto-attributes entity-name="OrderHeader" include="nonpk" mode="OUT" optional="true"/>
    </service>

    <service name="getOrderShippingAmount" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="getOrderShippingAmount">
        <description>Get the total shipping for an order</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="shippingAmount" type="BigDecimal" mode="OUT" optional="false"/>
    </service>
    <service name="getOrderStatus" engine="simple" location="component://order/minilang/order/OrderServices.xml"
            invoke="getOrderStatus" auth="false">
        <description>Gets the order status</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="statusId" type="String" mode="OUT" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingStatusId"/>
            </type-validate>
        </attribute>
    </service>

    <!-- Order Delivery Services -->
    <service name="createOrderDeliverySchedule" default-entity-name="OrderDeliverySchedule" engine="groovy"
            location="component://order/src/main/groovy/org/apache/ofbiz/order/order/OrderDeliveryServices.groovy" invoke="createOrderDeliverySchedule">
        <description>Creates a delivery schedule for the specified order</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="orderItemSeqId" optional="true"/>
    </service>
    <service name="updateOrderDeliverySchedule" default-entity-name="OrderDeliverySchedule" engine="groovy"
            location="component://order/src/main/groovy/org/apache/ofbiz/order/order/OrderDeliveryServices.groovy" invoke="updateOrderDeliverySchedule">
        <description>Update an existing delivery schedule for a specified purchase order</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="sendOrderDeliveryScheduleNotification" engine="groovy"
            location="component://order/src/main/groovy/org/apache/ofbiz/order/order/OrderDeliveryServices.groovy" invoke="sendOrderDeliveryScheduleNotification">
        <description>Send Order Delivery Schedule Notification</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="checkSupplierRelatedOrderPermission" engine="groovy"
            location="component://order/src/main/groovy/org/apache/ofbiz/order/order/OrderDeliveryServices.groovy" invoke="checkSupplierRelatedOrderPermissionService">
        <description>Check Supplier Related Order Permission</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="checkAction" type="String" mode="IN" optional="true"/>
        <attribute name="callingMethodName" type="String" mode="IN" optional="true"/>
        <attribute name="hasSupplierRelatedPermission" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="updateShoppingListQuantitiesFromOrder" engine="java"
            location="org.apache.ofbiz.order.shoppinglist.ShoppingListServices" invoke="updateShoppingListQuantitiesFromOrder">
            <description>Given an orderId, this service will look through all its OrderItems and for each shoppingListItemId
              and shoppingListItemSeqId, update the quantity purchased in the ShoppingListItem entity.  Used for
              tracking how many of shopping list items are purchased.  This service is mounted as a seca on storeOrder.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
    </service>

    <!-- serialization test -->
    <service name="shoppingCartRemoteTest" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="shoppingCartRemoteTest">
        <attribute name="cart" type="org.apache.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingCart"/>
            </type-validate>
        </attribute>
    </service>
    <service name="shoppingCartTest" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="shoppingCartTest">
    </service>

    <!-- OrderShipment Services -->
    <service name="createOrderShipment" engine="entity-auto" default-entity-name="OrderShipment" invoke="create" auth="true">
        <description>Create OrderShipment</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateOrderShipment" engine="entity-auto" default-entity-name="OrderShipment" invoke="update" auth="true">
        <description>Update OrderShipment</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteOrderShipment" engine="entity-auto" default-entity-name="OrderShipment" invoke="delete" auth="true">
        <description>Delete OrderShipment</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- mass order changes -->
    <service name="massOrderChangeInterface" engine="interface" location="" invoke="">
        <description>Interface for Mass Order Change Services</description>
        <attribute name="orderIdList" type="List" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderIdList"/>
            </type-validate>
        </attribute>
    </service>

    <service name="massPickOrders" engine="java" transaction-timeout="300"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="massPickOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massChangeOrderApproved" engine="java" transaction-timeout="300"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="massChangeApproved" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massProcessOrders" engine="java" transaction-timeout="300"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="massProcessOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massHoldOrders" engine="java" transaction-timeout="300"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="massHoldOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massCancelOrders" engine="java" transaction-timeout="300"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="massCancelOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massCancelRemainingPurchaseOrderItems" engine="java" transaction-timeout="300"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="massCancelRemainingPurchaseOrderItems" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massRejectOrders" engine="java" transaction-timeout="300"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="massRejectOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massQuickShipOrders" engine="java" transaction-timeout="300"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="massQuickShipOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massPrintOrders" engine="java" transaction-timeout="300"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="massPrintOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
        <attribute name="screenLocation" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingScreenLocation"/>
            </type-validate>
        </attribute>
        <attribute name="printerName" type="String" mode="IN" optional="true"/>
    </service>
    <service name="massCreateFileForOrders" engine="java" transaction-timeout="300"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="massCreateFileForOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
        <attribute name="screenLocation" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingScreenLocation"/>
            </type-validate>
        </attribute>
    </service>

    <service name="getNextOrderId" engine="groovy"
        location="component://order/src/main/groovy/org/apache/ofbiz/order/order/OrderServicesScript.groovy" invoke="getNextOrderId">
        <description>Get the Next Order ID According to Settings on the PartyAcctgPreference Entity for the given Party</description>
        <implements service="storeOrder" optional="true"/>
        <attribute name="partyId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingPartyId"/>
            </type-validate>
        </attribute>
        <attribute name="productStoreId" type="String" mode="IN" optional="true"/>
        <attribute name="orderId" type="String" mode="OUT" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
    </service>

    <service name="orderSequence_enforced" engine="simple"
        location="component://order/minilang/order/OrderServices.xml" invoke="orderSequence_enforced">
        <implements service="getNextOrderId"/>
        <attribute name="partyAcctgPreference" type="org.apache.ofbiz.entity.GenericValue" mode="IN"/>
        <override name="orderId" type="Long" mode="OUT"/>
    </service>

    <!-- OrderHeader -->
    <service name="createOrderHeader" default-entity-name="OrderHeader" engine="simple"
            location="component://order/minilang/order/OrderServices.xml" invoke="createOrderHeader" auth="true">
        <description>Create OrderHeader</description>
        <auto-attributes include="pk" mode="INOUT" optional="true"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateOrderHeader" default-entity-name="OrderHeader" engine="simple"
            location="component://order/minilang/order/OrderServices.xml" invoke="updateOrderHeader" auth="true">
        <description>Update OrderHeader</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>

    <!-- CommunicationEvents related to orders -->
    <service name="createCommunicationEventOrder" default-entity-name="CommunicationEventOrder" engine="entity-auto" invoke="create" auth="true">
        <description>Create a Communication Event Order</description>
        <required-permissions join-type="AND">
            <check-permission permission="ORDERMGR" action="_CREATE"/>
        </required-permissions>
        <auto-attributes entity-name="CommunicationEventOrder" include="pk" mode="IN"/>
    </service>
    <service name="removeCommunicationEventOrder" default-entity-name="CommunicationEventOrder" engine="entity-auto" invoke="delete" auth="true">
        <description>Remove a Communication Event Order</description>
        <required-permissions join-type="AND">
            <check-permission permission="ORDERMGR" action="_DELETE"/>
        </required-permissions>
        <auto-attributes entity-name="CommunicationEventOrder" include="pk" mode="IN"/>
    </service>
    <service name="createOrderConversation" engine="groovy" invoke="createOrderConversation" auth="true"
             location="component://order/src/main/groovy/org/apache/ofbiz/order/communications/CommunicationServices.groovy">
        <description>Create a order conversation</description>
        <implements service="createCommunicationEvent"/>
        <implements service="createCommunicationEventPurpose"/>
    </service>

    <!-- Order Shipping and Contacts -->
    <service name="createOrderItemShipGroup" default-entity-name="OrderItemShipGroup" engine="entity-auto" invoke="create" auth="true">
        <description>Creates a new OrderItemShipGroup.</description>
        <required-permissions join-type="AND">
            <check-permission permission="ORDERMGR" action="_CREATE"/>
        </required-permissions>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="INOUT" optional="true"/>
    </service>
    <service name="updateOrderItemShipGroup" default-entity-name="OrderItemShipGroup" engine="simple"
            location="component://order/minilang/order/OrderServices.xml" invoke="updateOrderItemShipGroup" auth="true">
        <description>Updates OrderItemShipGroup.  The shipmentMethod field is of the format ${shipmentMethodTypeId}@${carrierPartyId}</description>
        <auto-attributes mode="IN" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <attribute name="oldContactMechId" type="String" mode="IN" optional="true"/>
        <attribute name="shipmentMethod" type="String" mode="IN" optional="true"/>
        <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="createOrderContactMech" default-entity-name="OrderContactMech" engine="entity-auto" invoke="create" auth="true">
        <description>Create Order Contact Mech</description>
        <required-permissions join-type="AND">
            <check-permission permission="ORDERMGR" action="_CREATE"/>
        </required-permissions>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <service name="updateOrderContactMech" default-entity-name="OrderContactMech" engine="simple"
            location="component://order/minilang/order/OrderServices.xml" invoke="updateOrderContactMech" auth="true">
        <description>Update Order Contact Mech</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <attribute name="oldContactMechId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="removeOrderContactMech" default-entity-name="OrderContactMech" engine="entity-auto" invoke="delete" auth="true">
        <description>Remove Order Contact Mech</description>
        <required-permissions join-type="AND">
            <check-permission permission="ORDERMGR" action="_DELETE"/>
        </required-permissions>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- OrderTerms -->
    <service name="createOrderTerm" default-entity-name="OrderTerm" engine="entity-auto" invoke="create" auth="true">
        <description>Create an Order Term</description>
        <required-permissions join-type="AND">
            <check-permission permission="ORDERMGR" action="_CREATE"/>
        </required-permissions>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="orderItemSeqId" optional="true" default-value="_NA_"/>
    </service>
    <service name="updateOrderTerm" default-entity-name="OrderTerm" engine="entity-auto" invoke="update" auth="true">
        <description>Update an Order Term</description>
        <required-permissions join-type="AND">
            <check-permission permission="ORDERMGR" action="_UPDATE"/>
        </required-permissions>
        <auto-attributes entity-name="OrderTerm" include="pk" mode="IN" optional="false"/>
        <auto-attributes entity-name="OrderTerm" include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="removeOrderTerm" default-entity-name="OrderTerm" engine="entity-auto" invoke="delete" auth="true">
        <description>Remove an Order Term</description>
        <required-permissions join-type="AND">
            <check-permission permission="ORDERMGR" action="_DELETE"/>
        </required-permissions>
        <auto-attributes entity-name="OrderTerm" include="pk" mode="IN" optional="false"/>
    </service>

    <service name="checkCreateDropShipPurchaseOrders" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="checkCreateDropShipPurchaseOrders" auth="true">
        <description>If the order is a sales order, create purchase orders (drop shipments) for each ship group associated to a supplier</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
    </service>

    <service name="addPaymentMethodToOrder" engine="simple"
            location="component://order/minilang/order/OrderServices.xml" invoke="addPaymentMethodToOrder" auth="true">
        <description>Add Payment Method to Order.From this servicewe will call the createOrderPaymentPreference service to create OrderPaymentPreference</description>
        <attribute type="String" mode="IN" name="orderId" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute type="String" mode="IN" name="paymentMethodId" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingPaymentMethodId"/>
            </type-validate>
        </attribute>
        <attribute type="BigDecimal" mode="IN" name="maxAmount"/>
        <attribute type="String" mode="OUT" name="orderPaymentPreferenceId"/>
    </service>

    <service name="completePurchaseOrder" engine="group" auth="true">
        <description>Completes a purchase order by cancelling remaining (unreceived) item quantities and generating new product requirements
            from those quantities</description>
        <group>
            <invoke name="cancelRemainingPurchaseOrderItems" result-to-context="true"/>
            <invoke name="generateReqsFromCancelledPOItems" result-to-context="true"/>
            <invoke name="checkOrderItemStatus" result-to-context="true"/>
        </group>
    </service>

    <service name="cancelRemainingPurchaseOrderItems" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="cancelRemainingPurchaseOrderItems" auth="true">
        <description>Cancels remaining (unreceived) quantities for items of an order. Does not consider received-but-rejected quantities.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
    </service>

    <service name="generateReqsFromCancelledPOItems" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="generateReqsFromCancelledPOItems" auth="true">
        <description>Generates a product requirement for the total cancelled quantity over all order items for each product</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingFacilityId"/>
            </type-validate>
        </attribute>
    </service>

    <service name="getOrderItemInvoicedAmountAndQuantity" engine="java"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="getOrderItemInvoicedAmountAndQuantity" auth="true">
        <description>Determines the total amount invoiced for a given order item over all invoices by totalling the item
            subtotal (via OrderItemBilling), any adjustments for that item (via OrderAdjustmentBilling), and the item's
            share of any order-level adjustments (that calculated by applying the percentage of the items total that the item represents
            to the order-level adjustments total (also via OrderAdjustmentBilling). Also returns the quantity invoiced for the item over
            all invoices, to aid in prorating.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderItemSeqId"/>
            </type-validate>
        </attribute>
        <attribute name="invoicedAmount" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="invoicedQuantity" type="BigDecimal" mode="OUT" optional="false"/>
    </service>

    <!-- order lookup services -->
    <service name="findOrders" engine="java" transaction-timeout="300" auth="true"
            location="org.apache.ofbiz.order.order.OrderLookupServices" invoke="findOrders">
        <description>Uses dynamic view entity to find orders; returns a list of Order (OrderHeader) objects</description>
        <!-- order header fields -->
        <attribute name="orderId" type="String" mode="IN" optional="true"/>
        <attribute name="orderName" type="String" mode="IN" optional="true"/>
        <attribute name="orderTypeId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="orderStatusId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="productStoreId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="orderWebSiteId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="salesChannelEnumId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="createdBy" type="String" mode="IN" optional="true"/>
        <attribute name="terminalId" type="String" mode="IN" optional="true"/>
        <attribute name="transactionId" type="String" mode="IN" optional="true"/>
        <attribute name="externalId" type="String" mode="IN" optional="true"/>
        <attribute name="internalCode" type="String" mode="IN" optional="true"/>
        <attribute name="useEntryDate" type="String" mode="IN" optional="true"/> <!-- Y/N use entryDate instead of orderDate -->
        <attribute name="minDate" type="String" mode="IN" optional="true"/> <!-- converted to Timestamp -->
        <attribute name="maxDate" type="String" mode="IN" optional="true"/> <!-- converted to Timestamp -->
        <attribute name="hasBackOrders" type="String" mode="IN" optional="true"/> <!-- Y to only show orders with items on backorder -->

        <!-- order role fields -->
        <attribute name="userLoginId" type="String" mode="IN" optional="true"/>
        <attribute name="roleTypeId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="partyId" type="String" mode="IN" optional="true"/>

        <!-- order item fields -->
        <attribute name="correspondingPoId" type="String" mode="IN" optional="true"/>
        <attribute name="subscriptionId" type="String" mode="IN" optional="true"/>
        <attribute name="productId" type="String" mode="IN" optional="true"/>
        <attribute name="budgetId" type="String" mode="IN" optional="true"/>
        <attribute name="quoteId" type="String" mode="IN" optional="true"/>

        <!-- Product identification -->
        <attribute name="goodIdentificationTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="goodIdentificationIdValue" type="String" mode="IN" optional="true"/>

        <attribute name="billingAccountId" type="String" mode="IN" optional="true"/>
        <attribute name="finAccountId" type="String" mode="IN" optional="true"/>
        <attribute name="cardNumber" type="String" mode="IN" optional="true"/>
        <attribute name="accountNumber" type="String" mode="IN" optional="true"/>
        <attribute name="paymentStatusId" type="String" mode="IN" optional="true"/>

        <!-- shipment/inventory fields -->
        <attribute name="inventoryItemId" type="String" mode="IN" optional="true"/>
        <attribute name="softIdentifier" type="String" mode="IN" optional="true"/>
        <attribute name="serialNumber" type="String" mode="IN" optional="true"/>
        <attribute name="shipmentId" type="String" mode="IN" optional="true"/>

        <!-- inventory problem fields -->
        <attribute name="filterInventoryProblems" type="String" mode="IN" optional="true"/>
        <attribute name="filterPOsWithRejectedItems" type="String" mode="IN" optional="true"/>
        <attribute name="filterPOsOpenPastTheirETA" type="String" mode="IN" optional="true"/>
        <attribute name="filterPartiallyReceivedPOs" type="String" mode="IN" optional="true"/>

        <attribute name="isViewed" type="String" mode="IN" optional="true"/> <!-- show orders with viewed Y/N -->
        <attribute name="shipmentMethod" type="String" mode="IN" optional="true"/>
        <attribute name="gatewayAvsResult" type="String" mode="IN" optional="true"/>
        <attribute name="gatewayScoreResult" type="String" mode="IN" optional="true"/>

        <!-- ship to country fields -->
        <attribute name="countryGeoId" type="String" mode="IN" optional="true"/>
        <attribute name="includeCountry" type="String" mode="IN" optional="true"/>

        <!-- view and page fields -->
        <attribute name="viewIndex" type="Integer" mode="INOUT" optional="true"/>
        <attribute name="viewSize" type="Integer" mode="INOUT" optional="true"/>
        <attribute name="showAll" type="String" mode="INOUT" optional="true"/>

        <!-- index fields -->
        <attribute name="highIndex" type="Integer" mode="OUT" optional="false"/>
        <attribute name="lowIndex" type="Integer" mode="OUT" optional="false"/>

        <!-- inventory problem results -->
        <attribute name="filterInventoryProblemsList" type="List" mode="OUT" optional="true"/>
        <attribute name="filterPOsWithRejectedItemsList" type="List" mode="OUT" optional="true"/>
        <attribute name="filterPOsOpenPastTheirETAList" type="List" mode="OUT" optional="true"/>
        <attribute name="filterPartiallyReceivedPOsList" type="List" mode="OUT" optional="true"/>

        <!-- actual results -->
        <attribute name="paramList" type="String" mode="OUT" optional="false"/>
        <attribute name="orderList" type="List" mode="OUT" optional="false"/>
        <attribute name="orderListSize" type="Integer" mode="OUT" optional="false"/>
    </service>

    <service name="checkOrderIsOnBackOrder" engine="simple" auth="false"
            location="component://order/minilang/order/OrderServices.xml" invoke="checkOrderIsOnBackOrder">
        <description>Check if an Order is on Back Order</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="isBackOrder" type="Boolean" mode="OUT" optional="false"/>
    </service>

    <service name="createTestSalesOrders" engine="java" auth="true" transaction-timeout="300"
            location="org.apache.ofbiz.order.test.OrderTestServices" invoke="createTestSalesOrders">
        <description>Bulk create test sales orders. Note that default-values depend on demo data in ecommerce/data.</description>
        <attribute name="productCategoryId" type="String" mode="IN" optional="true" default-value="100"/>
        <attribute name="productStoreId" type="String" mode="IN" optional="true" default-value="9000"/>
        <attribute name="currencyUomId" type="String" mode="IN" optional="true" default-value="USD"/>
        <attribute name="partyId" type="String" mode="IN" optional="true" default-value="DemoCustomer"/>
        <attribute name="numberOfOrders" type="Integer" mode="IN" optional="true" default-value="10"/>
        <attribute name="shipOrder" type="Boolean" mode="IN" optional="true" default-value="false"/>
        <attribute name="numberOfProductsPerOrder" type="Integer" mode="IN" optional="true" default-value="5"/>
        <attribute name="salesChannel" type="String" mode="IN" optional="true"/>
    </service>
    <!-- add require-new-transaction="true" to the following service to fix the lock wait timeout problem, or leave it off to cause that problem -->
    <service name="createTestSalesOrderSingle" engine="java" auth="true" transaction-timeout="300"
        location="org.apache.ofbiz.order.test.OrderTestServices" invoke="createTestSalesOrderSingle">
        <description>Bulk create test sales orders. Note that default-values depend on demo data in ecommerce/data.</description>
        <attribute name="productCategoryId" type="String" mode="IN" optional="true" default-value="100"/>
        <attribute name="productId" type="String" mode="IN" optional="true"/>
        <attribute name="productStoreId" type="String" mode="IN" optional="true" default-value="9000"/>
        <attribute name="currencyUomId" type="String" mode="IN" optional="true" default-value="USD"/>
        <attribute name="partyId" type="String" mode="IN" optional="true" default-value="DemoCustomer"/>
        <attribute name="numberOfProductsPerOrder" type="Integer" mode="IN" optional="true" default-value="5"/>
        <attribute name="salesChannel" type="String" mode="IN" optional="true"/>
        <attribute name="shipOrder" type="Boolean" mode="IN" optional="true" default-value="false"/>
        <attribute name="orderId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="changeOrderPaymentStatus" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="setOrderPaymentStatus">
        <description>Change the payment status of an existing order</description>
        <attribute name="orderPaymentPreferenceId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderPaymentPreferenceId"/>
            </type-validate>
        </attribute>
        <attribute name="changeReason" type="String" mode="IN" optional="true"/>
    </service>

    <service name="createOrderItemChange" engine="simple" auth="true" default-entity-name="OrderItemChange"
            location="component://order/minilang/order/OrderServices.xml" invoke="createOrderItemChange">
        <description>Creates a new OrderItemChange record</description>
        <auto-attributes mode="OUT" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <override name="orderId" optional="false"/>
        <override name="orderItemSeqId" optional="false"/>
        <override name="changeTypeEnumId" optional="false"/>
    </service>
    <service name="runSubscriptionAutoReorders" engine="java" auth="true" use-transaction="false"
        location="org.apache.ofbiz.order.order.OrderServices" invoke="runSubscriptionAutoReorders">
        <description>A service designed to be automatically run by job scheduler to create orders from subscriptions which need to be extended.
            This is done by looking for all subscriptions which are active and where the automaticExtend flag is set to "Y"</description>
    </service>

    <service name="createUpdateShippingAddress" engine="simple"
            location="component://order/minilang/order/OrderServices.xml" invoke="createUpdateShippingAddress" auth="true">
        <description>Creates new shipping address and update existing address</description>
        <attribute name="productStoreId" mode="IN" type="String" optional="true"/>
        <attribute name="setDefaultShipping" mode="IN" type="String" optional="true"/>
        <attribute name="keepAddressBook" mode="IN" type="String" optional="true"/>
        <attribute name="partyId" mode="IN" type="String" optional="true"/>
        <attribute name="userLogin" mode="IN" type="org.apache.ofbiz.entity.GenericValue" optional="true"/>
        <attribute name="shipToAttnName" mode="IN" type="String" optional="true"/>
        <attribute name="shipToName" mode="IN" type="String" optional="true"/>
        <attribute name="shipToAddress1" mode="IN" type="String" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipToAddress1"/>
            </type-validate>
        </attribute>
        <attribute name="shipToAddress2" mode="IN" type="String" optional="true"/>
        <attribute name="shipToCity" mode="IN" type="String" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipToCity"/>
            </type-validate>
        </attribute>
        <attribute name="shipToStateProvinceGeoId" mode="IN" type="String" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipToStateProvinceGeoId"/>
            </type-validate>
        </attribute>
        <attribute name="shipToPostalCode" mode="IN" type="String" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipToPostalCode"/>
            </type-validate>
        </attribute>
        <attribute name="shipToCountryGeoId" mode="IN" type="String" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipToCountryGeoId"/>
            </type-validate>
        </attribute>
        <attribute name="shipToContactMechId" mode="IN" type="String" optional="true"/>
        <attribute name="contactMechId" mode="OUT" type="String" optional="false"/>
        <attribute name="billToContactMechId" mode="IN" type="String" optional="true"/>
    </service>

    <service name="createUpdateBillingAddress" engine="simple"
            location="component://order/minilang/order/OrderServices.xml" invoke="createUpdateBillingAddress" auth="true">
        <description>Creates new billing address and update existing address</description>
        <attribute name="productStoreId" mode="IN" type="String" optional="true"/>
        <attribute name="setDefaultBilling" mode="IN" type="String" optional="true"/>
        <attribute name="keepAddressBook" mode="IN" type="String" optional="true"/>
        <attribute name="useShippingAddressForBilling" mode="IN" type="String" optional="true"/>
        <attribute name="partyId" mode="IN" type="String" optional="true"/>
        <attribute name="userLogin" mode="IN" type="org.apache.ofbiz.entity.GenericValue" optional="true"/>
        <attribute name="billToAttnName" mode="IN" type="String" optional="true"/>
        <attribute name="billToName" mode="IN" type="String" optional="true"/>
        <attribute name="billToAddress1" mode="IN" type="String" optional="true"/>
        <attribute name="billToAddress2" mode="IN" type="String" optional="true"/>
        <attribute name="billToCity" mode="IN" type="String" optional="true"/>
        <attribute name="billToStateProvinceGeoId" mode="IN" type="String" optional="true"/>
        <attribute name="billToPostalCode" mode="IN" type="String" optional="true"/>
        <attribute name="billToCountryGeoId" mode="IN" type="String" optional="true"/>
        <attribute name="shipToContactMechId" mode="IN" type="String" optional="true"/>
        <attribute name="billToContactMechId" mode="IN" type="String" optional="true"/>
        <attribute name="contactMechId" mode="OUT" type="String" optional="false"/>
    </service>

    <service name="createUpdateCreditCard" engine="simple" auth="true" default-entity-name="CreditCard"
            location="component://order/minilang/order/OrderServices.xml" invoke="createUpdateCreditCard">
        <description>Create/Update credit card</description>
        <attribute name="expMonth" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingExpMonth"/>
            </type-validate>
        </attribute>
        <attribute name="expYear" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingExpYear"/>
            </type-validate>
        </attribute>
        <attribute name="cardType" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingCardType"/>
            </type-validate>
        </attribute>
        <attribute name="cardNumber" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingCardNumber"/>
            </type-validate>
        </attribute>
        <attribute name="partyId" type="String" mode="IN" optional="true"/>
        <attribute name="companyNameOnCard" type="String" mode="IN" optional="true"/>
        <attribute name="titleOnCard" type="String" mode="IN" optional="true"/>
        <attribute name="firstNameOnCard" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingFirstNameOnCard"/>
            </type-validate>
        </attribute>
        <attribute name="middleNameOnCard" type="String" mode="IN" optional="true"/>
        <attribute name="lastNameOnCard" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingLastNameOnCard"/>
            </type-validate>
        </attribute>
        <attribute name="suffixOnCard" type="String" mode="IN" optional="true"/>
        <attribute name="contactMechId" type="String" mode="IN" optional="true"/>
        <attribute name="paymentMethodId" type="String" mode="IN" optional="true"/>
        <attribute name="paymentMethodId" type="String" mode="OUT" optional="false"/>
    </service>

   <service name="setUnitPriceAsLastPrice" engine="simple"
            location="component://order/minilang/order/OrderServices.xml" invoke="setUnitPriceAsLastPrice" auth="false">
        <description>Sets unit price as last price for product</description>
        <attribute name="supplierPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="orderTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="orderId" type="String" mode="IN" optional="true"/>
        <attribute name="orderItems" type="List" mode="IN" optional="true"/>
        <attribute name="facilityId" type="String" mode="IN" optional="true"/>
        <attribute name="productId" type="String" mode="IN" optional="true"/>
        <attribute name="unitCost" mode="IN" type="String" optional="true"/>
        <attribute name="itemPriceMap" type="Map" mode="IN" string-map-prefix="ipm_" optional="true"/>
        <attribute name="overridePriceMap" type="Map" mode="IN" string-map-prefix="opm_" optional="true"/>
        <attribute name="orderCurrencyUnitPrice" type="String" mode="IN" optional="true"/>
   </service>

    <service name="cancelAllBackOrders" engine="simple"
            location="component://order/minilang/order/OrderServices.xml" invoke="cancelAllBackOrders" auth="true">
        <description>Cancels those back orders from suppliers whose cancel back order date (cancelBackOrderDate) has passed the current date</description>
    </service>

    <service name="updateShippingMethodAndCharges" engine="simple" 
            location="component://order/minilang/order/OrderServices.xml" invoke="updateShippingMethodAndCharges">
        <description>Compare order's shipping amount and new shipping amount(based on weight and dimension of packages).If new shipping amount is more then or less than default percentage (defined in shipment.properties) of Order's shipping amount, then shipping method and shipping charges are updated. And if new shipping amount is not more then or less than default percentage (defined in shipment.properties)% of Order's shipping amount then only shipping method is updated.Also updates record in ShipmentRouteSegment entity</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipGroupSeqId"/>
            </type-validate>
        </attribute>
        <attribute name="oldContactMechId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOldContactMechId"/>
            </type-validate>
        </attribute>
        <attribute name="shipmentMethodAndAmount" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipmentMethodAndAmount"/>
            </type-validate>
        </attribute>
        <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingContactMechPurposeTypeId"/>
            </type-validate>
        </attribute>
        <attribute name="orderAdjustmentId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderAdjustmentId"/>
            </type-validate>
        </attribute>
        <attribute name="shippingAmount" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShippingAmount"/>
            </type-validate>
        </attribute>
        <attribute name="shipmentId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipmentId"/>
            </type-validate>
        </attribute>
        <attribute name="shipmentRouteSegmentId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipmentRouteSegmentId"/>
            </type-validate>
        </attribute>
    </service>

    <service name="setShippingInstructions" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="setShippingInstructions">
        <description>Set the shipping instructions for an order</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipGroupSeqId"/>
            </type-validate>
        </attribute>
        <attribute name="shippingInstructions" type="String" mode="IN" optional="true"/>
    </service>
    <service name="setGiftMessage" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="setGiftMessage">
        <description>Set Gift message for an order</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingShipGroupSeqId"/>
            </type-validate>
        </attribute>
        <attribute name="giftMessage" type="String" mode="IN" optional="true"/>
    </service>
    <service name="createAlsoBoughtProductAssocs" engine="java" auth="true" 
            location="org.apache.ofbiz.order.order.OrderServices" invoke="createAlsoBoughtProductAssocs">
        <description>
            Cycles through all newly created sales orders and creates ProductAssoc records (of type ALSO_BOUGHT) for products 
            that were purchased together.  If a ProductAssoc record already exists then the quantity field is incremented by one.
            Newly created orders are determined by looking for orders that were created after the JobSandbox.startDateTime of the
            previous async execution of this service, alternatively the service can be supplied with a orderEntryFromDateTime 
            parameter which will process all orders placed after that date/time or as a final option processAllOrders can be set
            to true to force a calculation of all orders ever placed with orderEntryFromDateTime being ignored.
        </description>
        <attribute name="orderEntryFromDateTime" mode="IN" type="Timestamp" optional="true"/>
        <attribute name="processAllOrders" mode="IN" type="Boolean" optional="true"/>
    </service>
    <service name="createAlsoBoughtProductAssocsForOrder" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="createAlsoBoughtProductAssocsForOrder">
        <description>
            Creates ProductAssoc records (of type ALSO_BOUGHT) for products that were purchased together in the Order.  If a ProductAssoc record already exists then the quantity field is incremented by one.  If a variant product has
            been ordered then the association is made to its parent product.
        </description>
        <attribute name="orderId" mode="IN" type="String" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingOrderId"/>
            </type-validate>
        </attribute>
    </service>
    <service name="productAvailabalityByFacility" engine="simple" location="component://order/minilang/order/OrderServices.xml"
            invoke="productAvailabalityByFacility" auth="true">
        <description>
            Calculate ATP and QOH According For each facility
        </description>
        <attribute name="productId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingProductId"/>
            </type-validate>
        </attribute>
        <attribute name="ownerPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="availabalityList" type="List" mode="OUT"/>
    </service>
    
    <service name="addOrderItemShipGroup" engine="java" auth="true" default-entity-name="OrderItemShipGroup"
             location="org.apache.ofbiz.order.order.OrderServices" invoke="addOrderItemShipGroup">
        <description>Creates a new OrderItemShipGroup with maySplit and isGift filled.</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="shipGroupSeqId" mode="INOUT" optional="true"/>
    </service>
    <service name="deleteOrderItemShipGroup" engine="java" auth="true" default-entity-name="OrderItemShipGroup"
             location="org.apache.ofbiz.order.order.OrderServices"
             invoke="deleteOrderItemShipGroup">
        <description>delete Order Item Ship Group </description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <service name="addOrderItemShipGroupAssoc" engine="java" auth="true" default-entity-name="OrderItemShipGroupAssoc"
             location="org.apache.ofbiz.order.order.OrderServices"
             invoke="addOrderItemShipGroupAssoc">
        <description>add Order Item Ship Group Assoc and if order item ship group not exit, create it before</description>
        <implements service="addOrderItemShipGroup" optional="true"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateOrderItemShipGroupAssoc" engine="java" auth="true" default-entity-name="OrderItemShipGroupAssoc"
             location="org.apache.ofbiz.order.order.OrderServices"
             invoke="updateOrderItemShipGroupAssoc">
        <description>update OrderItem from OISG, totalQuantity is used only if controller is a multi services </description>
        <auto-attributes include="all" mode="IN" optional="true"/>
        <attribute name="totalQuantity" type="BigDecimal"  mode="INOUT"  optional="true"/>
        <attribute name="rowCount" type="Integer" mode="IN" optional="true"/>
        <attribute name="rowNumber" type="Integer" mode="INOUT" optional="true"/>
    </service>
    <service name="deleteOrderItemShipGroupAssoc" engine="entity-auto" auth="true" default-entity-name="OrderItemShipGroupAssoc" invoke="delete">
        <description>delete Order Item Ship Group Assoc</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- Use for link the payment and the invoice When Received Payment -->
    <service name="createOrderPaymentApplication" engine="simple" auth="true"
            location="component://order/minilang/order/OrderServices.xml" invoke="createOrderPaymentApplication">
        <description>Create Order Payment Application</description>
        <attribute name="paymentId" type="String" mode="IN" optional="false"/>
    </service>
    
    <service name="createTestOrderRentalProduct" engine="simple" auth="true"
        location="component://order/minilang/test/ShoppingCartTests.xml" invoke="testCreateOrderRentalProduct">
        <description>Create Test Order Rental of an asset which is shipped from and returned to inventory</description>
    </service>
    
    <service name="testCreateShoppinCartAndOrder" engine="simple" auth="true"
        location="component://order/minilang/test/ShoppingCartTests.xml" invoke="testCreateShoppinCartAndOrder">
        <description>Create an order using a shopping cart - only used internally in ShoppingCartTests.xml for test purpose</description>
        <attribute name="orderMap" type="Map" mode="OUT"/>
    </service>
    
    <!-- Order Item Attribute -->
    <service name="createOrderItemAttribute" engine="entity-auto" default-entity-name="OrderItemAttribute" invoke="create" auth="true">
        <description>Create Order Item Attribute</description>
        <auto-attributes mode="IN" entity-name="OrderItemAttribute" include="pk" optional="false"/>
        <auto-attributes mode="IN" entity-name="OrderItemAttribute" include="nonpk" optional="true"/>
    </service>
    <service name="updateOrderItemAttribute" engine="entity-auto" default-entity-name="OrderItemAttribute" invoke="update" auth="true">
        <description>Update Order Item Attribute</description>
        <auto-attributes mode="IN" entity-name="OrderItemAttribute" include="pk" optional="false"/>
        <auto-attributes mode="IN" entity-name="OrderItemAttribute" include="nonpk" optional="true"/>
    </service>
    <service name="deleteOrderItemAttribute" engine="entity-auto" default-entity-name="OrderItemAttribute" invoke="delete" auth="true">
        <description>Delete Order Item Attribute</description>
        <auto-attributes mode="IN" entity-name="OrderItemAttribute" include="pk" optional="false"/>
    </service>
    
    <!-- Order Item Group Order -->
    <service name="createOrderItemGroupOrder" engine="entity-auto" default-entity-name="OrderItemGroupOrder" invoke="create" auth="true">
        <description>Create Order Item Group Order</description>
        <auto-attributes mode="IN" entity-name="OrderItemGroupOrder" include="pk" optional="false"/>
    </service>
    
    <service name="countProductQuantityOrdered" engine="java"
        location="org.apache.ofbiz.order.order.OrderServices" invoke="countProductQuantityOrdered" auth="true">
        <description>count Product Quantity Ordered</description>
        <attribute name="productId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingProductId"/>
            </type-validate>
        </attribute>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingQuantity"/>
            </type-validate>
        </attribute>
    </service>
    
    <service name="moveItemBetweenShipGroups" engine="simple"
        location="component://order/minilang/order/OrderServices.xml" invoke="moveItemBetweenShipGroups">
        <description>Move order items between ship groups</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="orderItemSeqId" type="String" mode="IN"/>
        <attribute name="fromGroupIndex" type="String" mode="IN"/>
        <attribute name="toGroupIndex" type="String" mode="IN"/>
        <attribute name="quantity" type="BigDecimal" mode="IN"/>
    </service>
    
    <service name="updateShipGroupShipInfo" engine="java" location="org.apache.ofbiz.order.order.OrderServices" invoke="updateShipGroupShipInfo" auth="true">
            <description>Update Shipping Information on Order View</description>
         <attribute name="contactMechId" type="String" mode="IN" optional="false">
             <type-validate>
                 <fail-property resource="OrderErrorUiLabels" property="OrderRequiredFieldMissingContactMechId"/>
             </type-validate>
         </attribute>
         <attribute name="orderId" type="String" mode="IN" optional="true"/>
         <attribute name="oldContactMechId" type="String" mode="IN" optional="true"/>
         <attribute name="shipGroupSeqId" type="String" mode="IN" optional="true"/>
         <attribute name="shipmentMethod" type="String" mode="IN" optional="true"/>
    </service>

    <!-- OrderContent services -->
    <service name="createOrderContent" default-entity-name="OrderContent" engine="entity-auto" invoke="create" auth="true">
        <description>Create a OrderContent</description>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <auto-attributes include="pk" mode="INOUT" optional="false"/>
    </service>
    <service name="expireOrderContent" default-entity-name="OrderContent" engine="entity-auto" invoke="expire" auth="true">
         <description>Expire a OrderContent</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <service name="createOrderAdjustmentTypeAttr" default-entity-name="OrderAdjustmentTypeAttr" engine="entity-auto" invoke="create" auth="true">
        <description>Create a OrderAdjustmentTypeAttr</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateOrderAdjustmentTypeAttr" default-entity-name="OrderAdjustmentTypeAttr" engine="entity-auto" invoke="update" auth="true">
        <description>Update a OrderAdjustmentTypeAttr</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteOrderAdjustmentTypeAttr" default-entity-name="OrderAdjustmentTypeAttr" engine="entity-auto" invoke="delete" auth="true">
        <description>Delete a OrderAdjustmentTypeAttr</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- ProductOrderItem services -->
    <service name="createProductOrderItem" default-entity-name="ProductOrderItem" engine="entity-auto" invoke="create" auth="true">
        <description>Create a ProductOrderItem</description>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <auto-attributes include="pk" mode="INOUT" optional="false"/>
    </service>
    <service name="updateProductOrderItem" default-entity-name="ProductOrderItem" engine="entity-auto" invoke="update" auth="true">
        <description>Update a ProductOrderItem</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteProductOrderItem" default-entity-name="ProductOrderItem" engine="entity-auto" invoke="delete" auth="true">
        <description>Delete a ProductOrderItem</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- Allocation Plan services -->
    <service name="createAllocationPlanHeader" engine="entity-auto" default-entity-name="AllocationPlanHeader" invoke="create" auth="true">
        <description>Create Allocation Plan Header</description>
        <auto-attributes include="pk" mode="IN"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="planId" mode="INOUT"/>
        <override name="planTypeId" optional="false"/>
    </service>
    <service name="updateAllocationPlanHeader" engine="entity-auto" default-entity-name="AllocationPlanHeader" invoke="update" auth="true">
        <description>Update Allocation Plan Header</description>
        <auto-attributes include="pk" mode="IN"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteAllocationPlanHeader" engine="entity-auto" default-entity-name="AllocationPlanHeader" invoke="delete" auth="true">
        <description>Delete Allocation Plan Header</description>
        <auto-attributes include="pk" mode="IN"/>
    </service>
    <service name="createAllocationPlanItem" engine="entity-auto" default-entity-name="AllocationPlanItem" invoke="create" auth="true">
        <description>Create Allocation Plan Item</description>
        <auto-attributes include="pk" mode="IN"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="planItemSeqId" mode="OUT"/>
        <override name="planMethodEnumId" optional="false"/>
        <override name="productId" optional="false"/>
        <override name="orderId" optional="false"/>
        <override name="orderItemSeqId" optional="false"/>
    </service>
    <service name="updateAllocationPlanItem" engine="entity-auto" default-entity-name="AllocationPlanItem" invoke="update" auth="true">
        <description>Update Allocation Plan Item</description>
        <auto-attributes include="pk" mode="INOUT"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteAllocationPlanItem" engine="entity-auto" default-entity-name="AllocationPlanItem" invoke="delete" auth="true">
        <description>Delete Allocation Plan Item</description>
        <auto-attributes include="pk" mode="IN"/>
    </service>
    <service name="associateOrderWithAllocationPlans" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="associateOrderWithAllocationPlans">
        <description>Associate order with the allocation plans of inline products</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="productPlanMap" mode="OUT" type="Map" optional="true"/>
    </service>
    <service name="approveAllocationPlanItems" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="approveAllocationPlanItems">
        <description>Mark all the items of an allocation plan as approve</description>
        <attribute name="planId" type="String" mode="IN"/>
    </service>
    <service name="cancelAllocationPlanItems" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="cancelAllocationPlanItems">
        <description>Mark all the items of an allocation plan as cancel</description>
        <attribute name="planId" type="String" mode="IN"/>
    </service>
    <service name="changeAllocationPlanStatus" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="changeAllocationPlanStatus">
        <description>Change Allocation Plan Status</description>
        <attribute name="planId" type="String" mode="INOUT"/>
        <attribute name="statusId" type="String" mode="IN"/>
        <attribute name="oldStatusId" type="String" mode="OUT"/>
    </service>
    <service name="changeAllocationPlanItemStatus" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="changeAllocationPlanItemStatus">
        <description>Change Allocation Plan Item Status</description>
        <attribute name="planId" type="String" mode="IN"/>
        <attribute name="planItemSeqId" type="String" mode="IN"/>
        <attribute name="statusId" type="String" mode="IN"/>
        <attribute name="oldStatusId" type="String" mode="OUT"/>
    </service>
    <service name="completeAllocationPlanItemByOrderItem" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="completeAllocationPlanItemByOrderItem">
        <description>Complete Allocation Plan Item By Providing Order Id and Item Seq Id</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
    </service>
    <service name="cancelAllocationPlanItemByOrderItem" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="cancelAllocationPlanItemByOrderItem">
        <description>Cancel Allocation Plan Item By Providing Order Id and Item Seq Id</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
    </service>
    <service name="updateAllocatedQuantityOnOrderItemChange" engine="java" auth="true"
            location="org.apache.ofbiz.order.order.OrderServices" invoke="updateAllocatedQuantityOnOrderItemChange">
        <description>Update Allocated Quantity On Order Item Change</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
    </service>
    <service name="createAllocationPlanAndItems" engine="java" auth="true"
             location="org.apache.ofbiz.order.order.OrderServices" invoke="createAllocationPlanAndItems">
        <description>Create Allocation Plan And Items</description>
        <attribute name="productId" type="String" mode="IN"/>
        <attribute name="planName" type="String" mode="IN" optional="true"/>
        <attribute name="itemListSize" type="Integer" mode="IN"/>
        <attribute name="itemOrderIdMap" type="Map" mode="IN" string-map-prefix="ioim_"/>
        <attribute name="itemOrderItemSeqIdMap" type="Map" mode="IN" string-map-prefix="ioisim_"/>
        <attribute name="itemAllocatedQuantityMap" type="Map" mode="IN" string-map-prefix="iaqm_"/>
        <attribute name="planId" type="String" mode="OUT"/>
    </service>

    <service name="isInventoryAllocationRequired" engine="java" auth="true"
             location="org.apache.ofbiz.order.order.OrderServices" invoke="isInventoryAllocationRequired">
        <description>Check whether the inventory allocation is enabled or not at product store.</description>
        <attribute name="serviceContext" type="Map" mode="IN"/>
        <attribute name="serviceName" type="String" mode="IN"/>
        <attribute name="conditionReply" type="Boolean" mode="OUT"/>
    </service>

    <service name="updateAllocationPlanItems" engine="java" auth="true"
             location="org.apache.ofbiz.order.order.OrderServices" invoke="updateAllocationPlanItems">
        <description>Update Allocation Plan Items</description>
        <attribute name="planId" type="String" mode="IN"/>
        <attribute name="orderIdMap" type="Map" mode="IN" string-map-prefix="oim_"/>
        <attribute name="orderItemSeqIdMap" type="Map" mode="IN" string-map-prefix="oisim_"/>
        <attribute name="productIdMap" type="Map" mode="IN" string-map-prefix="pim_"/>
        <attribute name="prioritySeqIdMap" type="Map" mode="IN" string-map-prefix="psim_"/>
        <attribute name="allocatedQuantityMap" type="Map" mode="IN" string-map-prefix="aqm_"/>
        <attribute name="rowSubmitMap" type="Map" mode="IN" string-map-prefix="rsm_"/>
    </service>

    <service name="uploadOrderContentFile" engine="group" transaction-timeout="300">
        <description>Upload and attach a file to an order</description>
        <group>
            <invoke name="createContentFromUploadedFile" result-to-context="true"/>
            <invoke name="createOrderContent"/>
        </group>
    </service>
</services>
