# generated by datamodel-codegen:
#   filename:  openapi.json
#   timestamp: 2026-03-21T19:33:27+00:00

from __future__ import annotations

from typing import Any, Literal, NotRequired, TypedDict


class SupportedAssetsResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[dict[str, Any]]


class MerchantAddressDto(TypedDict):
    id: str
    chain: Literal['bitcoin', 'ethereum', 'solana', 'bsc', 'tron', 'base', 'arbitrum']
    address: str
    label: NotRequired[str]
    isDefault: bool
    isActive: bool
    createdAt: str
    updatedAt: str


class CreateAddressResponseDto(TypedDict):
    success: bool
    message: str
    data: MerchantAddressDto


class CreateMerchantAddressDto(TypedDict):
    chain: Literal['bitcoin', 'ethereum', 'solana', 'bsc', 'tron', 'base', 'arbitrum']
    address: str
    label: NotRequired[str]
    isDefault: NotRequired[bool]


class PaginationMetaDto(TypedDict):
    page: float
    size: float
    total: float
    totalPages: float


class GetAllAddressesResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[list[MerchantAddressDto]]
    meta: PaginationMetaDto


class ValidateAddressResponseDto(TypedDict):
    success: bool
    message: str


class GetAddressResponseDto(TypedDict):
    success: bool
    message: str
    data: MerchantAddressDto


class UpdateAddressResponseDto(TypedDict):
    success: bool
    message: str
    data: MerchantAddressDto


class UpdateMerchantAddressDto(TypedDict):
    label: NotRequired[str]
    isDefault: NotRequired[bool]
    isActive: NotRequired[bool]


class DeleteAddressResponseDto(TypedDict):
    success: bool
    message: str


class MerchantResponseDto(TypedDict):
    id: str
    firstName: str
    lastName: str
    businessName: str
    email: str
    status: Literal['active', 'suspended']
    createdAt: str
    updatedAt: str


class BalanceDto(TypedDict):
    currency: Literal['NGN', 'USDT']
    totalBalance: str
    availableBalance: str
    pendingBalance: str
    merchant: MerchantResponseDto


class BalanceResponseDto(TypedDict):
    success: bool
    message: str
    data: BalanceDto


class CreateRefundDto(TypedDict):
    reason: NotRequired[str]
    refundAddress: str
    feePaidBy: NotRequired[Literal['merchant', 'customer']]


class RefundResponseDto(TypedDict):
    id: str
    entity: Literal['session', 'invoice']
    reference: str
    status: Literal['pending', 'processing', 'completed', 'failed']
    reason: NotRequired[str]
    chain: str
    asset: str
    amount: str
    fee: str
    feePaidBy: Literal['merchant', 'customer']
    balanceSource: Literal['merchantBalance', 'pendingBalance']
    merchantDebitAmount: str
    fiatAmount: str
    fiatCurrency: str
    refundAddress: str
    txHash: NotRequired[str]
    explorerUrl: NotRequired[str]
    createdAt: str
    completedAt: NotRequired[str]


class RefundApiResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[RefundResponseDto]


class CreateInvoiceRefundDto(TypedDict):
    reason: NotRequired[str]
    refundAddress: str
    feePaidBy: NotRequired[Literal['merchant', 'customer']]


class RefundsResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[list[RefundResponseDto]]
    meta: PaginationMetaDto


class CreatePayoutDto(TypedDict):
    method: Literal['fiat', 'crypto']
    currency: Literal['NGN', 'USDT']
    amount: str
    recipientId: str
    narration: NotRequired[str]
    reference: NotRequired[str]


ConversionDto = TypedDict(
    'ConversionDto',
    {
        'from': str,
        'to': str,
        'rate': str,
        'convertedAmount': str,
    },
)


class RecipientDto(TypedDict):
    id: str
    type: Literal['bankAccount', 'cryptoAddress']
    accountName: str
    accountNumber: str
    bankName: str
    address: str
    chain: str
    asset: str


class PayoutV2Dto(TypedDict):
    id: str
    method: Literal['fiat', 'crypto']
    type: Literal['instant', 'withdrawal', 'refund']
    status: Literal['pending', 'processing', 'success', 'failed']
    amount: str
    fee: str
    total: str
    currency: str
    conversion: ConversionDto
    reference: str
    narration: str
    txHash: str
    recipient: RecipientDto
    failureReason: str
    completedAt: str
    createdAt: str
    updatedAt: str


