export type SessionUrls = {return_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 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 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 Merchant = {name: string, logo_url: string, website?: string | undefined, email?: string | undefined, phone_number?: string | undefined, merchant_category_code?: string | undefined, platform_type?: ('aggregator' | 'marketplace') | undefined, country?: unknown | undefined, postal_code?: string | undefined, postal_place?: string | undefined, address_line?: string | undefined, address_line_2?: string | undefined}; export type CreateApiAccountsAidPaymentsSessionsProfileArgs = {include_session?: boolean | undefined, 'Dintero-Feature-Toggles'?: Array<'strict-session-amounts'> | undefined, 'Dintero-System-Name'?: string | undefined, 'Dintero-System-Version'?: string | undefined, 'Dintero-System-Plugin-Name'?: string | undefined, 'Dintero-System-Plugin-Version'?: string | undefined, body: {url: SessionUrls, customer?: ({customer_id?: string | undefined, email?: string | undefined, phone_number?: string | undefined, tokens?: ({'bambora.creditcard'?: ({payment_token?: string | undefined}) | undefined, 'payex.creditcard'?: ({payment_token?: string | undefined, recurrence_token?: string | undefined}) | undefined, 'dintero_psp.creditcard'?: ({payment_token?: string | undefined}) | undefined}) | undefined, gift_cards?: ({'dintero.wallets'?: Array<{card_id: string}> | undefined}) | undefined}) | undefined, order: SessionOrder, expires_at?: string | undefined, checkboxes?: CheckboxConfiguration | 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}) | undefined, profile_id: string, merchant?: Merchant | 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, metadata?: Record | undefined}}; export type CreateApiAccountsAidPaymentsSessionsProfileOptions = {baseUrl?: string | undefined, JWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * checkout_session_profile_post * * POST /accounts/{aid}/payments/sessions-profile * * Also accepts auth: apikey */ export const createApiAccountsAidPaymentsSessionsProfile = async (args: CreateApiAccountsAidPaymentsSessionsProfileArgs, options?: CreateApiAccountsAidPaymentsSessionsProfileOptions) => { const {baseUrl = "https://api.dintero.com/v1", fetch: fetchFn = fetch, JWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.include_session != null) query.append("include_session", String(args.include_session)) if (args['Dintero-Feature-Toggles'] != null) headers.set("Dintero-Feature-Toggles", args['Dintero-Feature-Toggles'].join(',')) if (args['Dintero-System-Name'] != null) headers.set("Dintero-System-Name", String(args['Dintero-System-Name'])) if (args['Dintero-System-Version'] != null) headers.set("Dintero-System-Version", String(args['Dintero-System-Version'])) if (args['Dintero-System-Plugin-Name'] != null) headers.set("Dintero-System-Plugin-Name", String(args['Dintero-System-Plugin-Name'])) if (args['Dintero-System-Plugin-Version'] != null) headers.set("Dintero-System-Plugin-Version", String(args['Dintero-System-Plugin-Version'])) if (JWT !== undefined) headers.set('authorization', `Bearer ${JWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/accounts/${encodeURIComponent(String(args.aid))}/payments/sessions-profile${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 undefined };