"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
from ..shared import address as shared_address
from ..shared import customer as shared_customer
from ..shared import merchant_urls as shared_merchant_urls
from ..shared import order_line as shared_order_line
from dataclasses_json import Undefined, dataclass_json
from klarna import utils
from typing import Optional


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class CreateOrderRequestInput:
    
    order_amount: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('order_amount') }})
    r"""Total amount of the order including tax and any available discounts. The value should be in non-negative minor units. Eg: 25 Euros should be 2500."""  
    order_lines: list[shared_order_line.OrderLine] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('order_lines') }})
    r"""The array containing list of line items that are part of this order. Maximum of 1000 line items could be processed in a single order."""  
    purchase_country: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('purchase_country') }})
    r"""The purchase country of the customer. The billing country always overrides purchase country if the values are different. Formatted according to ISO 3166 alpha-2 standard, e.g. GB, SE, DE, US, etc."""  
    purchase_currency: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('purchase_currency') }})
    r"""The purchase currency of the order. Formatted according to ISO 4217 standard, e.g. USD, EUR, SEK, GBP, etc."""  
    auto_capture: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('auto_capture'), 'exclude': lambda f: f is None }})
    r"""Allow merchant to trigger auto capturing."""  
    billing_address: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('billing_address'), 'exclude': lambda f: f is None }})  
    custom_payment_method_ids: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('custom_payment_method_ids'), 'exclude': lambda f: f is None }})
    r"""Promo codes - The array could be used to define which of the configured payment options within a payment category (pay_later, pay_over_time, etc.) should be shown for this purchase. Discuss with the delivery manager to know about the promo codes that will be configured for your account. The feature could also be used to provide promotional offers to specific customers (eg: 0% financing). Please be informed that the usage of this feature can have commercial implications."""  
    customer: Optional[shared_customer.Customer] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('customer'), 'exclude': lambda f: f is None }})  
    locale: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('locale'), 'exclude': lambda f: f is None }})
    r"""Used to define the language and region of the customer. The locale follows the format of [RFC 1766](https://datatracker.ietf.org/doc/rfc1766/), meaning its value consists of language-country.
    Read more on **[Supported Locals and Currencies](https://docs.klarna.com/klarna-payments/in-depth-knowledge/puchase-countries-currencies-locales/)**.
    """  
    merchant_data: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('merchant_data'), 'exclude': lambda f: f is None }})
    r"""Pass through field to send any information about the order to be used later for reference while retrieving the order details (max 6000 characters)"""  
    merchant_reference1: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('merchant_reference1'), 'exclude': lambda f: f is None }})
    r"""Used for storing merchant's internal order number or other reference."""  
    merchant_reference2: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('merchant_reference2'), 'exclude': lambda f: f is None }})
    r"""Used for storing merchant's internal order number or other reference. The value is available in the settlement files. (max 255 characters)."""  
    merchant_urls: Optional[shared_merchant_urls.MerchantUrls] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('merchant_urls'), 'exclude': lambda f: f is None }})  
    order_tax_amount: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('order_tax_amount'), 'exclude': lambda f: f is None }})
    r"""Total tax amount of the order. The value should be in non-negative minor units. Eg: 25 Euros should be 2500."""  
    shipping_address: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('shipping_address'), 'exclude': lambda f: f is None }})  
    