class PayoutV2ResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[PayoutV2Dto]


class PayoutsV2ResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[list[PayoutV2Dto]]
    meta: PaginationMetaDto


class RequestedAmountDto(TypedDict):
    amount: str
    currency: str


class CalculatePayoutFeesResponseDataDto(TypedDict):
    currency: str
    fiat: dict[str, str]
    crypto: dict[str, dict[str, str]]


class CalculatePayoutFeesApiResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[CalculatePayoutFeesResponseDataDto]


class CryptoAmountDto(TypedDict):
    gross: str
    fee: str
    net: str
    currency: str


class TransactionDto(TypedDict):
    id: str
    sessionId: str
    txHash: str
    status: Literal['pending', 'processing', 'confirmed', 'failed']
    chain: str
    asset: str
    toAddress: str
    fromAddress: str
    amount: str
    explorerUrl: NotRequired[str]
    createdAt: str
    confirmations: str
    updatedAt: str
    confirmedAt: NotRequired[str]
    amlCheck: NotRequired[Literal['passed', 'pending', 'failed']]
    failureReason: NotRequired[str]


class TransactionsResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[list[TransactionDto]]
    meta: PaginationMetaDto


class TransactionResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[TransactionDto]


class CreateCustomerNestedDto(TypedDict):
    email: str
    firstName: NotRequired[str]
    lastName: NotRequired[str]
    phone: NotRequired[str]
    telegramId: NotRequired[str]


class CreateCheckoutSessionDto(TypedDict):
    title: str
    description: str
    amount: str
    currency: Literal['NGN', 'USD']
    asset: NotRequired[Literal['BTC', 'ETH', 'USDT', 'USDC', 'SOL', 'BNB', 'TRX']]
    chain: NotRequired[
        Literal['bitcoin', 'ethereum', 'solana', 'bsc', 'tron', 'base', 'arbitrum']
    ]
    metadata: NotRequired[dict[str, Any]]
    customer: CreateCustomerNestedDto
    cancelUrl: NotRequired[str]
    successUrl: NotRequired[str]
    webhookUrl: NotRequired[str]
    feePaidBy: NotRequired[Literal['customer', 'merchant']]


class SettlementsGrossDto(TypedDict):
    amount: str
    conversionRate: str


class SettlementsFeeDetailDto(TypedDict):
    amount: str
    paidBy: Literal['customer', 'merchant']


class SettlementsFeesDto(TypedDict):
    processing: NotRequired[SettlementsFeeDetailDto]
    gas: NotRequired[SettlementsFeeDetailDto]


class SettlementsNetDto(TypedDict):
    amount: str


class SettlementsDto(TypedDict):
    currency: Literal['NGN', 'USD']
    gross: SettlementsGrossDto
    fees: SettlementsFeesDto
    net: SettlementsNetDto


class PaymentResponseDto(TypedDict):
    status: NotRequired[Literal['pending', 'partial', 'expired', 'completed', 'failed']]
    asset: NotRequired[Literal['BTC', 'ETH', 'USDT', 'USDC', 'SOL', 'BNB', 'TRX']]
    chain: NotRequired[
        Literal['bitcoin', 'ethereum', 'solana', 'bsc', 'tron', 'base', 'arbitrum']
    ]
    amount: NotRequired[str]
    amountReceived: NotRequired[str]
    address: NotRequired[str]
    gasFee: NotRequired[str]
    feePaidBy: NotRequired[Literal['customer', 'merchant']]
    conversionRate: NotRequired[str]


class CustomerDto(TypedDict):
    id: NotRequired[str]
    email: str
    firstName: NotRequired[str]
    lastName: NotRequired[str]
    phone: NotRequired[str]
    telegramId: NotRequired[str]


class CheckoutSessionV2Dto(TypedDict):
    id: str
    reference: str
    title: NotRequired[str]
    description: NotRequired[str]
    state: Literal['open', 'closed']
    type: Literal['checkout', 'invoice']
    amount: str
    currency: Literal['NGN', 'USD']
    settlements: SettlementsDto
    payment: NotRequired[PaymentResponseDto]
    url: NotRequired[str]
    cancelUrl: NotRequired[str]
    successUrl: NotRequired[str]
    customer: NotRequired[CustomerDto]
    metadata: NotRequired[dict[str, Any]]
    createdAt: str
    expiresAt: str
    completedAt: NotRequired[str]


