# This file was auto-generated by Fern from our API Definition.

import typing_extensions
import typing_extensions
import typing
from .order_return_line_item import OrderReturnLineItemParams
from .order_return_service_charge import OrderReturnServiceChargeParams
from .order_return_tax import OrderReturnTaxParams
from .order_return_discount import OrderReturnDiscountParams
from .order_return_tip import OrderReturnTipParams
from .order_rounding_adjustment import OrderRoundingAdjustmentParams
from .order_money_amounts import OrderMoneyAmountsParams


class OrderReturnParams(typing_extensions.TypedDict):
    """
    The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order.
    """

    uid: typing_extensions.NotRequired[typing.Optional[str]]
    """
    A unique ID that identifies the return only within this order.
    """

    source_order_id: typing_extensions.NotRequired[typing.Optional[str]]
    """
    An order that contains the original sale of these return line items. This is unset
    for unlinked returns.
    """

    return_line_items: typing_extensions.NotRequired[typing.Optional[typing.Sequence[OrderReturnLineItemParams]]]
    """
    A collection of line items that are being returned.
    """

    return_service_charges: typing_extensions.NotRequired[
        typing.Optional[typing.Sequence[OrderReturnServiceChargeParams]]
    ]
    """
    A collection of service charges that are being returned.
    """

    return_taxes: typing_extensions.NotRequired[typing.Sequence[OrderReturnTaxParams]]
    """
    A collection of references to taxes being returned for an order, including the total
    applied tax amount to be returned. The taxes must reference a top-level tax ID from the source
    order.
    """

    return_discounts: typing_extensions.NotRequired[typing.Sequence[OrderReturnDiscountParams]]
    """
    A collection of references to discounts being returned for an order, including the total
    applied discount amount to be returned. The discounts must reference a top-level discount ID
    from the source order.
    """

    return_tips: typing_extensions.NotRequired[typing.Optional[typing.Sequence[OrderReturnTipParams]]]
    """
    A collection of references to tips being returned for an order.
    """

    rounding_adjustment: typing_extensions.NotRequired[OrderRoundingAdjustmentParams]
    """
    A positive or negative rounding adjustment to the total value being returned. Adjustments are commonly
    used to apply cash rounding when the minimum unit of the account is smaller than the lowest
    physical denomination of the currency.
    """

    return_amounts: typing_extensions.NotRequired[OrderMoneyAmountsParams]
    """
    An aggregate monetary value being returned by this return entry.
    """
