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

import typing_extensions
import typing_extensions
import typing
from .error import ErrorParams
from ..types.v1order_state import V1OrderState
from .address import AddressParams
from .v1money import V1MoneyParams
from .v1tender import V1TenderParams
from .v1order_history_entry import V1OrderHistoryEntryParams


class V1OrderParams(typing_extensions.TypedDict):
    """
    V1Order
    """

    errors: typing_extensions.NotRequired[typing.Optional[typing.Sequence[ErrorParams]]]
    """
    Any errors that occurred during the request.
    """

    id: typing_extensions.NotRequired[str]
    """
    The order's unique identifier.
    """

    buyer_email: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The email address of the order's buyer.
    """

    recipient_name: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The name of the order's buyer.
    """

    recipient_phone_number: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The phone number to use for the order's delivery.
    """

    state: typing_extensions.NotRequired[V1OrderState]
    """
    Whether the tax is an ADDITIVE tax or an INCLUSIVE tax.
    See [V1OrderState](#type-v1orderstate) for possible values
    """

    shipping_address: typing_extensions.NotRequired[AddressParams]
    """
    The address to ship the order to.
    """

    subtotal_money: typing_extensions.NotRequired[V1MoneyParams]
    """
    The amount of all items purchased in the order, before taxes and shipping.
    """

    total_shipping_money: typing_extensions.NotRequired[V1MoneyParams]
    """
    The shipping cost for the order.
    """

    total_tax_money: typing_extensions.NotRequired[V1MoneyParams]
    """
    The total of all taxes applied to the order.
    """

    total_price_money: typing_extensions.NotRequired[V1MoneyParams]
    """
    The total cost of the order.
    """

    total_discount_money: typing_extensions.NotRequired[V1MoneyParams]
    """
    The total of all discounts applied to the order.
    """

    created_at: typing_extensions.NotRequired[str]
    """
    The time when the order was created, in ISO 8601 format.
    """

    updated_at: typing_extensions.NotRequired[str]
    """
    The time when the order was last modified, in ISO 8601 format.
    """

    expires_at: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The time when the order expires if no action is taken, in ISO 8601 format.
    """

    payment_id: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The unique identifier of the payment associated with the order.
    """

    buyer_note: typing_extensions.NotRequired[typing.Optional[str]]
    """
    A note provided by the buyer when the order was created, if any.
    """

    completed_note: typing_extensions.NotRequired[typing.Optional[str]]
    """
    A note provided by the merchant when the order's state was set to COMPLETED, if any
    """

    refunded_note: typing_extensions.NotRequired[typing.Optional[str]]
    """
    A note provided by the merchant when the order's state was set to REFUNDED, if any.
    """

    canceled_note: typing_extensions.NotRequired[typing.Optional[str]]
    """
    A note provided by the merchant when the order's state was set to CANCELED, if any.
    """

    tender: typing_extensions.NotRequired[V1TenderParams]
    """
    The tender used to pay for the order.
    """

    order_history: typing_extensions.NotRequired[typing.Optional[typing.Sequence[V1OrderHistoryEntryParams]]]
    """
    The history of actions associated with the order.
    """

    promo_code: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The promo code provided by the buyer, if any.
    """

    btc_receive_address: typing_extensions.NotRequired[typing.Optional[str]]
    """
    For Bitcoin transactions, the address that the buyer sent Bitcoin to.
    """

    btc_price_satoshi: typing_extensions.NotRequired[typing.Optional[float]]
    """
    For Bitcoin transactions, the price of the buyer's order in satoshi (100 million satoshi equals 1 BTC).
    """