class PaymentSessionV2ResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[CheckoutSessionV2Dto]


class GenerateDepositAddressDto(TypedDict):
    asset: Literal['BTC', 'ETH', 'USDT', 'USDC', 'SOL', 'BNB', 'TRX']
    chain: Literal['bitcoin', 'ethereum', 'solana', 'bsc', 'tron', 'base', 'arbitrum']


class PaymentSessionsV2ResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[list[CheckoutSessionV2Dto]]
    meta: PaginationMetaDto


class GrossAmountDto(TypedDict):
    currency: Literal['NGN', 'USD']
    amount: str
    conversionRate: str


class FiatAmountDto(TypedDict):
    amount: str
    currency: str


class FeeDto(TypedDict):
    networkFee: str
    paidBy: str


class CalculateCheckoutAmountResponseDto(TypedDict):
    fiat: FiatAmountDto
    crypto: CryptoAmountDto
    fees: FeeDto
    conversionRate: str


class CalculateCheckoutAmountApiResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[CalculateCheckoutAmountResponseDto]


X402PayloadDto = TypedDict(
    'X402PayloadDto',
    {
        'from': str,
        'to': str,
        'value': str,
        'validAfter': NotRequired[str],
        'validBefore': NotRequired[str],
        'nonce': NotRequired[str],
        'deadline': NotRequired[str],
        'signature': NotRequired[str],
        'transaction': NotRequired[str],
    },
)


class X402SubmitDto(TypedDict):
    sessionReference: NotRequired[str]
    scheme: Literal['eip3009', 'permit2', 'solana']
    chain: Literal['base', 'arbitrum', 'bsc', 'solana']
    asset: Literal['USDC', 'USDT', 'SOL']
    payload: X402PayloadDto


class X402SubmitResponseDto(TypedDict):
    txHash: str
    chain: Literal['base', 'arbitrum', 'bsc', 'solana']
    asset: str
    fromAddress: str
    toAddress: str
    amount: str
    blockNumber: float
    timestamp: float
    status: Literal['pending', 'confirmed']


class X402VerifyResponseDto(TypedDict):
    valid: bool
    errors: list[str]
    checks: dict[str, Any]


class CreateCustomerRequestDto(TypedDict):
    firstName: NotRequired[str]
    lastName: NotRequired[str]
    email: NotRequired[str]
    phone: NotRequired[str]
    telegramId: NotRequired[str]


class CustomerResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[CustomerDto]


class CustomersResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[list[CustomerDto]]
    meta: PaginationMetaDto


class CreatePaymentPagePricingDto(TypedDict):
    title: str
    description: NotRequired[str]
    price: float
    isActive: bool
    sortOrder: float
    id: NotRequired[str]


class CreatePaymentPageDto(TypedDict):
    title: str
    description: NotRequired[str]
    isActive: bool
    minAmount: NotRequired[float]
    currency: Literal['NGN', 'USD']
    bankAccountIds: NotRequired[list[str]]
    pricing: NotRequired[list[CreatePaymentPagePricingDto]]
    enableQuantity: NotRequired[bool]


class MerchantInfoDto(TypedDict):
    businessName: str
    logoUrl: NotRequired[str]


class MerchantBankAccountDto(TypedDict):
    id: str
    accountName: str
    accountNumber: str
    bankName: str
    bankCode: str
    accountType: str
    currency: str
    nickName: str
    verified: bool
    default: bool
    createdAt: str
    updatedAt: str


class PaymentPagePricingDto(TypedDict):
    id: str
    title: str
    description: NotRequired[str]
    price: str
    isActive: bool
    sortOrder: float
    createdAt: str
    updatedAt: str


class PaymentPageDto(TypedDict):
    id: str
    reference: str
    merchant: MerchantInfoDto
    title: NotRequired[str]
    description: NotRequired[str]
    isActive: NotRequired[bool]
    currency: NotRequired[Literal['NGN', 'USD']]
    minAmount: NotRequired[str]
    enableQuantity: NotRequired[bool]
    bankAccounts: NotRequired[list[MerchantBankAccountDto]]
    pricing: NotRequired[list[PaymentPagePricingDto]]
    createdAt: str
    updatedAt: str
    url: str


class PaymentPageResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[PaymentPageDto]


class PaymentPagesResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[list[PaymentPageDto]]
    meta: PaginationMetaDto


