import {z} from 'zod' export type SessionUrls = {return_url: string}; export type MyDinteroUserCreation = {actions: Array<'create_user' | 'skip'>, terms: {id: string, url: string}}; export type OrderAddress = {first_name?: string | undefined, last_name?: string | undefined, address_line?: string | undefined, address_line_2?: string | undefined, co_address?: string | undefined, business_name?: string | undefined, postal_code?: string | undefined, postal_place?: string | undefined, country?: unknown | undefined, phone_number?: string | undefined, email?: string | undefined, latitude?: number | undefined, longitude?: number | undefined, comment?: string | undefined, organization_number?: string | undefined, organization_type?: string | undefined, customer_reference?: string | undefined, cost_center?: string | undefined}; export type PayoutFeeSplit = {type: 'proportional', destinations?: Array | undefined}; export type PayoutSplit = {payout_destination_id: string, amount: number}; export type EmdEvent = Array<{event_name: string, event_company: string, genre_of_event: string, arena_name?: string | undefined, arena_location?: ({street_address?: string | undefined, postal_code?: string | undefined, city: string, country: string}) | undefined, start_time: string, end_time: string, access_controlled_venue?: boolean | undefined, ticket_delivery_method: 'pick_up' | 'email' | 'post' | 'phone', ticket_delivery_recipient: string, affiliate_name?: string | undefined}>; export type EmdSubscription = {subscription_name: string, start_time: string, end_time: string, auto_renewal_of_subscription: boolean, affiliate_name?: string | undefined}; export type EmdCustomerAccountInfo = {unique_account_identifier: string, account_registration_date: string, account_last_modified: string}; export type EmdRecurring = {subscription: EmdSubscription, customer_account_info: EmdCustomerAccountInfo}; export type EmdAirReservationDetailsItinerary = {departure: string, departure_city?: string | undefined, arrival: string, arrival_city?: string | undefined, carrier: string, segment_price?: number | undefined, departure_date: string, ticket_delivery_method: 'pick_up' | 'email' | 'post' | 'phone', ticket_delivery_recipient: string, passenger_id?: Array | undefined, class?: string | undefined}; export type EmdTravelInsurance = {insurance_company?: string | undefined, insurance_type?: ('cancellation' | 'travel' | 'cancellation_travel' | 'bankruptcy') | undefined, insurance_price?: number | undefined}; export type EmdTravelPassenger = {id?: number | undefined, title?: ('mr' | 'mrs' | 'ms' | '') | undefined, first_name: string, last_name: string}; export type EmdAirReservationDetails = {pnr?: string | undefined, itinerary: Array, insurance?: Array | undefined, passengers?: Array | undefined, affiliate_name?: string | undefined}; export type EmdBusReservationDetailsItinerary = {departure_city: string, arrival_city: string, carrier: string, segment_price?: number | undefined, departure_date: string, ticket_delivery_method: 'pick_up' | 'email' | 'post' | 'phone', ticket_delivery_recipient: string, passenger_id?: Array | undefined, class?: string | undefined}; export type EmdBusReservationDetails = {pnr?: string | undefined, itinerary: Array, insurance?: Array | undefined, passengers?: Array | undefined, affiliate_name?: string | undefined}; export type EmdTrainReservationDetailsItinerary = {departure_city: string, arrival_city: string, carrier: string, segment_price?: number | undefined, departure_date: string, ticket_delivery_method: 'pick_up' | 'email' | 'post' | 'phone', ticket_delivery_recipient: string, passenger_id: Array, class?: string | undefined}; export type EmdTrainReservationDetails = {pnr?: string | undefined, itinerary: Array, insurance?: Array | undefined, passengers?: Array | undefined, affiliate_name?: string | undefined}; export type EmdFerryReservationDetailsItinerary = {departure_city: string, arrival_city: string, carrier: string, segment_price?: number | undefined, departure_date: string, ticket_delivery_method: 'pick_up' | 'email' | 'post' | 'phone', ticket_delivery_recipient: string, passenger_id?: Array | undefined, class?: string | undefined}; export type EmdFerryReservationDetails = {pnr?: string | undefined, itinerary: Array, insurance?: Array | undefined, passengers?: Array | undefined, affiliate_name?: string | undefined}; export type EmdHotelReservationDetailsItinerary = {hotel_name?: string | undefined, address?: ({street_address?: string | undefined, postal_code?: string | undefined, city: string, country: string}) | undefined, start_time: string, end_time: string, number_of_rooms: number, passenger_id: Array, ticket_delivery_method: 'pick_up' | 'email' | 'post' | 'phone', ticket_delivery_recipient: string, hotel_price: number, class?: string | undefined}; export type EmdHotelReservationDetails = {pnr?: string | undefined, itinerary: Array, insurance?: Array | undefined, passengers?: Array | undefined, affiliate_name?: string | undefined}; export type EmdCarRentalReservationDetailsItinerary = {rental_company: string, drivers_id?: Array | undefined, pick_up_location?: ({street_address?: string | undefined, postal_code?: string | undefined, city: string, country: string}) | undefined, drop_off_location?: ({street_address?: string | undefined, postal_code?: string | undefined, city: string, country: string}) | undefined, start_time: string, end_time: string, car_price?: number | undefined, class?: string | undefined}; export type EmdCarRentalReservationDetails = {pnr?: string | undefined, itinerary: Array, insurance?: Array | undefined, drivers: Array, affiliate_name?: string | undefined}; export type EmdTravel = {air_reservation_details?: EmdAirReservationDetails | undefined, bus_reservation_details?: EmdBusReservationDetails | undefined, train_reservation_details?: EmdTrainReservationDetails | undefined, ferry_reservation_details?: EmdFerryReservationDetails | undefined, hotel_reservation_details?: EmdHotelReservationDetails | undefined, car_rental_reservation_details?: EmdCarRentalReservationDetails | undefined}; export type EmdMarketplaceAccountLastModified = {password: string, email: string, listing: string, login: string, address: string}; export type EmdMarketplaceSellerInfo = {unique_account_identifier_seller?: ({email?: string | undefined, phone_number?: string | undefined, other?: string | undefined}) | undefined, sub_merchant_id: string, product_category: string, product_name?: string | undefined, account_registration_date: string, account_last_modified: EmdMarketplaceAccountLastModified, seller_rating?: number | undefined, number_of_trades: number, volume_of_trades?: number | undefined}; export type EmdMarketplaceWinnerInfo = {unique_account_identifier_winner?: ({email?: string | undefined, phone_number?: string | undefined, other?: string | undefined}) | undefined, account_registration_date: string, account_last_modified: EmdMarketplaceAccountLastModified, number_of_trades: number, volume_of_trades?: number | undefined}; export type EmdMarketplaceOrder = {seller_info: EmdMarketplaceSellerInfo, winner_info: EmdMarketplaceWinnerInfo}; export type Emd = {event?: EmdEvent | undefined, subscription?: EmdRecurring | undefined, travel?: EmdTravel | undefined, marketplace_order?: EmdMarketplaceOrder | undefined}; export type Address = {address_line: string, address_line_2?: string | undefined, postal_code?: string | undefined, postal_place: string, country: unknown}; export type Store = {id: string, name?: string | undefined, business_name?: string | undefined, address?: Address | undefined, chain?: string | undefined, email?: string | undefined, gln?: string | undefined, organization_number?: string | undefined, phone_number?: string | undefined, mcc?: unknown | undefined, bax?: string | undefined, terminal_id?: string | undefined, payout_destination_id?: string | undefined}; export type DiscountType = 'customer' | 'periodic' | 'manual' | 'loyalty' | 'total' | 'employee' | 'external'; export type DiscountItem = {amount?: number | undefined, percentage?: number | undefined, discount_type?: DiscountType | undefined, discount_id?: string | undefined, description?: string | undefined, line_id?: number | undefined}; export type OpeningHours = unknown; export type MultiShipmentItem = {line_id: string, quantity?: number | undefined}; export type MultiShipmentShippingOption = {id: string, line_id: string, countries?: Array | undefined, amount: number, vat_amount?: number | undefined, vat?: number | undefined, title: string, description?: string | undefined, delivery_method?: ('delivery' | 'pick_up' | 'unspecified' | 'none') | undefined, operator: string, operator_product_id?: string | undefined, eta?: ({working_days?: Array | undefined, shipping_day_of_week?: number | undefined, arrival_day_of_week?: number | undefined, starts_at?: string | undefined, ends_at?: string | undefined}) | undefined, time_slot?: ({starts_at?: string | undefined, ends_at?: string | undefined}) | undefined, pick_up_address?: ({first_name?: string | undefined, last_name?: string | undefined, address_line?: string | undefined, address_line_2?: string | undefined, co_address?: string | undefined, business_name?: string | undefined, postal_code?: string | undefined, postal_place?: string | undefined, country?: unknown | undefined, phone_number?: string | undefined, email?: string | undefined, latitude?: number | undefined, longitude?: number | undefined, comment?: string | undefined, organization_number?: string | undefined, organization_type?: string | undefined, customer_reference?: string | undefined, cost_center?: string | undefined, website_url?: string | undefined, opening_hours?: OpeningHours | undefined, distance?: number | undefined}) | undefined, metadata?: ({[key: string]: string | number}) | undefined, environmental_data?: ({description: string, details?: Array<{label: string, value: string}> | undefined}) | undefined, thumbnail_url?: string | undefined, pay_in_store?: {type: 'full'} | undefined, fee_split?: PayoutFeeSplit | undefined, splits?: Array | undefined, shipment_id?: string | undefined, shipment_items?: Array | undefined}; export type MultiShipmentTopLevelShippingOption = {id: string, line_id: string, countries?: Array | undefined, amount: number, vat_amount?: number | undefined, vat?: number | undefined, title: string, description?: string | undefined, delivery_method?: ('delivery' | 'pick_up' | 'unspecified' | 'none') | undefined, operator: string, operator_product_id?: string | undefined, eta?: ({working_days?: Array | undefined, shipping_day_of_week?: number | undefined, arrival_day_of_week?: number | undefined, starts_at?: string | undefined, ends_at?: string | undefined}) | undefined, time_slot?: ({starts_at?: string | undefined, ends_at?: string | undefined}) | undefined, pick_up_address?: ({first_name?: string | undefined, last_name?: string | undefined, address_line?: string | undefined, address_line_2?: string | undefined, co_address?: string | undefined, business_name?: string | undefined, postal_code?: string | undefined, postal_place?: string | undefined, country?: unknown | undefined, phone_number?: string | undefined, email?: string | undefined, latitude?: number | undefined, longitude?: number | undefined, comment?: string | undefined, organization_number?: string | undefined, organization_type?: string | undefined, customer_reference?: string | undefined, cost_center?: string | undefined, website_url?: string | undefined, opening_hours?: OpeningHours | undefined, distance?: number | undefined}) | undefined, metadata?: ({[key: string]: string | number}) | undefined, environmental_data?: ({description: string, details?: Array<{label: string, value: string}> | undefined}) | undefined, thumbnail_url?: string | undefined, pay_in_store?: {type: 'full'} | undefined, fee_split?: PayoutFeeSplit | undefined, splits?: Array | undefined, shipments?: Array | undefined}; export type Giftcard = {type: 'dintero.wallets', card_id: string, amount: number, masked_card_token?: string | undefined}; export type Checkbox = {id: string, label: string, checked?: boolean | undefined, required?: boolean | undefined, link?: {url: string, text: string} | undefined}; export type CheckboxConfiguration = Array; export type PublishConfiguration = Array<{channel: 'sms' | 'push', type: 'checkout-link' | 'app' | 'terminal', id?: string | undefined, status?: ('sent' | 'skipped' | 'failed') | undefined}>; export type BamboraConfiguration = unknown; export type DinteroConfiguration = unknown; export type DinteroPspConfiguration = unknown; export type InstabankConfiguration = unknown; export type NetaxeptConfiguration = unknown; export type PayExConfiguration = unknown; export type VippsConfiguration = unknown; export type CollectorConfiguration = unknown; export type KlarnaConfiguration = unknown; export type KraviaConfiguration = unknown; export type TwoConfiguration = unknown; export type SantanderConfiguration = unknown; export type SeitatechConfiguration = unknown; export type SwishConfiguration = unknown; export type PayoutConfiguration = unknown; export type AgeVerificationConfiguration = unknown; export type SessionPayability = unknown; export type SystemRequestHeaders = {'dintero-system-name'?: string | undefined, 'dintero-system-version'?: string | undefined, 'dintero-system-plugin-name'?: string | undefined, 'dintero-system-plugin-version'?: string | undefined, 'user-agent'?: string | undefined}; export type PaymentOperationIntent = 'unscheduled_purchase' | 'recurring_purchase' | 'generate_payment_token'; export type RequestHeaders = {'dintero-system-name'?: string | undefined, 'dintero-system-version'?: string | undefined, 'dintero-system-plugin-name'?: string | undefined, 'dintero-system-plugin-version'?: string | undefined, 'user-agent'?: string | undefined, 'dintero-checkout-instance-id'?: string | undefined}; export type CollectorB2BPaymentOperationAddress = {business_name: string, organization_number: string, address_line: string, postal_code: string, postal_place: string, country: unknown, address_id?: string | undefined}; export type CollectorProduct = {id: string, type: 'interest_free' | 'annuity', credit_time: number, campaign_fee: number, origination_fee: number, notification_fee: number, annual_interest_rate?: string | undefined, effective_annual_interest_rate?: string | undefined, total_amount: number, monthly_amount: number, first_monthly_amount: number}; export type SessionOrder = {amount: number, currency: unknown, vat_amount?: number | undefined, merchant_reference_2?: string | undefined, event_reference?: string | undefined, shipping_address?: OrderAddress | undefined, billing_address?: OrderAddress | undefined, partial_payment?: boolean | undefined, items?: (Array<{id?: string | undefined, groups?: (Array<{id: string, name?: string | undefined}>) | undefined, line_id?: string | undefined, version?: number | undefined, description?: string | undefined, quantity?: number | undefined, amount?: number | undefined, vat_amount?: number | undefined, vat?: number | undefined, unit_volume?: number | undefined, unit_weight?: number | undefined, unit_dimensional_weight?: number | undefined, type?: ('physical' | 'digital' | 'service' | 'gift_card' | 'shipping' | 'surcharge') | undefined, fee_split?: PayoutFeeSplit | undefined, splits?: Array | undefined, thumbnail_url?: string | undefined, emd?: Emd | undefined, store?: Store | undefined, eligible_for_discount?: boolean | undefined, is_changed?: boolean | undefined, gross_amount?: number | undefined, discount_lines?: Array | undefined}>) | undefined, gross_amount?: number | undefined, is_changed?: boolean | undefined, shipping_option?: MultiShipmentTopLevelShippingOption | undefined, store?: Store | undefined, discount_lines?: Array | undefined, discount_codes?: Array | undefined, gift_cards?: Array | undefined, emd?: Emd | undefined, payout_destination_id?: string | undefined, merchant_reference: string}; export type ShippingOption = {id: string, line_id: string, countries?: Array | undefined, amount: number, vat_amount?: number | undefined, vat?: number | undefined, title: string, description?: string | undefined, delivery_method?: ('delivery' | 'pick_up' | 'unspecified' | 'none') | undefined, operator: string, operator_product_id?: string | undefined, eta?: ({working_days?: Array | undefined, shipping_day_of_week?: number | undefined, arrival_day_of_week?: number | undefined, starts_at?: string | undefined, ends_at?: string | undefined}) | undefined, time_slot?: ({starts_at?: string | undefined, ends_at?: string | undefined}) | undefined, pick_up_address?: ({first_name?: string | undefined, last_name?: string | undefined, address_line?: string | undefined, address_line_2?: string | undefined, co_address?: string | undefined, business_name?: string | undefined, postal_code?: string | undefined, postal_place?: string | undefined, country?: unknown | undefined, phone_number?: string | undefined, email?: string | undefined, latitude?: number | undefined, longitude?: number | undefined, comment?: string | undefined, organization_number?: string | undefined, organization_type?: string | undefined, customer_reference?: string | undefined, cost_center?: string | undefined, website_url?: string | undefined, opening_hours?: OpeningHours | undefined, distance?: number | undefined}) | undefined, metadata?: ({[key: string]: string | number}) | undefined, environmental_data?: ({description: string, details?: Array<{label: string, value: string}> | undefined}) | undefined, thumbnail_url?: string | undefined}; export type SessionExpress = {express?: ({shipping_options: Array, shipping_mode?: ('shipping_required' | 'shipping_not_required') | undefined, discount_codes?: ({max_count?: number | undefined, callback_url?: string | undefined}) | undefined, shipping_address_callback_url?: string | undefined, customer_types?: (Array<'b2c' | 'b2b'>) | undefined, default_different_billing_shipping_address?: (Array<'b2c' | 'b2b'>) | undefined}) | undefined}; export type CreateApiExamplesDiscountCodeCallbackUrlArgs = {body: {id?: string | undefined, created_at?: string | undefined, url: SessionUrls, customer?: ({customer_id?: string | undefined, email?: string | undefined, phone_number?: string | undefined, my_dintero?: MyDinteroUserCreation | undefined, gift_cards?: ({'dintero.wallets'?: (Array<{card_id: string, masked_card_token?: string | undefined}>) | undefined}) | undefined, tokens?: ({'payex.creditcard'?: ({payment_token_id?: string | undefined}) | undefined, 'bambora.creditcard'?: ({payment_token_id?: string | undefined}) | undefined, 'dintero_psp.creditcard'?: ({payment_token_id?: string | undefined}) | undefined}) | undefined}) | undefined, order: {amount: number, currency: unknown, vat_amount?: number | undefined, merchant_reference_2?: string | undefined, event_reference?: string | undefined, shipping_address?: OrderAddress | undefined, billing_address?: OrderAddress | undefined, partial_payment?: boolean | undefined, items?: (Array<{id?: string | undefined, groups?: (Array<{id: string, name?: string | undefined}>) | undefined, line_id?: string | undefined, version?: number | undefined, description?: string | undefined, quantity?: number | undefined, amount?: number | undefined, vat_amount?: number | undefined, vat?: number | undefined, unit_volume?: number | undefined, unit_weight?: number | undefined, unit_dimensional_weight?: number | undefined, type?: ('physical' | 'digital' | 'service' | 'gift_card' | 'shipping' | 'surcharge') | undefined, fee_split?: PayoutFeeSplit | undefined, splits?: Array | undefined, thumbnail_url?: string | undefined, emd?: Emd | undefined, store?: Store | undefined, eligible_for_discount?: boolean | undefined, is_changed?: boolean | undefined, gross_amount?: number | undefined, discount_lines?: Array | undefined}>) | undefined, gross_amount?: number | undefined, is_changed?: boolean | undefined, shipping_option?: MultiShipmentTopLevelShippingOption | undefined, store?: Store | undefined, discount_lines?: Array | undefined, discount_codes?: Array | undefined, gift_cards?: Array | undefined, emd?: Emd | undefined, payout_destination_id?: string | undefined, merchant_reference: string}, expires_at?: string | undefined, checkboxes?: CheckboxConfiguration | undefined, express?: ({shipping_options: Array<{id: string, line_id: string, countries?: Array | undefined, amount: number, vat_amount?: number | undefined, vat?: number | undefined, title: string, description?: string | undefined, delivery_method?: ('delivery' | 'pick_up' | 'unspecified' | 'none') | undefined, operator: string, operator_product_id?: string | undefined, eta?: ({working_days?: Array | undefined, shipping_day_of_week?: number | undefined, arrival_day_of_week?: number | undefined, starts_at?: string | undefined, ends_at?: string | undefined}) | undefined, time_slot?: ({starts_at?: string | undefined, ends_at?: string | undefined}) | undefined, pick_up_address?: ({first_name?: string | undefined, last_name?: string | undefined, address_line?: string | undefined, address_line_2?: string | undefined, co_address?: string | undefined, business_name?: string | undefined, postal_code?: string | undefined, postal_place?: string | undefined, country?: unknown | undefined, phone_number?: string | undefined, email?: string | undefined, latitude?: number | undefined, longitude?: number | undefined, comment?: string | undefined, organization_number?: string | undefined, organization_type?: string | undefined, customer_reference?: string | undefined, cost_center?: string | undefined, website_url?: string | undefined, opening_hours?: OpeningHours | undefined, distance?: number | undefined}) | undefined, metadata?: ({[key: string]: string | number}) | undefined, environmental_data?: ({description: string, details?: Array<{label: string, value: string}> | undefined}) | undefined, thumbnail_url?: string | undefined, pay_in_store?: {type: 'full'} | undefined, fee_split?: PayoutFeeSplit | undefined, splits?: Array | undefined, shipment_id?: string | undefined, shipment_items?: Array | undefined}>, shipping_mode?: ('shipping_required' | 'shipping_not_required') | undefined, discount_codes?: ({max_count?: number | undefined, callback_url?: string | undefined}) | undefined, shipping_address_callback_url?: string | undefined, customer_types?: (Array<'b2c' | 'b2b'>) | undefined, default_different_billing_shipping_address?: (Array<'b2c' | 'b2b'>) | undefined}) | undefined, configuration: {auto_capture?: boolean | undefined, channel?: ('ecommerce' | 'in_app' | 'in_store' | 'hosted') | undefined, publish?: PublishConfiguration | undefined, active_payment_types?: ({enabled?: boolean | undefined}) | undefined, default_payment_type?: ('bambora.applepay' | 'bambora.creditcard' | 'bambora.googlepay' | 'bambora.mobilepay' | 'bambora.vipps' | 'dintero.zero' | 'dintero_psp.applepay' | 'dintero_psp.creditcard' | 'dintero_psp.vipps' | 'dintero_psp.googlepay' | 'dintero_psp.clicktopay' | 'instabank.finance' | 'instabank.invoice' | 'instabank.installment' | 'instabank.postponement' | 'vipps' | 'payex.creditcard' | 'payex.mobilepay' | 'payex.swish' | 'payex.vipps' | 'payex.applepay' | 'payex.clicktopay' | 'payex.googlepay' | 'collector.finance' | 'collector.invoice' | 'collector.invoice_b2b' | 'collector.invoice_b2b_preapproved' | 'collector.installment_b2b_preapproved' | 'collector.installment' | 'santander.debit_account' | 'swish.swish' | 'netaxept.creditcard' | 'klarna.klarna' | 'klarna.billie' | 'kravia.invoice_b2b' | 'kravia.invoice_b2b_grouped' | 'kravia.invoice_b2c' | 'seitatech.in_person' | 'two.invoice_b2b') | undefined, bambora?: BamboraConfiguration | undefined, dintero?: DinteroConfiguration | undefined, dintero_psp?: DinteroPspConfiguration | undefined, instabank?: InstabankConfiguration | undefined, netaxept?: NetaxeptConfiguration | undefined, payex?: PayExConfiguration | undefined, vipps?: VippsConfiguration | undefined, collector?: CollectorConfiguration | undefined, klarna?: KlarnaConfiguration | undefined, kravia?: KraviaConfiguration | undefined, two?: TwoConfiguration | undefined, santander?: SantanderConfiguration | undefined, seitatech?: SeitatechConfiguration | undefined, swish?: SwishConfiguration | undefined, payout?: PayoutConfiguration | undefined, allow_express_wallet_payment?: boolean | undefined, age_verification?: AgeVerificationConfiguration | undefined, discounts?: ({type?: 'discounts' | undefined, express_discount_codes?: ({payability?: SessionPayability | undefined, enabled: boolean}) | undefined, order?: {enabled: boolean} | undefined}) | undefined, theme?: ({backdrop?: string | undefined, primary?: string | undefined, cardRadius?: string | undefined, buttonRadius?: string | undefined}) | undefined, countries?: ({preferred_country?: unknown | undefined, allow_countries?: Array | undefined, deny_countries?: Array | undefined}) | undefined, default_customer_type?: ('b2c' | 'b2b') | undefined, allow_different_billing_shipping_address?: (Array<'b2c' | 'b2b'>) | undefined, merchant?: ({id?: string | undefined, logo_url?: string | undefined, name?: string | undefined, country?: string | undefined}) | undefined}, updated_at?: string | undefined, customer_ip?: string | undefined, user_agent?: string | undefined, initiating_system_request_headers?: SystemRequestHeaders | undefined, payment_operation?: PaymentOperationIntent | undefined, events?: (Array<{created_at?: string | undefined, id?: string | undefined, request_id?: string | undefined, name?: ('INITIATED' | 'VISITED' | 'COMPLETED' | 'AUTHORIZED' | 'DECLINED' | 'PAY_LOCK_START' | 'PAY_LOCK_META' | 'PAY_LOCK_END' | 'PAY_FAILED' | 'ON_HOLD_CALLBACK_SENT' | 'AUTH_CALLBACK_SENT' | 'FAILED' | 'UNKNOWN' | 'PAYMENT_TOKEN_FLOW_START' | 'UPDATE_SESSION' | 'CANCELLED' | 'SET_BILLING_ADDRESS' | 'SET_DISCOUNT_CODES' | 'SET_SHIPPING_ADDRESS' | 'SET_SHIPPING_OPTION' | 'SET_GIFT_CARD' | 'PUSH_NOTIFICATION_SENT' | 'SECRET_CONFIRMATION_CODE_SENT' | 'SET_MY_DINTERO' | 'ADD_PAYMENT_INFORMATION') | undefined, request_headers?: RequestHeaders | undefined, details?: ({error?: string | undefined, payment_product_type?: string | undefined, amount?: number | undefined, shipping_option?: MultiShipmentTopLevelShippingOption | undefined, shipping_address?: OrderAddress | undefined, bambora?: ({session_token?: string | undefined, session_url?: string | undefined, wallet_session_id?: string | undefined}) | undefined, klarna?: {client_token: string, session_id: string} | undefined, 'seitatech:payment_reference'?: string | undefined, 'seitatech:terminal_id'?: string | undefined, 'seitatech:terminal_tms_id'?: string | undefined, 'payex:payment:id'?: string | undefined, 'vipps:payment:id'?: string | undefined, 'vipps:gateway_api_version'?: string | undefined, 'collector:invoice_b2b:addresses'?: Array | undefined, 'collector:installment:products'?: Array | undefined, my_dintero?: MyDinteroUserCreation | undefined, organization_number?: string | undefined, previous_order?: SessionOrder | undefined, updated_order?: SessionOrder | undefined, updated_order_result?: ({status?: 'NOT_MODIFIED' | undefined}) | undefined, previous_express?: SessionExpress | undefined, updated_express?: SessionExpress | undefined, updated_express_result?: ({status?: 'NOT_MODIFIED' | undefined}) | undefined, gift_card?: ({card_id?: string | undefined, card_amount?: number | undefined, masked_card_token?: string | undefined, currency?: string | undefined}) | undefined, transaction_event_id?: string | undefined}) | undefined}>) | undefined, transaction_id?: string | undefined, metadata?: ({'session:profile_id'?: string | undefined}) | undefined}}; export type CreateApiExamplesDiscountCodeCallbackUrlOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; export const payoutFeeSplit = z.object({type: z.literal("proportional"), destinations: z.array(z.string().max(40)).optional()}); export const payoutSplit = z.object({payout_destination_id: z.string().max(40), amount: z.number().int().gte(0)}); export const emdEvent = z.array(z.object({event_name: z.string(), event_company: z.string(), genre_of_event: z.string(), arena_name: z.string().optional(), arena_location: z.object({street_address: z.string().optional(), postal_code: z.string().optional(), city: z.string(), country: z.string()}).optional(), start_time: z.string(), end_time: z.string(), access_controlled_venue: z.boolean().optional(), ticket_delivery_method: z.enum(["pick_up", "email", "post", "phone"]), ticket_delivery_recipient: z.string(), affiliate_name: z.string().optional()})); export const emdSubscription = z.object({subscription_name: z.string(), start_time: z.string(), end_time: z.string(), auto_renewal_of_subscription: z.boolean(), affiliate_name: z.string().optional()}); export const emdCustomerAccountInfo = z.object({unique_account_identifier: z.string(), account_registration_date: z.string(), account_last_modified: z.string()}); export const emdRecurring = z.object({subscription: emdSubscription, customer_account_info: emdCustomerAccountInfo}); export const emdAirReservationDetailsItinerary = z.object({departure: z.string(), departure_city: z.string().optional(), arrival: z.string(), arrival_city: z.string().optional(), carrier: z.string(), segment_price: z.number().int().optional(), departure_date: z.string(), ticket_delivery_method: z.enum(["pick_up", "email", "post", "phone"]), ticket_delivery_recipient: z.string(), passenger_id: z.array(z.number().int()).optional(), class: z.string().optional()}); export const emdTravelInsurance = z.object({insurance_company: z.string().optional(), insurance_type: z.enum(["cancellation", "travel", "cancellation_travel", "bankruptcy"]).optional(), insurance_price: z.number().int().optional()}); export const emdTravelPassenger = z.object({id: z.number().int().optional(), title: z.enum(["mr", "mrs", "ms", ""]).optional(), first_name: z.string(), last_name: z.string()}); export const emdAirReservationDetails = z.object({pnr: z.string().optional(), itinerary: z.array(emdAirReservationDetailsItinerary), insurance: z.array(emdTravelInsurance).optional(), passengers: z.array(emdTravelPassenger).optional(), affiliate_name: z.string().optional()}); export const emdBusReservationDetailsItinerary = z.object({departure_city: z.string(), arrival_city: z.string(), carrier: z.string(), segment_price: z.number().int().optional(), departure_date: z.string(), ticket_delivery_method: z.enum(["pick_up", "email", "post", "phone"]), ticket_delivery_recipient: z.string(), passenger_id: z.array(z.number().int()).optional(), class: z.string().optional()}); export const emdBusReservationDetails = z.object({pnr: z.string().optional(), itinerary: z.array(emdBusReservationDetailsItinerary), insurance: z.array(emdTravelInsurance).optional(), passengers: z.array(emdTravelPassenger).optional(), affiliate_name: z.string().optional()}); export const emdTrainReservationDetailsItinerary = z.object({departure_city: z.string(), arrival_city: z.string(), carrier: z.string(), segment_price: z.number().int().optional(), departure_date: z.string(), ticket_delivery_method: z.enum(["pick_up", "email", "post", "phone"]), ticket_delivery_recipient: z.string(), passenger_id: z.array(z.number().int()), class: z.string().optional()}); export const emdTrainReservationDetails = z.object({pnr: z.string().optional(), itinerary: z.array(emdTrainReservationDetailsItinerary), insurance: z.array(emdTravelInsurance).optional(), passengers: z.array(emdTravelPassenger).optional(), affiliate_name: z.string().optional()}); export const emdFerryReservationDetailsItinerary = z.object({departure_city: z.string(), arrival_city: z.string(), carrier: z.string(), segment_price: z.number().int().optional(), departure_date: z.string(), ticket_delivery_method: z.enum(["pick_up", "email", "post", "phone"]), ticket_delivery_recipient: z.string(), passenger_id: z.array(z.number().int()).optional(), class: z.string().optional()}); export const emdFerryReservationDetails = z.object({pnr: z.string().optional(), itinerary: z.array(emdFerryReservationDetailsItinerary), insurance: z.array(emdTravelInsurance).optional(), passengers: z.array(emdTravelPassenger).optional(), affiliate_name: z.string().optional()}); export const emdHotelReservationDetailsItinerary = z.object({hotel_name: z.string().optional(), address: z.object({street_address: z.string().optional(), postal_code: z.string().optional(), city: z.string(), country: z.string()}).optional(), start_time: z.string(), end_time: z.string(), number_of_rooms: z.number().int(), passenger_id: z.array(z.number().int()), ticket_delivery_method: z.enum(["pick_up", "email", "post", "phone"]), ticket_delivery_recipient: z.string(), hotel_price: z.number().int(), class: z.string().optional()}); export const emdHotelReservationDetails = z.object({pnr: z.string().optional(), itinerary: z.array(emdHotelReservationDetailsItinerary), insurance: z.array(emdTravelInsurance).optional(), passengers: z.array(emdTravelPassenger).optional(), affiliate_name: z.string().optional()}); export const emdCarRentalReservationDetailsItinerary = z.object({rental_company: z.string(), drivers_id: z.array(z.number().int()).optional(), pick_up_location: z.object({street_address: z.string().optional(), postal_code: z.string().optional(), city: z.string(), country: z.string()}).optional(), drop_off_location: z.object({street_address: z.string().optional(), postal_code: z.string().optional(), city: z.string(), country: z.string()}).optional(), start_time: z.string(), end_time: z.string(), car_price: z.number().int().optional(), class: z.string().optional()}); export const emdCarRentalReservationDetails = z.object({pnr: z.string().optional(), itinerary: z.array(emdCarRentalReservationDetailsItinerary), insurance: z.array(emdTravelInsurance).optional(), drivers: z.array(emdTravelPassenger), affiliate_name: z.string().optional()}); export const emdTravel = z.object({air_reservation_details: emdAirReservationDetails.optional(), bus_reservation_details: emdBusReservationDetails.optional(), train_reservation_details: emdTrainReservationDetails.optional(), ferry_reservation_details: emdFerryReservationDetails.optional(), hotel_reservation_details: emdHotelReservationDetails.optional(), car_rental_reservation_details: emdCarRentalReservationDetails.optional()}); export const emdMarketplaceAccountLastModified = z.object({password: z.string(), email: z.string(), listing: z.string(), login: z.string(), address: z.string()}); export const emdMarketplaceSellerInfo = z.object({unique_account_identifier_seller: z.object({email: z.string().optional(), phone_number: z.string().optional(), other: z.string().optional()}).optional(), sub_merchant_id: z.string(), product_category: z.string(), product_name: z.string().optional(), account_registration_date: z.string(), account_last_modified: emdMarketplaceAccountLastModified, seller_rating: z.number().optional(), number_of_trades: z.number().int(), volume_of_trades: z.number().int().optional()}); export const emdMarketplaceWinnerInfo = z.object({unique_account_identifier_winner: z.object({email: z.string().optional(), phone_number: z.string().optional(), other: z.string().optional()}).optional(), account_registration_date: z.string(), account_last_modified: emdMarketplaceAccountLastModified, number_of_trades: z.number().int(), volume_of_trades: z.number().int().optional()}); export const emdMarketplaceOrder = z.object({seller_info: emdMarketplaceSellerInfo, winner_info: emdMarketplaceWinnerInfo}); export const emd = z.object({event: emdEvent.optional(), subscription: emdRecurring.optional(), travel: emdTravel.optional(), marketplace_order: emdMarketplaceOrder.optional()}); export const address = z.object({address_line: z.string(), address_line_2: z.string().optional(), postal_code: z.string().optional(), postal_place: z.string(), country: z.string()}); export const store = z.object({id: z.string(), name: z.string().optional(), business_name: z.string().optional(), address: address.optional(), chain: z.string().optional(), email: z.string().optional(), gln: z.string().optional(), organization_number: z.string().optional(), phone_number: z.string().optional(), mcc: z.string().optional(), bax: z.string().optional(), terminal_id: z.string().optional(), payout_destination_id: z.string().max(40).optional()}); export const discountType = z.enum(["customer", "periodic", "manual", "loyalty", "total", "employee", "external"]); export const discountItem = z.object({amount: z.number().int().optional(), percentage: z.number().optional(), discount_type: discountType.optional(), discount_id: z.string().optional(), description: z.string().optional(), line_id: z.number().int().optional()}); export const discountCodesOrderUpdate = z.object({discount_codes: z.array(z.string()).optional(), amount: z.number(), items: z.array(z.object({id: z.string().optional(), groups: z.array(z.object({id: z.string(), name: z.string().optional()})).optional(), line_id: z.string().optional(), version: z.number().optional(), description: z.string().optional(), quantity: z.number().optional(), amount: z.number().int().optional(), vat_amount: z.number().int().optional(), vat: z.number().optional(), unit_volume: z.number().optional(), unit_weight: z.number().optional(), unit_dimensional_weight: z.number().optional(), type: z.enum(["physical", "digital", "service", "gift_card", "shipping", "surcharge"]).optional(), fee_split: payoutFeeSplit.optional(), splits: z.array(payoutSplit).optional(), thumbnail_url: z.string().optional(), emd: emd.optional(), store: store.optional(), discount_lines: z.array(discountItem).optional()})).optional()}); export const openingHours = z.unknown(); export const multiShipmentItem = z.object({line_id: z.string(), quantity: z.number().optional()}); export const multiShipmentShippingOption = z.object({id: z.string(), line_id: z.string(), countries: z.array(z.string()).optional(), amount: z.number().int(), vat_amount: z.number().int().optional(), vat: z.number().optional(), title: z.string(), description: z.string().optional(), delivery_method: z.enum(["delivery", "pick_up", "unspecified", "none"]).optional(), operator: z.string(), operator_product_id: z.string().optional(), eta: z.object({working_days: z.array(z.number().gte(0)).optional(), shipping_day_of_week: z.number().gte(1).lte(7).optional(), arrival_day_of_week: z.number().gte(1).lte(7).optional(), starts_at: z.string().optional(), ends_at: z.string().optional()}).optional(), time_slot: z.object({starts_at: z.string().optional(), ends_at: z.string().optional()}).optional(), pick_up_address: z.object({first_name: z.string().optional(), last_name: z.string().optional(), address_line: z.string().optional(), address_line_2: z.string().optional(), co_address: z.string().optional(), business_name: z.string().optional(), postal_code: z.string().optional(), postal_place: z.string().optional(), country: z.string().optional(), phone_number: z.string().optional(), email: z.string().optional(), latitude: z.number().optional(), longitude: z.number().optional(), comment: z.string().optional(), organization_number: z.string().optional(), organization_type: z.string().optional(), customer_reference: z.string().optional(), cost_center: z.string().optional(), website_url: z.string().optional(), opening_hours: openingHours.optional(), distance: z.number().optional()}).optional(), metadata: z.record(z.string(), z.union([z.string(), z.number()])).optional(), environmental_data: z.object({description: z.string(), details: z.array(z.object({label: z.string().max(50), value: z.string().max(50)})).optional()}).optional(), thumbnail_url: z.string().optional(), pay_in_store: z.object({type: z.literal("full")}).optional(), fee_split: payoutFeeSplit.optional(), splits: z.array(payoutSplit).optional(), shipment_id: z.string().optional(), shipment_items: z.array(multiShipmentItem).optional()}); export const createApiExamplesDiscountCodeCallbackUrlResponse = z.object({order: discountCodesOrderUpdate.optional(), shipping_options: z.array(multiShipmentShippingOption)}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * example_discount_codes_callback_url * * POST /examples/discount_code_callback_url */ export const createApiExamplesDiscountCodeCallbackUrl = async (args: CreateApiExamplesDiscountCodeCallbackUrlArgs, options?: CreateApiExamplesDiscountCodeCallbackUrlOptions) => { const {baseUrl = "https://api.dintero.com/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/examples/discount_code_callback_url${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(createApiExamplesDiscountCodeCallbackUrlResponse, await res.json()) };