class PublicPaymentPagePricingDto(TypedDict):
    id: str
    title: str
    price: str
    description: NotRequired[str]
    sortOrder: float


class PublicBankAccountDto(TypedDict):
    id: str
    accountName: str
    accountNumber: str
    bankName: str


class PublicPaymentPageDto(TypedDict):
    merchant: MerchantInfoDto
    title: NotRequired[str]
    description: NotRequired[str]
    currency: NotRequired[str]
    minAmount: NotRequired[str]
    enableQuantity: NotRequired[bool]
    pricing: NotRequired[list[PublicPaymentPagePricingDto]]
    bankAccounts: NotRequired[list[PublicBankAccountDto]]
    url: str


class PublicPaymentPageResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[PublicPaymentPageDto]


class UpdatePaymentPageDto(TypedDict):
    title: NotRequired[str]
    description: NotRequired[str]
    isActive: NotRequired[bool]
    minAmount: NotRequired[float]
    currency: NotRequired[Literal['NGN', 'USD']]
    bankAccountIds: NotRequired[list[str]]
    pricing: NotRequired[list[CreatePaymentPagePricingDto]]
    enableQuantity: NotRequired[bool]


class BankAccountDto(TypedDict):
    id: str
    accountNumber: str
    bankName: str
    accountName: str
    bankCode: str
    nickName: NotRequired[str]
    accountType: NotRequired[Literal['savings', 'current']]
    currency: str
    verified: bool
    default: bool
    createdAt: str
    updatedAt: str


class BankAccountResponseDto(TypedDict):
    success: bool
    message: str
    data: BankAccountDto


class CreateMerchantBankAccountDto(TypedDict):
    accountNumber: str
    bankCode: str
    nickName: NotRequired[str]
    accountType: NotRequired[str]
    isDefault: bool


class GetAllBankAccountsResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[list[BankAccountDto]]
    meta: PaginationMetaDto


class UpdateBankAccountResponseDto(TypedDict):
    success: bool
    message: str
    data: BankAccountDto


class UpdateMerchantBankAccountDto(TypedDict):
    isDefault: NotRequired[bool]
    nickName: NotRequired[str]
    accountType: NotRequired[str]


class BankDto(TypedDict):
    code: str
    name: str
    country: str


class GetBankListResponseDto(TypedDict):
    success: bool
    message: str
    data: list[BankDto]


class DeleteBankAccountResponseDto(TypedDict):
    success: bool
    message: str


class CreateInvoiceDto(TypedDict):
    reference: NotRequired[str]
    amount: float
    currency: Literal['NGN', 'USD']
    description: str
    expiresAt: str
    periodStart: NotRequired[str]
    periodEnd: NotRequired[str]
    nextPaymentDate: NotRequired[str]
    metadata: NotRequired[dict[str, Any]]
    successUrl: NotRequired[str]
    cancelUrl: NotRequired[str]
    asset: NotRequired[str]
    chain: NotRequired[str]
    customer: CreateCustomerNestedDto


class InvoiceResponseDto(TypedDict):
    id: str
    reference: str
    amount: str
    amountPaid: str
    currency: Literal['NGN', 'USD']
    description: NotRequired[str]
    asset: NotRequired[str]
    chain: NotRequired[str]
    status: Literal['pending', 'partial', 'paid', 'expired']
    isRefunded: bool
    state: Literal['open', 'closed']
    expiresAt: NotRequired[str]
    paidAt: NotRequired[str]
    periodStart: NotRequired[str]
    periodEnd: NotRequired[str]
    nextPaymentDate: NotRequired[str]
    metadata: NotRequired[dict[str, Any]]
    successUrl: NotRequired[str]
    cancelUrl: NotRequired[str]
    createdAt: str
    merchant: MerchantInfoDto
    customer: CustomerDto
    url: str


class InvoiceApiResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[InvoiceResponseDto]


class InvoicesResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[list[InvoiceResponseDto]]
    meta: PaginationMetaDto


class CustomerPaidDto(TypedDict):
    amount: str


class FeeDetailsDto(TypedDict):
    amount: str
    paidBy: Literal['customer', 'merchant']


class FeesDto(TypedDict):
    processing: NotRequired[FeeDetailsDto]
    gas: NotRequired[FeeDetailsDto]


class NetAmountDto(TypedDict):
    amount: str


class BalanceTransactionInfoDto(TypedDict):
    reference: str
    status: Literal['pending', 'completed', 'failed', 'cancelled']


class SettlementResponseDto(TypedDict):
    entity: Literal['session', 'invoice']
    reference: str
    requested: NotRequired[RequestedAmountDto]
    currency: Literal['NGN', 'USD']
    gross: GrossAmountDto
    customerPaid: NotRequired[CustomerPaidDto]
    fees: NotRequired[FeesDto]
    net: NotRequired[NetAmountDto]
    balanceDeposit: BalanceTransactionInfoDto


class SettlementListApiResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[list[SettlementResponseDto]]
    meta: PaginationMetaDto


class SettlementApiResponseDto(TypedDict):
    success: bool
    message: str
    data: NotRequired[SettlementResponseDto]


class PaymentWebhookDataDto(TypedDict):
    id: str
    reference: str
    title: NotRequired[str]
    description: NotRequired[str]
    state: Literal['open', 'closed']
    type: Literal['checkout', 'invoice']
    amount: str
    currency: Literal['NGN', 'USD']
    settlements: SettlementsDto
    payment: NotRequired[PaymentResponseDto]
    url: NotRequired[str]
    cancelUrl: NotRequired[str]
    successUrl: NotRequired[str]
    customer: NotRequired[CustomerDto]
    metadata: NotRequired[dict[str, Any]]
    createdAt: str
    expiresAt: str
    completedAt: NotRequired[str]
    transaction: NotRequired[TransactionDto]


class PaymentWebhookEnvelopeDto(TypedDict):
    session: PaymentWebhookDataDto
    failureReason: NotRequired[str]


class PaymentCompletedWebhookDto(TypedDict):
    event: Literal['payment.completed']
    data: PaymentWebhookEnvelopeDto


class PaymentPartialWebhookDto(TypedDict):
    event: Literal['payment.partial']
    data: PaymentWebhookEnvelopeDto


class PaymentExpiredWebhookDto(TypedDict):
    event: Literal['payment.expired']
    data: PaymentWebhookEnvelopeDto


class PaymentUnderpaidWebhookDto(TypedDict):
    event: Literal['payment.underpaid']
    data: PaymentWebhookEnvelopeDto


class TransactionWebhookDataDto(TypedDict):
    session: PaymentWebhookDataDto
    transaction: TransactionDto


class TransactionReceivedWebhookDto(TypedDict):
    event: Literal['transaction.received']
    data: TransactionWebhookDataDto


class TransactionConfirmedWebhookDto(TypedDict):
    event: Literal['transaction.confirmed']
    data: TransactionWebhookDataDto


class InvoiceWebhookPaymentDto(TypedDict):
    asset: NotRequired[str]
    chain: NotRequired[str]
    amount: str
    address: str
    txHash: NotRequired[str]
    explorerUrl: NotRequired[str]
    status: str


class InvoiceWebhookDataDto(TypedDict):
    invoice: InvoiceResponseDto
    payments: NotRequired[list[InvoiceWebhookPaymentDto]]


class InvoiceCreatedWebhookDto(TypedDict):
    event: Literal['invoice.created']
    data: InvoiceWebhookDataDto


class InvoiceUpdatedWebhookDto(TypedDict):
    event: Literal['invoice.updated']
    data: InvoiceWebhookDataDto


class InvoicePaidWebhookDto(TypedDict):
    event: Literal['invoice.paid']
    data: InvoiceWebhookDataDto


class InvoiceExpiredWebhookDto(TypedDict):
    event: Literal['invoice.expired']
    data: InvoiceWebhookDataDto


class PayoutWebhookDataDto(TypedDict):
    payout: PayoutV2Dto


class PayoutCreatedWebhookDto(TypedDict):
    event: Literal['payout.created']
    data: PayoutWebhookDataDto


class PayoutSuccessWebhookDto(TypedDict):
    event: Literal['payout.success']
    data: PayoutWebhookDataDto


class PayoutFailedWebhookDto(TypedDict):
    event: Literal['payout.failed']
    data: PayoutWebhookDataDto


class RefundWebhookDataDto(TypedDict):
    refund: RefundResponseDto


class RefundCreatedWebhookDto(TypedDict):
    event: Literal['refund.created']
    data: RefundWebhookDataDto


class RefundSuccessWebhookDto(TypedDict):
    event: Literal['refund.success']
    data: RefundWebhookDataDto


class RefundFailedWebhookDto(TypedDict):
    event: Literal['refund.failed']
    data: RefundWebhookDataDto
