import { Request as ExpressRequest, Response as ExpressResponse } from 'express';
/* eslint-disable */

export module InfastApi {
  /* eslint-disable */
  /* tslint:disable */
  // @ts-nocheck
  /*
   * ---------------------------------------------------------------
   * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API        ##
   * ##                                                           ##
   * ## AUTHOR: acacode                                           ##
   * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
   * ---------------------------------------------------------------
   */

  type UtilRequiredKeys<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;

  /**
   * Transaction Usage Types (Enum)
   * The type of a Transaction Usage indicates whether the operation comes from a financial transaction (`type = TRANSACTION`) or the use of a credit note (`type = CREDIT_NOTE`).
   */
  export enum TransactionUsageType {
    Transaction = 'TRANSACTION',
    CreditNote = 'CREDIT_NOTE',
  }

  /**
   * Attachment Source (Enum)
   * When sending a document by email you can add attachments.
   *
   * Attachments can be added from multiple sources:
   * - CGV
   * 	 - From [portal](../api-docs/definitions/portal.md) CGV
   * - [portal](../api-docs/definitions/portal.md)
   * - CUSTOMER
   * - ITEM
   * - DOCUMENT
   * - CUSTOM
   * 	 - From local file
   * @example "ITEM"
   */
  export enum EmailAttachmentSource {
    Cgv = 'CGV',
    Portal = 'PORTAL',
    Customer = 'CUSTOMER',
    Item = 'ITEM',
    Document = 'DOCUMENT',
    Custom = 'CUSTOM',
    User = 'USER',
    Project = 'PROJECT',
  }

  /**
   * Percent or Cash (Enum)
   * Defines if the amount is defined in cash or as a percentage.
   * @example "PERCENT"
   */
  export enum PercentOrAmount {
    Percent = 'PERCENT',
    Cash = 'CASH',
  }

  /**
   * Webhook Event (Enum)
   * All events which can be listened
   * @example "invoice.paid"
   */
  export enum WebhookEvent {
    DocumentCreated = 'document.created',
    DocumentUpdated = 'document.updated',
    DocumentDeleted = 'document.deleted',
    CustomerCreated = 'customer.created',
    CustomerDeleted = 'customer.deleted',
    CustomerUpdated = 'customer.updated',
    ItemCreated = 'item.created',
    ItemUpdated = 'item.updated',
    ItemDeleted = 'item.deleted',
    InvoicePaid = 'invoice.paid',
    InvoiceUsageAdded = 'invoice.usage-added',
    InvoiceValidated = 'invoice.validated',
    QuotationValidated = 'quotation.validated',
    QuotationAccepted = 'quotation.accepted',
    QuotationRefused = 'quotation.refused',
    Test = 'test',
  }

  /**
   * Type of the customer
   * @example "consumer"
   */
  export enum CustomerType {
    Consumer = 'consumer',
    Business = 'business',
  }

  /**
   * Email model type (Enum)
   * When you send email you can use a template.
   *
   * This enum defines which email template is used.
   *
   * - USER
   * 	- Template used by default and first email sent to a customer.
   * - PRERELAUNCH
   * 	- Template used when a document will soon be overdue. It's preferable to send an email before the document is overdue. Often customer just forget to pay invoices or accept quotations.
   * - RELAUNCH1
   * 	- Template used when the document is overdue to remind the customer to pay.
   * - RELAUNCH2
   * 	- Template used when the document is overdue and a first relaunch email has already been sent.
   */
  export enum EmailModelType {
    User = 'USER',
    Prerelaunch = 'PRERELAUNCH',
    Relaunch1 = 'RELAUNCH1',
    Relaunch2 = 'RELAUNCH2',
  }

  /**
   * Transaction methods
   * Payment methods used in Transaction. If the payment method is not known by INFast, use `OTHER`. You can add details in details.additionalInformation (for example, `PROMO VOUCHER`)
   */
  export enum TransactionMethod {
    Check = 'CHECK',
    Cash = 'CASH',
    DirectDebit = 'DIRECT_DEBIT',
    Transfer = 'TRANSFER',
    Creditcard = 'CREDITCARD',
    Tip = 'TIP',
    Creditnote = 'CREDITNOTE',
    Other = 'OTHER',
  }

  /**
   * Payment methods (Enum)
   * Invoice payment method. If the desired payment method is not available, use OTHER
   */
  export enum PaymentMethod {
    Check = 'CHECK',
    Cash = 'CASH',
    DirectDebit = 'DIRECT_DEBIT',
    Transfer = 'TRANSFER',
    Creditcard = 'CREDITCARD',
    Tip = 'TIP',
    Unknown = 'UNKNOWN',
    Creditnote = 'CREDITNOTE',
    Other = 'OTHER',
  }

  /**
   * Email sources (Enum)
   * Designates if email is sent by INFast [portal](../api-docs/definitions/portal.md) 'PORTAL' or sent by INBox customer 'CUSTOMER'
   */
  export enum EmailSource {
    Portal = 'PORTAL',
    Customer = 'CUSTOMER',
  }

  /**
   * Subscription recurence
   * Define the subscription mode
   * @example "MONTHLY"
   */
  export enum SubscriptionRecurrence {
    None = 'NONE',
    Monthly = 'MONTHLY',
    Yearly = 'YEARLY',
    BiYearly = 'BI_YEARLY',
  }

  /**
   * Subscription pack
   * Defined which is the selected pack plan
   * @example "FURIOUS"
   */
  export enum SubscriptionPack {
    Pro = 'PRO',
    Furious = 'FURIOUS',
  }

  /**
   * To avoid rounding issues, this specify which reference field to consider for the price: `price`, `amount`, or `amountWithVat`.
   * @default "PRICE"
   * @example "PRICE"
   */
  export enum DocumentLineComputeMethod {
    Price = 'PRICE',
    Amount = 'AMOUNT',
    AmountWith_vat = 'AMOUNT_WITH_VAT',
  }

  /**
   * Type of the line ('ITEM', 'COMMENT' or 'GROUP')
   * For GROUP, only name and lines are used.
   * For COMMENT, only name is used
   * @example "ITEM"
   */
  export enum DocumentLineType {
    Item = 'ITEM',
    Comment = 'COMMENT',
    Group = 'GROUP',
  }

  /**
   * Document Status (Enum)
   * Indicates the status of the Document. [More information on the different statuses here](../api-docs/definitions/document#status).
   */
  export enum DocumentStatus {
    Validated = 'VALIDATED',
    Converted = 'CONVERTED',
    Cancelled = 'CANCELLED',
    Paid = 'PAID',
    Draft = 'DRAFT',
    Accepted = 'ACCEPTED',
    Refused = 'REFUSED',
    Closed = 'CLOSED',
    Archived = 'ARCHIVED',
  }

  /**
   * Document Subtypes Output (Enum)
   * The subtype of the document. [More information on the different subtypes here](../api-docs/definitions/document#subtypes)
   */
  export enum DocumentSubtype {
    Quotation = 'QUOTATION',
    PurchaseOrder = 'PURCHASE_ORDER',
    Invoice = 'INVOICE',
    Deposit = 'DEPOSIT',
    CreditNote = 'CREDIT_NOTE',
    Proforma = 'PROFORMA',
    Situation = 'SITUATION',
    OrderForm = 'ORDER_FORM',
    DeliveryNote = 'DELIVERY_NOTE',
    Custom = 'CUSTOM',
  }

  /**
   * Document Subtypes Input (Enum)
   * Defines the subtype of the document. [More information on the different subtypes here](../api-docs/definitions/document#subtypes)
   */
  export enum DocumentSubtypeInput {
    Quotation = 'QUOTATION',
    Invoice = 'INVOICE',
    Proforma = 'PROFORMA',
  }

  /**
   * Document Types Input (Enum)
   * Defines the type of the new document. [More information on the different types here](../api-docs/definitions/document#types)
   */
  export enum DocumentTypeInput {
    Quotation = 'QUOTATION',
    Invoice = 'INVOICE',
  }

  /**
   * Document Types (Enum)
   * The type of the document. [More information on the different types here](../api-docs/definitions/document#types).
   */
  export enum DocumentType {
    Quotation = 'QUOTATION',
    Invoice = 'INVOICE',
    PurchaseOrder = 'PURCHASE_ORDER',
    Other = 'OTHER',
  }

  /**
   * Customer Schedule (Enum)
   * Possible value for document validity periods
   */
  export enum PaymentSchedule {
    Cash = 'CASH',
    Value7days = '7_DAYS',
    Value15days = '15_DAYS',
    MonthEnd = 'MONTH_END',
    Value30days = '30_DAYS',
    Value30daysmonthend = '30_DAYS_MONTH_END',
    Value45days = '45_DAYS',
    Value45daysmonthend = '45_DAYS_MONTH_END',
    Value60days = '60_DAYS',
    Value60daysmonthend = '60_DAYS_MONTH_END',
    Value90days = '90_DAYS',
    Value90daysmonthend = '90_DAYS_MONTH_END',
    Custom = 'CUSTOM',
  }

  /**
   * Tells if item is a product or a service. More information on that [here](../api-docs/definitions/item#type).
   * @example "PRODUCT"
   */
  export enum ItemType {
    Product = 'PRODUCT',
    Service = 'SERVICE',
  }

  export type DocumentLineOutput =
    | ({
        lineType: 'ITEM';
      } & DocumentLineItemOutput)
    | ({
        lineType: 'COMMENT';
      } & DocumentLineCommentOutput)
    | ({
        lineType: 'GROUP';
      } & DocumentLineGroupOutput);

  export type DocumentLineInput =
    | ({
        lineType: 'ITEM';
      } & DocumentLineItemInput)
    | ({
        lineType: 'COMMENT';
      } & DocumentLineCommentInput)
    | ({
        lineType: 'GROUP';
      } & DocumentLineGroupInput);

  /** User Output Data */
  export interface DataUserOutput {
    data: UserOutput;
  }

  /** User Output */
  export interface UserOutput {
    /** Unique identifier of this resource */
    id: ObjectId;
    /**
     * Fullname of the user
     * @example "Martin DUPOND"
     */
    name: string;
    /**
     * Email address of user
     * @example "martin.dupond@duponsa.com"
     */
    email: string;
    /** Mobile number */
    mobile?: PhoneMobile;
    /** Landline phone number */
    phone?: PhoneLandline;
    /** This model is used throughout all API endpoints to represent a postal address. */
    address?: Address;
    /**
     * Date of this user's account creation
     * @format date-time
     * @example "2023-04-12T19:56:04.311Z"
     */
    creationDate: string;
    /**
     * Date of this user's last connection to INFast
     * @format date-time
     * @example "2023-10-03T15:08:46.174Z"
     */
    lastConnectionDate: string;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
  }

  /**
   * Item Input (Model)
   * Items are used in documents to describe document content.
   *
   * They save all information to allow easy reuse in documents.
   *
   * During document creation you can use existing proctucts and/or override the information if required.
   *
   * Items can represent items or services.
   */
  export interface ItemInput {
    /**
     * Name of the item
     * @maxLength 1024
     * @example "Article 1"
     */
    name: string;
    /**
     * Selling price (without tax) of the item in default currency (Euro)
     * @example 45.96
     */
    price: number;
    /**
     * The default VAT rate applied to this item (Ex, 20%, value = 20)
     * @min 0
     * @max 100
     * @example 20
     */
    vat: number;
    /**
     * Optional description of the item.
     * Displayed under item name in document.
     * @maxLength 8196
     * @example "My beautiful description"
     */
    description?: string;
    /**
     * Reference of the item.
     * Automatically generated if empty during creation.
     * @maxLength 24
     * @example "P-000123"
     */
    reference?: string;
    /** Tells if item is a product or a service. More information on that [here](../api-docs/definitions/item#type). */
    type?: ItemType;
    /**
     * Buying price (without tax) of this item (cost price), allow to compute margin
     * @example 35.74
     */
    buyingPrice?: number;
    /**
     * Sales unit
     * @maxLength 24
     * @example "m"
     */
    unit?: string;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
  }

  /**
   * Item Patch (Model)
   * Updates are applied partailly so you only need to send fields you want update.
   */
  export interface ItemPatch {
    /**
     * Name of the item
     * @maxLength 1024
     * @example "Article 1"
     */
    name?: string;
    /**
     * Selling price (without tax) of the item in default currency (Euro)
     * @example 45.96
     */
    price?: number;
    /**
     * The default VAT rate applied to this item (Ex, 20%, value = 20)
     * @min 0
     * @max 100
     * @example 20
     */
    vat?: number;
    /**
     * Optional description of the item.
     * Displayed under item name in document.
     * @maxLength 8196
     * @example "My beautiful description"
     */
    description?: string;
    /**
     * Reference of the item.
     * Automatically generated if empty during creation.
     * @maxLength 24
     * @example "P-000123"
     */
    reference?: string;
    /** Tells if item is a product or a service. More information on that [here](../api-docs/definitions/item#type). */
    type?: ItemType;
    /**
     * Buying price (without tax) of this item (cost price), allow to compute margin
     * @example 35.74
     */
    buyingPrice?: number;
    /**
     * Sales unit
     * @maxLength 24
     * @example "m"
     */
    unit?: string;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
  }

  /** Item Output Data */
  export interface DataItemOutput {
    /** Describe the complete item model. */
    data: ItemOutput;
  }

  /** Items Array Output Data */
  export interface DataArrayItemOutput {
    data: ItemOutput[];
  }

  /**
   * Item Output
   * Describe the complete item model.
   */
  export interface ItemOutput {
    /** Unique identifier of this resource */
    id: ObjectId;
    /** Unique identifier of the portal ownwing this resource */
    portalId?: PortalId;
    /**
     * Name of the item
     * @maxLength 1024
     * @example "Robinet Mitigeur GH520"
     */
    name: string;
    /** Tells if item is a product or a service. More information on that [here](../api-docs/definitions/item#type). */
    type: ItemType;
    /**
     * Selling price (without tax) of the item in default currency (Euro)
     * @example 45.96
     */
    price: number;
    /**
     * The default VAT rate applied to this item (Ex, 20%, value = 20)
     * @min 0
     * @max 100
     * @example 20
     */
    vat: number;
    /**
     * Buying price (without tax) of this item (cost price), allow to compute margin
     * @example 35.74
     */
    buyingPrice?: number;
    /**
     * Reference of the item.
     * Automatically generated if empty during creation.
     * @maxLength 24
     * @example "P-000123"
     */
    reference: string;
    /**
     * Sales unit
     * @maxLength 24
     * @example "m"
     */
    unit?: string;
    /**
     * Optional description of the item.
     * Displayed under item name in document.
     * @maxLength 8196
     * @example "My beautiful description"
     */
    description?: string;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
    /** List of tags IDs of this entity. */
    tagIds?: TagIds;
    /** Entity last update date. Note: some updates might result from INFast internal workflows and can produce updates that are not transcribed in API. Concretely: you might see, sometimes, `lastUpdate` change without any other change on entity. It means that something internal to INFast has been updated. */
    lastUpdate: LastUpdate;
  }

  /** Customer Creation Input */
  export type CustomerInput = CustomerPatch & {
    /** Full name */
    name: CustomerName;
  };

  /**
   * Customer Patch
   * Customers are used in documents to describe the recipient.
   *
   * During document creation, the recipient information is copied from the customer.
   */
  export interface CustomerPatch {
    /** Full name */
    name?: CustomerName;
    /** This model is used throughout all API endpoints to represent a postal address. */
    address?: Address;
    /** email adress of the customer */
    email?: CustomerEmail;
    /** Mobile number */
    mobile?: PhoneMobile;
    /** Landline phone number */
    phone?: PhoneLandline;
    /** Fax number */
    fax?: PhoneFax;
    /** Reference of the customer. _Automatically generated if empty during creation._ */
    reference?: CustomerReference;
    /** Type of the customer */
    type?: CustomerType;
    /**
     * Information on delivery contact.
     *
     * Documents can have a delivery contact that is different from the customer.
     */
    delivery?: DeliveryContact;
    /** If this field is true, the customer's delivery address is displayed on their documents. */
    useDelivery?: CustomerUseDelivery;
    /** If this field is true, the customer's delivery address is displayed above regular address on their documents. */
    sendToDelivery?: CustomerSendToDelivery;
    /** European intra-Community VAT identifier */
    vatId?: VatId;
    /** French Company identification number (also called "SIRET" in french). */
    siret?: Siret;
    /** Not used anymore by INFast. Indicates if the customer is located outside the Schengen area. If this is the case, VAT does not apply. If the field is set to true, all invoices issued for this customer will be VAT-exempt. If you want to know more about VAT and Shengen area, [checkout EU official website](https://europa.eu/youreurope/business/taxation/vat/vat-rules-rates/index_en.htm). */
    outsideEU?: OutsideEu;
    /** Indicates if the customer is subject to VAT reverse charge. To learn more about this concept, [click here](https://intia.fr/fr/ressources/autoliquidation/) (document in French). If the field is set to true, all invoices issued for this customer will be under VAT reverse charge. */
    reverseCharge?: ReverseCharge;
    /** An account identifier linking customer to the proper Revenue Account into the Chart of Accounts. Typically defined by the Portal's accounting firm for its own needs. In France, it's a 411* account. */
    accountNumber?: AccountNumber;
    /** Invoice payment method. If the desired payment method is not available, use OTHER */
    defaultPaymentMethod?: PaymentMethod;
    /** Possible value for document validity periods */
    defaultScheduleInvoice?: PaymentSchedule;
    /** Possible value for document validity periods */
    defaultScheduleQuotation?: PaymentSchedule;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
  }

  /** Customer Output Data */
  export interface DataCustomerOutput {
    data: CustomerOutput;
  }

  /** Customers Array Output Data */
  export interface DataArrayCustomerOutput {
    data: CustomerOutput[];
  }

  export interface ContactOutput {
    /** Unique identifier of this resource */
    id: ObjectId;
    /**
     * Contact's full name
     * @maxLength 512
     * @example "Contact Name"
     */
    name: string;
    /**
     * Contact's email
     * @maxLength 512
     * @example "contact@domain.com"
     */
    email?: string;
    /** Landline phone number */
    phone?: PhoneLandline;
    /** This model is used throughout all API endpoints to represent a postal address. */
    address?: Address;
    /**
     * Contact's role
     * @maxLength 512
     * @example "Directeur Général"
     */
    role?: string;
  }

  /** Transaction Base Output (without usages) */
  export interface TransactionBaseOutput {
    /** Unique identifier of this resource */
    id: ObjectId;
    /**
     * Unique identifier the customer attached to this transaction
     * @minLength 24
     * @maxLength 24
     * @example "63e3c82675de4f6978054579"
     */
    customerId?: string;
    /**
     * The amount of the transaction indicates its nature: if the amount is positive, it represents a credit to the company (the customer pays money to the company). If the amount is negative, it is a credit to the final customer (the company pays money to the customer).
     * @example 52.5
     */
    amount?: number;
    /**
     * The amount used in this transaction on the documents.
     * @example 40
     */
    usedAmount?: number;
    /**
     * The amount used in this transaction to refund the final customer.
     * @example 12.5
     */
    refundedAmount?: number;
    /**
     * Date of when the transaction was made.
     * @format date-time
     * @example "2024-04-29T19:56:04.311Z"
     */
    date?: string;
    /** Payment methods used in Transaction. If the payment method is not known by INFast, use `OTHER`. You can add details in details.additionalInformation (for example, `PROMO VOUCHER`) */
    method?: TransactionMethod;
    /** Entity last update date. Note: some updates might result from INFast internal workflows and can produce updates that are not transcribed in API. Concretely: you might see, sometimes, `lastUpdate` change without any other change on entity. It means that something internal to INFast has been updated. */
    lastUpdate: LastUpdate;
    /** Details of the transaction */
    details?: {
      /** In case of payment via check, provides the details of the check. */
      check?: {
        /**
         * Emiter of the check
         * @example "Intia SAS"
         */
        emiter?: string;
        /**
         * The bank emitting the check
         * @example "Société Générale"
         */
        bank?: string;
      };
      /**
       * Transaction number (in case of a CHECK transaction: the check number)
       * @example "TR-000123"
       */
      number?: string;
      /**
       * Additionnal informations about the transaction. In case of a BANK transfer, it can be the bank reference.
       * @example "VIR Intia SAS FAC F-201402223"
       */
      additionalInformations?: string;
    };
  }

  /** Transaction Output */
  export type TransactionOutput = UtilRequiredKeys<TransactionBaseOutput, 'id' | 'lastUpdate'> & {
    /** All the Transaction Usage tied to this transaction. */
    usages?: TransactionUsageBaseOutput[];
  };

  /** Transaction Usage Output Data */
  export interface DataTransactionUsageOutput {
    data: TransactionUsageOutput;
  }

  /** Transaction Usage Output Array Data */
  export interface DataArrayTransactionUsageOutput {
    data: TransactionUsageOutput[];
  }

  /** Transaction Usage Base Output (without transaction */
  export interface TransactionUsageBaseOutput {
    /** Unique identifier of this resource */
    id: ObjectId;
    /** The type of a Transaction Usage indicates whether the operation comes from a financial transaction (`type = TRANSACTION`) or the use of a credit note (`type = CREDIT_NOTE`). */
    type: TransactionUsageType;
    /**
     * Unique identifier the customer attached to this transaction usage
     * @minLength 24
     * @maxLength 24
     * @example "63e3c82675de4f6978054579"
     */
    customerId: string;
    /**
     * Date of when the original transaction was made.
     * @format date-time
     * @example "2024-04-29T19:56:04.311Z"
     */
    date: string;
    /**
     * Unique identifier the invoice attached to this transaction usage
     * @minLength 24
     * @maxLength 24
     * @example "63e3c82675de4f6978054579"
     */
    invoiceId?: string;
    /**
     * The amount of the original transaction used.
     * @example 52.5
     */
    amount: number;
  }

  /** Transaction Usage Output */
  export type TransactionUsageOutput = UtilRequiredKeys<
    TransactionUsageBaseOutput,
    'id' | 'customerId' | 'date' | 'invoiceId' | 'amount'
  > &
    (
      | {
          transaction?: TransactionBaseOutput;
        }
      | {
          /**
           * Unique identifier of the Document (of type `INVOICE` and subtype `CREDIT_NOTE`)  attached to this transaction usage
           * @minLength 24
           * @maxLength 24
           * @example "63e3c82675de4f6978054579"
           */
          creditNoteId?: string;
        }
    );

  /** Customer Output (Model) */
  export interface CustomerOutput {
    /** Unique identifier of this resource */
    id: ObjectId;
    /** Unique identifier of the portal ownwing this resource */
    portalId: PortalId;
    /**
     * Full name
     * @example "Paul Berthier"
     */
    name: string;
    /** Type of the customer */
    type?: CustomerType;
    /** This model is used throughout all API endpoints to represent a postal address. */
    address?: Address;
    /** email adress of the customer */
    email?: CustomerEmail;
    /** Mobile number */
    mobile?: PhoneMobile;
    /** Landline phone number */
    phone?: PhoneLandline;
    /** Fax number */
    fax?: PhoneFax;
    /** Reference of the customer. _Automatically generated if empty during creation._ */
    reference: CustomerReference;
    /**
     * Information on delivery contact.
     *
     * Documents can have a delivery contact that is different from the customer.
     */
    delivery?: DeliveryContact;
    /** If this field is true, the customer's delivery address is displayed on their documents. */
    useDelivery?: CustomerUseDelivery;
    /** If this field is true, the customer's delivery address is displayed above regular address on their documents. */
    sendToDelivery?: CustomerSendToDelivery;
    /** European intra-Community VAT identifier */
    vatId?: VatId;
    /** French Company identification number (also called "SIRET" in french). */
    siret?: Siret;
    /** Indicates if the customer is subject to VAT reverse charge. To learn more about this concept, [click here](https://intia.fr/fr/ressources/autoliquidation/) (document in French). If the field is set to true, all invoices issued for this customer will be under VAT reverse charge. */
    reverseCharge?: ReverseCharge;
    /** An account identifier linking customer to the proper Revenue Account into the Chart of Accounts. Typically defined by the Portal's accounting firm for its own needs. In France, it's a 411* account. */
    accountNumber?: AccountNumber;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
    /** List of tags IDs of this entity. */
    tagIds?: TagIds;
    /** Contacts list of this customer */
    contacts?: ContactOutput[];
    /** Entity last update date. Note: some updates might result from INFast internal workflows and can produce updates that are not transcribed in API. Concretely: you might see, sometimes, `lastUpdate` change without any other change on entity. It means that something internal to INFast has been updated. */
    lastUpdate: LastUpdate;
    /** Invoice payment method. If the desired payment method is not available, use OTHER */
    defaultPaymentMethod?: PaymentMethod;
    /** Possible value for document validity periods */
    defaultScheduleInvoice?: PaymentSchedule;
    /** Possible value for document validity periods */
    defaultScheduleQuotation?: PaymentSchedule;
  }

  /**
   * Document Input (Model)
   * Document model used to create a new document.
   */
  export interface DocumentInput {
    /** Defines the type of the new document. [More information on the different types here](../api-docs/definitions/document#types) */
    type: DocumentTypeInput;
    /** Defines the subtype of the document. [More information on the different subtypes here](../api-docs/definitions/document#subtypes) */
    subtype?: DocumentSubtypeInput;
    /**
     * The initial status of the created document. Only DRAFT and VALIDATED are accepted. [More information on the different statuses here](../api-docs/definitions/document#status)
     * @default "VALIDATED"
     * @example "VALIDATED"
     */
    status?: 'VALIDATED' | 'DRAFT';
    /**
     * Identifier of the customer
     * @minLength 24
     * @maxLength 24
     * @example "63e3c82675de4f6978054579"
     */
    customerId: string;
    /**
     * If we the document is for a customer's contact, set the unique identifier of the contact
     * @minLength 24
     * @maxLength 24
     * @example "63e3c82675de4f6978054579"
     */
    contactId?: string;
    /** An optional internal reference for the user company to identify the document. This reference can be defined by the user (and via the API). [More information on references](../api-docs/definitions/document#references) */
    referenceInternal?: DocumentReferenceInternal;
    /**
     * Optional document title
     * Displayed on documents list
     * Not displayed on the PDF
     * Can be use to make search
     * @maxLength 1024
     * @example "Projet global"
     */
    title?: string;
    /** The official issuance date of the Document. Note, this date may differ from the actual creation date of the Document. */
    emitDate?: DocumentEmitDate;
    /** Due date, after this date, the Document is considered late */
    dueDate?: DocumentDueDate;
    /**
     * All documents lines (items, groups or comments)
     * @minItems 1
     */
    lines: DocumentLineInput[];
    /** Invoice payment method. If the desired payment method is not available, use OTHER */
    paymentMethod?: PaymentMethod;
    /**
     * Information displayed on invoice when paymentMethod === OTHER
     * @maxLength 512
     * @example "PayPal"
     */
    paymentMethodInfo?: string;
    /** Global discount applied on document total amount without tax */
    discount?: {
      /** Defines if the amount is defined in cash or as a percentage. */
      type?: PercentOrAmount;
      /**
       * The discount express in percent
       * @min 0
       * @max 100
       */
      percent?: number;
      /**
       * The discount express in currency (discount are always express without taxes)
       * @min 0
       */
      amount?: number;
    };
    /** Global discount gross on this document, VAT is not affected by this discount */
    discountGross?: {
      /** Defines if the amount is defined in cash or as a percentage. */
      type?: PercentOrAmount;
      /**
       * The discount express in percent
       * @min 0
       * @max 100
       */
      percent?: number;
      /**
       * The discount express in currency
       * @min 0
       */
      amount?: number;
      /**
       * Label used to display the discount name (Ex: Prime CEE)
       * @example "Prime CEE"
       */
      label?: string;
    };
    /**
     * If the document has a deposit this field is set.
     * Ex: If this document is a quotation, we want to display a deposit amount
     * If this document is an invoice generated from a quotation with a deposit, this field references the deposit amount
     */
    deposit?: {
      /** Defines if the amount is defined in cash or as a percentage. */
      type?: PercentOrAmount;
      /** The deposit express in percent */
      percent?: number;
      /** The deposit express in currency (set by the user with taxes) */
      amountVat?: number;
      /** Due date, after this date, the Document is considered late */
      dueDate?: DocumentDueDate;
    };
    /**
     * Legal informations on the document.
     * Ex: Law articles in case of VAT exemption.
     * If empty, we check if we need to add a notice.
     * If not empty, we use this string, without check.
     * Exemple of notice computed
     * - TVA non applicable, article 293 B du Code Général des Impôts
     * - Autoliquidation de TVA, article 283 du Code général des impôts
     * - Exonération de TVA, article 262 ter, I du Code général des impôts
     * - Exonération de TVA, article 283-2 du Code général des impôts
     * @maxLength 1024
     * @example "Autoliquidation de TVA, article 283 du Code général des impôts"
     */
    amountNotice?: string;
    /**
     * Used on quotation to override default message on sign zone
     * @maxLength 1024
     * @default "Signature, date et mention "Bon pour accord"
     * Le cas échéant, cachet de l'organisme"
     * @example "Signature, date et mention "Bon pour accord""
     */
    signNotice?: string;
    /**
     * Top message to display on document, can be multi-line
     * @maxLength 8196
     * @example "Pensez à la promotion du mois : ..."
     */
    messageTop?: string;
    /**
     * Bottom message to display on document, can be multi-line
     * @maxLength 8196
     * @example "Description du projet : ..."
     */
    messageBottom?: string;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
  }

  /** Document Output Data */
  export interface DataDocumentOutput {
    /** The properties that are included when fetching a list of documents. */
    data: DocumentOutput;
  }

  /** Document Array Output Data */
  export interface DataArrayDocumentOutput {
    data: DocumentOutput[];
  }

  /**
   * Unique reference of the document, assigned by the INFast server. This reference cannot be modified or defined at creation. [More information on references](../api-docs/definitions/document#references)
   * @maxLength 24
   */
  export type DocumentReference = string;

  /**
   * An optional internal reference for the user company to identify the document. This reference can be defined by the user (and via the API). [More information on references](../api-docs/definitions/document#references)
   * @maxLength 24
   * @example "PROJ-123"
   */
  export type DocumentReferenceInternal = string;

  /**
   * A reference temporarily defined by the INFast application while waiting for synchronization with the server (and thus the generation of a new `reference`). This reference cannot be modified or defined at creation. [More information on references](../api-docs/definitions/document#references)
   * @maxLength 24
   * @example "RT-202403-0012"
   */
  export type DocumentReferenceTemporary = string;

  /**
   * Document Emiter (Model)
   * Description of the document emiter (Company informations)
   * All informations comes from portal during document creation.
   */
  export interface DocumentEmiter {
    /**
     * Company name
     * @maxLength 1024
     * @example "INTIA"
     */
    name: string;
    /** Landline phone number */
    phone?: PhoneLandline;
    /** Fax number */
    fax?: PhoneFax;
    /**
     * Company email.
     * Displayed on document PDF
     * Use to send email
     * @maxLength 1024
     * @example "contact@intia.fr"
     */
    email?: string;
    /**
     * Company website.
     * Displayed on document PDF.
     * @maxLength 1024
     * @example "https://intia.fr"
     */
    website?: string;
    /** This model is used throughout all API endpoints to represent a postal address. */
    address: Address;
    /** European intra-Community VAT identifier */
    vatId?: VatId;
    /**
     * Define if the company is subject to vat
     * @example true
     */
    vatUse: boolean;
    /**
     * SIREN
     * @maxLength 24
     * @example "814 919 106"
     */
    siren?: string;
    /** French Company identification number (also called "SIRET" in french). */
    siret?: Siret;
    /**
     * NAF/APE Code
     * @maxLength 24
     * @example "6201Z"
     */
    naf?: string;
    /**
     * City where the company has been registered.
     * Registre du commerce et des sociétés
     * @maxLength 512
     * @example "Brest"
     */
    rcs?: string;
    /**
     * Legal form of the portal
     * @maxLength 512
     * @example "Société par actions simplifiée"
     */
    legalForm: string;
    /**
     * Information to display on document footer
     * @maxLength 1024
     * @example "En cas de retard de paiement, sera exigible, conformément à l'article L 441-10 du Code de Commerce, une pénalité de retard de 10%, ainsi qu'une indemnité forfaitaire pour frais de recouvrement de 40€.
     * Aucun escompte ne sera accordé en cas de paiement anticipé."
     */
    legalNotice: string;
    /**
     * Capital of the company
     * @min 0
     * @example 65680
     */
    capital?: number;
    /**
     * Company which are not register can create invoice, but they should mention that the registration is in progress
     * @example false
     */
    hasNoSiret: boolean;
    /**
     * If company has no siret, a mention should be displayed on invoice
     * @maxLength 1024
     * @example "Siret en cours d'attribution"
     */
    noSiretMsg: string;
    /**
     * Association registration number.
     * Only for association.
     * @maxLength 512
     * @example "W123456789"
     */
    rna?: string;
    /**
     * RIB, bank information displayed on invoice
     * @maxLength 48
     * @example "12345 12345 12345678901 12"
     */
    rib?: string;
    /**
     * IBAN, bank information displayed on invoice
     * @maxLength 48
     * @example "FR12 1234 1234 1234 1234 1234 123"
     */
    iban?: string;
    /**
     * BIC, bank information displayed on invoice
     * @maxLength 48
     * @example "CMBRFR2BXXX"
     */
    bic?: string;
    /**
     * Name of the bank displayed on invoice
     * @maxLength 512
     * @example "Crédit Mutuel de Bretagne"
     */
    bank?: string;
    /**
     * true if you don't want display logo and initial letter.
     * @example false
     */
    noLogo?: boolean;
    /**
     * Timezone of the portal.
     *  here the list of all possibbles value : https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
     * @maxLength 48
     * @default "Europe/Paris"
     * @example "Europe/Paris"
     */
    timezone?: string;
  }

  /**
   * Document receiptient information
   * All informations come from customer during document creation.
   */
  export interface DocumentReceiver {
    /**
     * Customer name
     * @maxLength 512
     * @example "Customer Name"
     */
    name: string;
    /** This model is used throughout all API endpoints to represent a postal address. */
    address?: Address;
    /** email adress of the customer */
    email?: CustomerEmail;
    /** Landline phone number */
    phone?: PhoneLandline;
    /** Mobile number */
    mobile?: PhoneMobile;
    /** Fax number */
    fax?: PhoneFax;
    /** Customer's contact information */
    toAttention?: {
      /** Unique identifier of this resource */
      id?: ObjectId;
      /**
       * Full name
       * @maxLength 512
       * @example "Alexandre LEGLISE"
       */
      name?: string;
      /** This model is used throughout all API endpoints to represent a postal address. */
      address?: Address;
      /**
       * email of the contact
       * @maxLength 512
       * @example "toAttention@domain.com"
       */
      email?: string;
      /** Mobile number */
      mobile?: PhoneMobile;
      /** Landline phone number */
      phone?: PhoneLandline;
      /**
       * Role of the contact in the customer company
       * @maxLength 512
       * @example "Directeur Général"
       */
      role?: string;
    };
    /**
     * @maxLength 24
     * @example "C-000123"
     */
    reference: string;
    /**
     * Information on delivery contact.
     *
     * Documents can have a delivery contact that is different from the customer.
     */
    delivery?: DeliveryContact;
    /** If this field is true, the customer's delivery address is displayed on their documents. */
    useDelivery?: CustomerUseDelivery;
    /** If this field is true, the customer's delivery address is displayed above regular address on their documents. */
    sendToDelivery?: CustomerSendToDelivery;
    /** European intra-Community VAT identifier */
    vatId?: VatId;
    /** French Company identification number (also called "SIRET" in french). */
    siret?: Siret;
    /** Indicates if the customer is subject to VAT reverse charge. To learn more about this concept, [click here](https://intia.fr/fr/ressources/autoliquidation/) (document in French). If the field is set to true, all invoices issued for this customer will be under VAT reverse charge. */
    reverseCharge?: ReverseCharge;
  }

  /**
   * Document Output (Model)
   * The properties that are included when fetching a list of documents.
   */
  export interface DocumentOutput {
    /** Unique identifier of this resource */
    id: ObjectId;
    /** Unique identifier of the portal ownwing this resource */
    portalId?: PortalId;
    /** Indicates the status of the Document. [More information on the different statuses here](../api-docs/definitions/document#status). */
    status: DocumentStatus;
    /** The type of the document. [More information on the different types here](../api-docs/definitions/document#types). */
    type: DocumentType;
    /** The subtype of the document. [More information on the different subtypes here](../api-docs/definitions/document#subtypes) */
    subtype: DocumentSubtype;
    /**
     * Unique identifier of the user who created the document
     * @minLength 24
     * @maxLength 24
     */
    creatorId: string;
    /**
     * Description of the document emiter (Company informations)
     * All informations comes from portal during document creation.
     */
    from: DocumentEmiter;
    /**
     * Optional document title
     * Displayed on documents list
     * Not displayed on the PDF
     * Can be use to make search
     * @maxLength 1024
     * @example "Facture initiale projet Alpha"
     */
    title?: string;
    /** Unique reference of the document, assigned by the INFast server. This reference cannot be modified or defined at creation. [More information on references](../api-docs/definitions/document#references) */
    reference?: DocumentReference;
    /** A reference temporarily defined by the INFast application while waiting for synchronization with the server (and thus the generation of a new `reference`). This reference cannot be modified or defined at creation. [More information on references](../api-docs/definitions/document#references) */
    referenceTemporary?: DocumentReferenceTemporary;
    /** An optional internal reference for the user company to identify the document. This reference can be defined by the user (and via the API). [More information on references](../api-docs/definitions/document#references) */
    referenceInternal?: DocumentReferenceInternal;
    /** Version of the document. [More information on document versionning here](../api-docs/definitions/document#versionning) */
    version: DocumentVersion;
    /** The official issuance date of the Document. Note, this date may differ from the actual creation date of the Document. */
    emitDate: DocumentEmitDate;
    /** Due date, after this date, the Document is considered late */
    dueDate: DocumentDueDate;
    /**
     * Identifier of the customer bellonging to this document
     * @minLength 24
     * @maxLength 24
     * @example "63e3c82675de4f6978054579"
     */
    customerId: string;
    /**
     * If we the document is for a customer's contact, set the unique identifier of the contact
     * @minLength 24
     * @maxLength 24
     * @example "63e3c82675de4f6978054579"
     */
    contactId?: string;
    /**
     * Document receiptient information
     * All informations come from customer during document creation.
     */
    to: DocumentReceiver;
    /**
     * All documents lines (items, groups or comments)
     * @minItems 1
     */
    lines: DocumentLineOutput[];
    /** Global discount applied on document total amount without tax */
    discount?: {
      /** Defines if the amount is defined in cash or as a percentage. */
      type: PercentOrAmount;
      /**
       * The discount express in percent
       * @min 0
       * @max 100
       */
      percent: number;
      /**
       * The discount express in currency (discount are always express without taxes)
       * @min 0
       */
      amount: number;
    };
    /** Global discount gross on this document, VAT is not affected by this discount */
    discountGross?: {
      /** Defines if the amount is defined in cash or as a percentage. */
      type: PercentOrAmount;
      /**
       * The discount express in percent
       * @min 0
       * @max 100
       */
      percent: number;
      /**
       * The discount express in currency
       * @min 0
       */
      amount: number;
      /**
       * Label used to display the discount name (Ex: Prime CEE)
       * @example "Prime CEE"
       */
      label?: string;
    };
    /**
     * If the document has a deposit this field is set.
     * Ex: If this document is a quotation, we want to display a deposit amount
     * If this document is an invoice generated from a quotation with a deposit, this field references the deposit amount
     */
    deposit?: {
      /** Defines if the amount is defined in cash or as a percentage. */
      type: PercentOrAmount;
      /** The deposit express in percent */
      percent: number;
      /**
       * The deposit express in currency without taxes
       * @min 0
       */
      amount: number;
      /** The deposit express in currency (set by the user with taxes) */
      amountVat?: number;
      /** Part of vat on the deposit invoice, needed to recompte VATs on this invoice */
      vats?: {
        /**
         * The vat rate on the deposit (Ex, 20%, value = 20)
         * @min 0
         * @max 100
         * @example 20
         */
        vat: number;
        /**
         * Sums of amount without tax
         * @min 0
         */
        amount: number;
      }[];
      /** Due date, after this date, the Document is considered late */
      dueDate?: DocumentDueDate;
      /**
       * Identifier of the deposit invoice
       * @minLength 24
       * @maxLength 24
       */
      invoiceId?: string;
      /** Unique reference of the document, assigned by the INFast server. This reference cannot be modified or defined at creation. [More information on references](../api-docs/definitions/document#references) */
      reference?: DocumentReference;
      /** A reference temporarily defined by the INFast application while waiting for synchronization with the server (and thus the generation of a new `reference`). This reference cannot be modified or defined at creation. [More information on references](../api-docs/definitions/document#references) */
      referenceTemporary?: DocumentReferenceTemporary;
      /**
       * Identifier of the quotation which generate the deposit
       * @minLength 24
       * @maxLength 24
       */
      originalQuotationId?: string;
      /** Unique reference of the document, assigned by the INFast server. This reference cannot be modified or defined at creation. [More information on references](../api-docs/definitions/document#references) */
      originalQuotationReference?: DocumentReference;
      /** A reference temporarily defined by the INFast application while waiting for synchronization with the server (and thus the generation of a new `reference`). This reference cannot be modified or defined at creation. [More information on references](../api-docs/definitions/document#references) */
      originalQuotationReferenceTemporary?: DocumentReferenceTemporary;
      /**
       * Deposit percent of the quotation which generate the deposit
       * @min 0
       * @max 100
       */
      originalQuotationDepositPercent?: number;
      /**
       * Date when the deposit was paid
       * @format date-time
       */
      paidDate?: string;
    };
    /**
     * The sum of the amounts (without VAT) of all lines, without taking into account any potential global discount.
     * @min 0
     */
    amount: number;
    /**
     * The sum of the amounts (without VAT) of all lines, including any potential global discount.
     * @min 0
     */
    amountNet: number;
    /**
     * List of all vat used
     * Compute according to document's lines and discount
     */
    vatSummary?: {
      /**
       * The vat rate value (Ex, 20%, value = 20)
       * @min 0
       * @max 100
       * @example 20
       */
      vat: number;
      /**
       * Sums of vat part after global discount.
       * Ex: If thesums of all items sells at 20% is 1000€ without tax, value is 200
       * @min 0
       */
      vatPart: number;
      /**
       * Sums of amount without tax after global discount.
       * Ex: If the sums of all items sells at 20% is 1000€ without tax, value is 1000
       * @min 0
       */
      amount: number;
    }[];
    /** The total amount of the line including taxes and taking into account potential discount. */
    amountVat: DocumentAmountVat;
    /** The net amount payable (total with taxes) for the document. This is the `amountVat` minus the amount of any deposit already paid. */
    amountVatNet: DocumentAmountVatNet;
    /**
     * Margin of this document, in percentage
     * Compute according to document's lines
     */
    margin?: number;
    /**
     * Margin of this document, in currency
     * Compute according to document's lines
     */
    profit?: number;
    /** Invoice payment method. If the desired payment method is not available, use OTHER */
    paymentMethod?: PaymentMethod;
    /**
     * Information displayed on invoice when paymentMethod === OTHER
     * @maxLength 512
     * @example "PayPal"
     */
    paymentMethodInfo?: string;
    /**
     * Date when the customer accept the quotation
     * Only for quotation
     * @format date-time
     */
    acceptedDate?: string;
    /**
     * Date when the customer refuse the quotation
     * Only for quotation
     * @format date-time
     */
    refusedDate?: string;
    /**
     * Date when the customer fully paid the invoice
     * @format date-time
     */
    paidDate?: string;
    /** The sum of all payments on this invoice */
    totalPayments?: number;
    /**
     * Legal informations on the document.
     * Ex: Law articles in case of VAT exemption.
     * If empty, we check if we need to add a notice.
     * If not empty, we use this string, without check.
     * Exemple of notice computed
     * - TVA non applicable, article 293 B du Code Général des Impôts
     * - Autoliquidation de TVA, article 283 du Code général des impôts
     * - Exonération de TVA, article 262 ter, I du Code général des impôts
     * - Exonération de TVA, article 283-2 du Code général des impôts
     * @maxLength 1024
     * @example "Autoliquidation de TVA, article 283 du Code général des impôts"
     */
    amountNotice?: string;
    /**
     * Used on quotation to override default message on sign zone
     * @maxLength 1024
     * @default "Signature, date et mention "Bon pour accord"
     * Le cas échéant, cachet de l'organisme"
     * @example "Signature, date et mention "Bon pour accord""
     */
    signNotice?: string;
    /**
     * Top message to display on document, can be multi-line
     * @maxLength 8196
     * @example "Pensez à la promotion du mois : ..."
     */
    messageTop?: string;
    /**
     * Bottom message to display on document, can be multi-line
     * @maxLength 8196
     * @example "Description du projet : ..."
     */
    messageBottom?: string;
    /** If the document is a creditNote and is created from a previous invoice, this object should be set */
    creditNoteFromInvoice?: {
      /**
       * The unique identifier of the invoice that created this creditnote
       * @minLength 24
       * @maxLength 24
       */
      documentId: string;
      /**
       * The reference of the invoice that created this creditnote
       * @maxLength 24
       */
      reference: string;
      /** The net amount payable (total with taxes) for the document. This is the `amountVat` minus the amount of any deposit already paid. */
      amountVatNet: DocumentAmountVatNet;
    };
    /** List of creditNotes generated from this invoice */
    creditNotesId?: {
      /**
       * Identifier of the credit note
       * @minLength 24
       * @maxLength 24
       */
      documentId: string;
      /** @maxLength 24 */
      reference: string;
      /** The net amount payable (total with taxes) for the document. This is the `amountVat` minus the amount of any deposit already paid. */
      amountVatNet: DocumentAmountVatNet;
      /** true if the credit note refund the customer, else false or empty */
      refund?: boolean;
    }[];
    /**
     * Reference the previous document.
     * Ex: if this document is an invoice, prevDoc can be a quotation.
     * Or if this document is a quotation version 1.1, the previous document is the quotation version 1.0
     */
    prevDoc?: {
      /**
       * Identifier of the previous document
       * @minLength 24
       * @maxLength 24
       */
      documentId: string;
      /**
       * Reference of the previous document
       * @maxLength 24
       */
      reference: string;
      /** An optional internal reference for the user company to identify the document. This reference can be defined by the user (and via the API). [More information on references](../api-docs/definitions/document#references) */
      referenceInternal?: DocumentReferenceInternal;
      /** Version of the document. [More information on document versionning here](../api-docs/definitions/document#versionning) */
      version: DocumentVersion;
      /** The type of the document. [More information on the different types here](../api-docs/definitions/document#types). */
      type: DocumentType;
      /** The subtype of the document. [More information on the different subtypes here](../api-docs/definitions/document#subtypes) */
      subtype: DocumentSubtype;
      /** Indicates the status of the Document. [More information on the different statuses here](../api-docs/definitions/document#status). */
      status: DocumentStatus;
      /** The official issuance date of the Document. Note, this date may differ from the actual creation date of the Document. */
      emitDate: DocumentEmitDate;
      /** Due date, after this date, the Document is considered late */
      dueDate: DocumentDueDate;
      /** @min 0 */
      amount: number;
      /** @min 0 */
      amountNet: number;
      /** @min 0 */
      amountVat: number;
      /** The net amount payable (total with taxes) for the document. This is the `amountVat` minus the amount of any deposit already paid. */
      amountVatNet: DocumentAmountVatNet;
      /**
       * Identifier of the previous document of this previous document
       * @minLength 24
       * @maxLength 24
       */
      prevDocId?: string;
    };
    /**
     * Reference the next document.
     * Ex: If this document is a quotation, the next document can be an invoice
     */
    nextDoc?: {
      /**
       * @minLength 24
       * @maxLength 24
       */
      documentId: string;
      /** @maxLength 24 */
      reference?: string;
      /** A reference temporarily defined by the INFast application while waiting for synchronization with the server (and thus the generation of a new `reference`). This reference cannot be modified or defined at creation. [More information on references](../api-docs/definitions/document#references) */
      referenceTemporary?: DocumentReferenceTemporary;
      /** Version of the document. [More information on document versionning here](../api-docs/definitions/document#versionning) */
      version: DocumentVersion;
    };
    /**
     * The situation number (start at 1)
     * @min 1
     */
    situationNumber?: number;
    /**
     * When a situation invoice is created, we create a project which contains all documents of the situation.
     * Quotation, Deposit note, situation 1, situation 2, ...
     * @minLength 24
     * @maxLength 24
     */
    projectId?: string;
    /** List of messages sent about this document */
    messages?: DocumentMessage[];
    /** When accountant lock a period, the document is not editable. */
    uneditable?: boolean;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
    /** Entity last update date. Note: some updates might result from INFast internal workflows and can produce updates that are not transcribed in API. Concretely: you might see, sometimes, `lastUpdate` change without any other change on entity. It means that something internal to INFast has been updated. */
    lastUpdate: LastUpdate;
  }

  /** Document Line Item Pricing */
  export interface DocumentLineItemPricing {
    /** To avoid rounding issues, this specify which reference field to consider for the price: `price`, `amount`, or `amountWithVat`. */
    computeMethod?: DocumentLineComputeMethod;
    /**
     * Unitary price (excluding VAT). *Should be defined when computeMethod = PRICE (or empty)*
     * @example 45.25
     */
    price?: number;
    /**
     * VAT rate (Ex, 20%, value = 20)
     * @min 0
     * @max 100
     * @example 20
     */
    vat?: number;
    /**
     * Discount of this line expressed in percent
     * @min 0
     * @max 100
     * @example 10
     */
    discount?: number;
    /**
     * Quantity sold
     * @min 0
     * @example 4
     */
    quantity?: number;
    /**
     * Total price (including VAT) of the line (will not be multiplied by quantity). *Should be defined when computeMethod = AMOUNT_WITH_VAT (or empty)*
     * @example 45.25
     */
    amountWithVat?: number;
    /**
     * Total price (excluding VAT) of the line (will not be multiplied by quantity). *Should be defined when computeMethod = AMOUNT (or empty)*
     * @example 45.25
     */
    amount?: number;
  }

  /** Document Line Item Reuse Input */
  export interface DocumentLineItemReuse {
    /** @example "ITEM" */
    lineType: 'ITEM';
    /**
     * Identifier of the item
     * @minLength 1
     * @example "63e3c82675de4f6978054579"
     */
    itemId: string;
    /**
     * Description of the item
     * @maxLength 8196
     * @example "My beautiful description"
     */
    description?: string;
    /**
     * Item's reference
     * @minLength 1
     * @example "P-000123"
     */
    reference?: string;
    /**
     * Buying price without tax (used to compute margin and profit)
     * @example 30.9
     */
    buyingPrice?: number;
    /**
     * Item's unit
     * @example "m"
     */
    unit?: string;
    /** To avoid rounding issues, this specify which reference field to consider for the price: `price`, `amount`, or `amountWithVat`. */
    computeMethod?: DocumentLineComputeMethod;
    /**
     * Unitary price (excluding VAT). *Should be defined when computeMethod = PRICE (or empty)*
     * @example 45.25
     */
    price?: number;
    /**
     * VAT rate (Ex, 20%, value = 20)
     * @min 0
     * @max 100
     * @example 20
     */
    vat?: number;
    /**
     * Discount of this line expressed in percent
     * @min 0
     * @max 100
     * @example 10
     */
    discount?: number;
    /**
     * Quantity sold
     * @min 0
     * @example 4
     */
    quantity?: number;
    /**
     * Total price (including VAT) of the line (will not be multiplied by quantity). *Should be defined when computeMethod = AMOUNT_WITH_VAT (or empty)*
     * @example 45.25
     */
    amountWithVat?: number;
    /**
     * Total price (excluding VAT) of the line (will not be multiplied by quantity). *Should be defined when computeMethod = AMOUNT (or empty)*
     * @example 45.25
     */
    amount?: number;
  }

  /** Document Line Item Create Input */
  export interface DocumentLineItemCreate {
    /** @example "ITEM" */
    lineType: 'ITEM';
    /**
     * Items's name
     * @minLength 1
     * @example "Radiateur D 500"
     */
    name: string;
    /**
     * Description of the Item
     * @maxLength 8196
     * @example "Radiateur electrique - 500W"
     */
    description?: string;
    /**
     * Item's reference
     * @minLength 1
     * @example "P-000123"
     */
    reference?: string;
    /** Tells if item is a product or a service. More information on that [here](../api-docs/definitions/item#type). */
    type?: ItemType;
    /**
     * Buying price without tax (used to compute margin and profit)
     * @example 30.9
     */
    buyingPrice?: number;
    /**
     * Item's unit (if applies)
     * @example "m"
     */
    unit?: string;
    /** Set to true, if you don't want to save this item in database. It will be used on this document, but not stored in Portal's Items database. */
    phantom?: boolean;
    /** To avoid rounding issues, this specify which reference field to consider for the price: `price`, `amount`, or `amountWithVat`. */
    computeMethod?: DocumentLineComputeMethod;
    /**
     * Unitary price (excluding VAT). *Should be defined when computeMethod = PRICE (or empty)*
     * @example 45.25
     */
    price: number;
    /**
     * VAT rate (Ex, 20%, value = 20)
     * @min 0
     * @max 100
     * @example 20
     */
    vat: number;
    /**
     * Discount of this line expressed in percent
     * @min 0
     * @max 100
     * @example 10
     */
    discount?: number;
    /**
     * Quantity sold
     * @min 0
     * @example 4
     */
    quantity?: number;
    /**
     * Total price (including VAT) of the line (will not be multiplied by quantity). *Should be defined when computeMethod = AMOUNT_WITH_VAT (or empty)*
     * @example 45.25
     */
    amountWithVat?: number;
    /**
     * Total price (excluding VAT) of the line (will not be multiplied by quantity). *Should be defined when computeMethod = AMOUNT (or empty)*
     * @example 45.25
     */
    amount?: number;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
  }

  export type DocumentLineItemInput = DocumentLineItemReuse | DocumentLineItemCreate;

  /** Document Line Item Output */
  export interface DocumentLineItemOutput {
    /** @example "ITEM" */
    lineType: 'ITEM';
    /**
     * Item's name
     * @minLength 1
     * @example "Radiateur à eau T223"
     */
    name: string;
    /**
     * Identifier of the item, only required in case an existing item is used
     * @minLength 1
     * @example "63e3c82675de4f6978054579"
     */
    itemId: string;
    /**
     * Description of the item
     * @maxLength 8196
     * @example "My beautiful description"
     */
    description: string;
    /**
     * Item's reference
     * @minLength 1
     * @example "P-000123"
     */
    reference: string;
    /** Tells if item is a product or a service. More information on that [here](../api-docs/definitions/item#type). */
    type: ItemType;
    /**
     * Price excluding VAT
     * @example 45.25
     */
    price: number;
    /**
     * Buying price without tax (used to compute margin and profit)
     * @example 30.9
     */
    buyingPrice?: number;
    /**
     * Item's unit
     * @example "m"
     */
    unit?: string;
    /**
     * Quantity sold
     * @min 0
     * @example 4
     */
    quantity: number;
    /**
     * VAT rate (Ex, 20%, value = 20)
     * @min 0
     * @max 100
     * @example 20
     */
    vat: number;
    /**
     * Discount of this line expressed in percent
     * @min 0
     * @max 100
     * @example 10
     */
    discount: number;
    /** To avoid rounding issues, this specify which reference field to consider for the price: `price`, `amount`, or `amountWithVat`. */
    computeMethod: DocumentLineComputeMethod;
    /** Set to true, if you don't want to save this item in database */
    phantom: boolean;
    /**
     * Total amount without tax (price * quantity).
     * @example 181
     */
    amount: number;
    /** The total amount of the line including taxes and taking into account potential discount. */
    amountVat: DocumentAmountVat;
    /**
     * VAT part. For example if the item is sold 100€ with 20% VAT, vatPart value is 20)
     * @example 36.2
     */
    vatPart: number;
    /**
     * Only use on situation invoice.
     * True if this line was not on quotation and not on a previous situation
     * @example false
     */
    isNewLine: boolean;
    /**
     * Only used on situation invoice
     * Describes the progress of the line for the current situation invoice
     */
    progress?: DocumentLineProgress;
    /**
     * Only used on situation invoice
     * Describes the progress of the line for the current situation invoice
     */
    previousProgress?: DocumentLineProgress;
  }

  /** Document Line Comment Input */
  export interface DocumentLineCommentInput {
    /** @example "COMMENT" */
    lineType: 'COMMENT';
    /**
     * The comment to display on the document
     * @maxLength 8196
     * @example "My beautiful comment"
     */
    name: string;
  }

  /** Document Line Comment Input */
  export interface DocumentLineCommentOutput {
    /** @example "COMMENT" */
    lineType: 'COMMENT';
    /**
     * The comment to display on the document
     * @maxLength 8196
     * @example "My beautiful comment"
     */
    name: string;
    /**
     * Only use on situation invoice.
     * True if this line was not on quotation and not on a previous situation
     * @example false
     */
    isNewLine?: boolean;
  }

  /** Document Line Group Input */
  export interface DocumentLineGroupInput {
    /**
     * Group displayed name
     * @example "Materiaux"
     */
    name: string;
    /** @example "GROUP" */
    lineType: 'GROUP';
    /** @minItems 1 */
    lines: (DocumentLineItemInput | DocumentLineCommentInput)[];
  }

  /** Document Line Group Output */
  export interface DocumentLineGroupOutput {
    /** @example "GROUP" */
    lineType: 'GROUP';
    /**
     * Group displayed name
     * @example "Materiaux"
     */
    name?: string;
    /**
     * Only use on situation invoice.
     * True if this line was not on quotation and not on a previous situation
     * @example false
     */
    isNewLine?: boolean;
    /** @minItems 1 */
    lines?: (DocumentLineItemOutput | DocumentLineCommentOutput)[];
  }

  /**
   * Only used on situation invoice
   * Describes the progress of the line for the current situation invoice
   */
  export interface DocumentLineProgress {
    /**
     * Advancement express in percent
     * @min 0
     * @max 100
     * @example 25
     */
    percentage: number;
    /**
     * Advancement express in quantity
     * @min 0
     * @example 1
     */
    quantity: number;
    /**
     * Advancement express in amount
     * @example 45.25
     */
    amount: number;
    /**
     * Need know what the user set
     * 1 = percentage
     * 2 = quantity
     * 3 = amount
     * @min 1
     * @max 3
     * @example 1
     */
    progressType: number;
  }

  /** Document message Data */
  export interface DataDocumentMessage {
    /** Object in document.historyEmails */
    data: DocumentMessage;
  }

  /** Document Array message */
  export interface DataArrayDocumentMessage {
    data: DocumentMessage[];
  }

  /**
   * Document Message (Inner Model)
   * Object in document.historyEmails
   */
  export interface DocumentMessage {
    /** Unique identifier of this resource */
    id?: ObjectId;
    /**
     * When you send email you can use a template.
     *
     * This enum defines which email template is used.
     *
     * - USER
     * 	- Template used by default and first email sent to a customer.
     * - PRERELAUNCH
     * 	- Template used when a document will soon be overdue. It's preferable to send an email before the document is overdue. Often customer just forget to pay invoices or accept quotations.
     * - RELAUNCH1
     * 	- Template used when the document is overdue to remind the customer to pay.
     * - RELAUNCH2
     * 	- Template used when the document is overdue and a first relaunch email has already been sent.
     */
    model?: EmailModelType;
    /**
     * The sender email address.
     * Should be one of INFast's user
     * @maxLength 1024
     * @example "contact@intia.fr"
     */
    from?: string;
    /**
     * Emails list of recipient (separated by semicolon)
     * @maxLength 1024
     * @example "customer@domain.com"
     */
    to?: string;
    /**
     * Emails list to send in copy (separated by semicolon)
     * @maxLength 1024
     * @example "copy1@domain.com;copy2@domain.com"
     */
    cc?: string;
    /**
     * Email subject
     * @maxLength 1024
     * @example "[INTIA] Votre facture F-000123"
     */
    subject?: string;
    /**
     * Email body
     * @maxLength 8192
     * @example "Bonjour,\\n\\nJe vous prie de bien vouloir trouver votre facture en date du 26 septembre 2021.\\n\\nVous en souhaitant bonne réception, merci de votre confiance.\\n\\nCordialement,\\n\\nMartin DUPOND"
     */
    message?: string;
    /**
     * Date when the email is send (need synchro with server).
     * @format date-time
     */
    send?: string;
    /**
     * Date when the customer see this email
     * @format date-time
     */
    view?: string;
    /** Designates if email is sent by INFast [portal](../api-docs/definitions/portal.md) 'PORTAL' or sent by INBox customer 'CUSTOMER' */
    source?: EmailSource;
    /** List of email attachments */
    attachments?: EmailAttachment[];
    /** INBox url to visualize the message */
    inboxUrl?: string;
  }

  /** Describes an email attachments */
  export interface EmailAttachment {
    /**
     * Attachment file name
     * @maxLength 512
     * @example "Fiche technique article.pdf"
     */
    filename?: string;
    /**
     * @minLength 24
     * @maxLength 24
     * @example "63e3c82675de4f6978054579"
     */
    attachmentId?: string;
    /**
     * Size of the file in byte
     * @min 0
     * @example 23456
     */
    size?: number;
    /**
     * When sending a document by email you can add attachments.
     *
     * Attachments can be added from multiple sources:
     * - CGV
     * 	 - From [portal](../api-docs/definitions/portal.md) CGV
     * - [portal](../api-docs/definitions/portal.md)
     * - CUSTOMER
     * - ITEM
     * - DOCUMENT
     * - CUSTOM
     * 	 - From local file
     */
    source?: EmailAttachmentSource;
  }

  /**
   * The total amount of the line including taxes and taking into account potential discount.
   * @min 0
   * @example 1456.23
   */
  export type DocumentAmountVat = number;

  /**
   * The net amount payable (total with taxes) for the document. This is the `amountVat` minus the amount of any deposit already paid.
   * @min 0
   */
  export type DocumentAmountVatNet = number;

  /** Transaction Output Data */
  export interface DataTransactionOutput {
    data: TransactionOutput;
  }

  /** Transaction Output Array Data */
  export interface DataArrayTransactionOutput {
    data: TransactionOutput[];
  }

  /**
   * Transaction Input (Model)
   * Model to pay an invoice.
   *
   * Default transaction method is "CREDITCARD".
   */
  export interface TransactionInput {
    /** Payment methods used in Transaction. If the payment method is not known by INFast, use `OTHER`. You can add details in details.additionalInformation (for example, `PROMO VOUCHER`) */
    method?: TransactionMethod;
    /**
     * Amount of the transaction.
     *
     * If not set, the transaction amount will have the invoice rest amount to fully pay the invoice.
     * @min 0
     * @example 1456.23
     */
    amount?: number;
    /**
     * The date of the actual transaction. If not set, INFast use the current date.
     * @format date-time
     * @example "2025-12-30T10:00:00.000Z"
     */
    date?: string;
    /**
     * Emitter name
     *
     * Additionnal information on transaction. Often use with check transaction method
     * @example "Customer Name"
     */
    emitter?: string;
    /**
     * Bank name
     *
     * Additionnal information on transaction. Often use with check transaction method
     * @example "Crédit Agricole"
     */
    bank?: string;
    /**
     * Additionnal information on transaction. Often use with check or transfert transaction method
     * @example "123456789"
     */
    number?: string;
    /**
     * Additionnal information on transaction.
     *
     * Displayed on invoice for transaction method type "OTHER"
     *
     * Exemple, we can set "Paypal" as information
     * @example "PayPal"
     */
    info?: string;
  }

  /**
   * Message Input (Model)
   * Template used to send document by email
   */
  export interface MessageInput {
    /**
     * Use user email by default.
     *
     * You can override this default email by setting another email, but email should be either the [portal](../api-docs/definitions/portal.md) email, either a user's email
     * @example "contact@intia.fr"
     */
    from?: string;
    /**
     * If set send email to these email list and ignore customer email.
     *
     * To set multiple emails, separate emails by semicolons
     * @example "customer@domain.com"
     */
    to?: string;
    /**
     * To set multiple emails, separate emails by semicolons
     * @example "copy1@domain.com;copy2@domain.com"
     */
    cc?: string;
    /**
     * When you send email you can use a template.
     *
     * This enum defines which email template is used.
     *
     * - USER
     * 	- Template used by default and first email sent to a customer.
     * - PRERELAUNCH
     * 	- Template used when a document will soon be overdue. It's preferable to send an email before the document is overdue. Often customer just forget to pay invoices or accept quotations.
     * - RELAUNCH1
     * 	- Template used when the document is overdue to remind the customer to pay.
     * - RELAUNCH2
     * 	- Template used when the document is overdue and a first relaunch email has already been sent.
     */
    model?: EmailModelType;
    /**
     * If not set, use subject configured in model
     * @example "[INTIA] Votre facture F-000123"
     */
    subject?: string;
    /**
     * If not set, use message configured in model
     * @example "Bonjour,\n\nJe vous prie de bien vouloir trouver votre facture en date du 26 septembre 2021.\n\nVous en souhaitant bonne réception, merci de votre confiance.\n\nCordialement,\n\nMartin DUPOND"
     */
    message?: string;
  }

  /** Portal Patch (Model) */
  export interface PortalPatch {
    /** Enterprise details */
    enterprise?: {
      /**
       * Company name
       * @maxLength 1024
       * @example "INTIA"
       */
      name?: string;
      /** Landline phone number */
      phone?: PhoneLandline;
      /** Fax number */
      fax?: PhoneFax;
      /**
       * Company email.
       * Displayed on document PDF
       * Use to send email
       * @maxLength 1024
       * @example "contact@intia.fr"
       */
      email?: string;
      /**
       * Company website.
       * Displayed on document PDF.
       * @maxLength 1024
       * @example "https://intia.fr"
       */
      website?: string;
      /** This model is used throughout all API endpoints to represent a postal address. */
      address?: Address;
      /** European intra-Community VAT identifier */
      vatId?: VatId;
      /** Indicates if the Customer is subject to VAT. [This official article](https://entreprendre.service-public.fr/vosdroits/N13445) (in French) explains who may not be subject to VAT. */
      vatUse?: VatUse;
      /**
       * SIREN
       * @maxLength 48
       * @example "814 919 106"
       */
      siren?: string;
      /** French Company identification number (also called "SIRET" in french). */
      siret?: Siret;
      /**
       * NAF/APE Code
       * @maxLength 24
       * @example "6201Z"
       */
      naf?: string;
      /**
       * City where the company has been registered.
       * Registre du commerce et des sociétés
       * @maxLength 512
       * @example "Brest"
       */
      rcs?: string;
      /**
       * Legal form of the [portal](../api-docs/definitions/portal.md)
       * @maxLength 512
       * @example "Société par actions simplifiée"
       */
      legalForm?: string;
      /**
       * Information to display on document footer
       * @maxLength 1024
       * @example "En cas de retard de paiement, sera exigible, conformément à l'article L 441-10 du Code de Commerce, une pénalité de retard de 10%, ainsi qu'une indemnité forfaitaire pour frais de recouvrement de 40€.
       * Aucun escompte ne sera accordé en cas de paiement anticipé."
       */
      legalNotice?: string;
      /**
       * Capital of the company
       * @min 0
       * @example 65680
       */
      capital?: number;
      /**
       * Company which are not register can create invoice, but they should mention that the registration is in progress
       * @example false
       */
      hasNoSiret?: boolean;
      /**
       * If company has no siret, a mention should be displayed on invoice
       * @maxLength 1024
       * @example "Siret en cours d'attribution"
       */
      noSiretMsg?: string;
      /**
       * Association registration number.
       * Only for association.
       * @maxLength 48
       * @example "W123456789"
       */
      rna?: string;
      /**
       * RIB, bank information displayed on invoice
       * @maxLength 48
       * @example "12345 12345 12345678901 12"
       */
      rib?: string;
      /**
       * IBAN, bank information displayed on invoice
       * @maxLength 48
       * @example "FR12 1234 1234 1234 1234 1234 123"
       */
      iban?: string;
      /**
       * BIC, bank information displayed on invoice
       * @maxLength 48
       * @example "CMBRFR2BXXX"
       */
      bic?: string;
      /**
       * Name of the bank displayed on invoice
       * @maxLength 512
       * @example "Crédit Mutuel de Bretagne"
       */
      bank?: string;
      /**
       * true if you don't want display logo and initial letter.
       * @example false
       */
      noLogo?: boolean;
    };
    /** Default email model use during send emails */
    modelEmail?: {
      /** Model use by default. During first email send to a customer. */
      user?: {
        /**
         * Email subject
         * @maxLength 512
         * @example "[{company.name}] Votre {document.type} {document.reference}"
         */
        subject?: string;
        /**
         * Email message
         * @maxLength 8196
         * @example "Bonjour,\n\nJe vous prie de bien vouloir trouver votre {document.type} en date du {document.date}.\n\nVous en souhaitant bonne réception, merci de votre confiance.\n\nCordialement,\n\n{user.name}"
         */
        message?: string;
      };
      /** Model use when the document is soon late. It's preferable to send an email before the document is late. Customer just can ommit to pay invoice or accept quotation. */
      preRelaunch?: {
        /**
         * Email subject
         * @maxLength 512
         * @example "[{company.name}] Votre {document.type} {document.reference}"
         */
        subject?: string;
        /**
         * Email message
         * @maxLength 8196
         * @example "Bonjour,\n\nNous nous permettons de vous contacter afin de vous signaler que votre {document.type} arrive bientôt à échéance.\n\nNous vous prions de bien vouloir faire le nécessaire dans les meilleurs délais. Nous attendons votre retour.\n\nSi vous avez déjà traité ce document, nous vous prions de ne pas tenir compte de cette pré-relance.\n\nCordialement, \n\n{user.name}"
         */
        message?: string;
      };
      /** Model use when the document is late to encourage customer to pay. */
      relaunch1?: {
        /**
         * Email subject
         * @maxLength 512
         * @example "[{company.name}] Votre {document.type} {document.reference}"
         */
        subject?: string;
        /**
         * Email message
         * @maxLength 8196
         * @example "Bonjour,\n\nNous nous permettons de vous contacter afin de vous signaler que nous n'avons toujours pas reçu le règlement de la facture en date du {document.date}.\n\nNous vous prions de nous adresser votre paiement dans les meilleurs délais.\n\nDans cette attente, veuillez recevoir, Madame, Monsieur, l'expression de nos sincères salutations.\n\nDans le cas où le règlement de votre {document.type} aurait été adressé entre temps, nous vous prions de ne pas tenir compte de cette relance.\n\nCordialement, \n\n{user.name}"
         */
        message?: string;
      };
      /** Model use when the document is late and a first relaunch email was been sent. */
      relaunch2?: {
        /**
         * Email subject
         * @maxLength 512
         * @example "[{company.name}] Votre {document.type} {document.reference}"
         */
        subject?: string;
        /**
         * Email message
         * @maxLength 8196
         * @example "Bonjour,\n\nEn dépit de notre relance précédente, nous constatons que vous nous êtes toujours redevable du règlement de la facture en date du {document.date}.\n\nNous vous prions de nous adresser votre paiement dans les 8 jours à compter de la réception des présentes.\n\nSans réponse de votre part dans le délai imparti, nous nous verrons  dans l'obligation de faire valoir ce que de droit.\n\nDans cette attente, veuillez recevoir, Madame, Monsieur, l'expression de nos sincères salutations.\n\nDans le cas où le règlement de votre {document.type} aurait été adressé entre temps, nous vous prions de ne pas tenir compte de cette relance.\n\nCordialement, \n\n{user.name}"
         */
        message?: string;
      };
    };
    /**
     * Timezone of the [portal](../api-docs/definitions/portal.md).
     *  here the list of all possibbles value : https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
     * @maxLength 48
     * @default "Europe/Paris"
     * @example "Europe/Paris"
     */
    timezone?: string;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
  }

  /**
   * Unique identifier of this resource
   * @minLength 24
   * @maxLength 24
   * @example "63e3c82675de4f6978054579"
   */
  export type ObjectId = string;

  /**
   * European intra-Community VAT identifier
   * @maxLength 24
   * @example "FR79 814919106"
   */
  export type VatId = string;

  /**
   * Indicates if the Customer is subject to VAT. [This official article](https://entreprendre.service-public.fr/vosdroits/N13445) (in French) explains who may not be subject to VAT.
   * @default true
   * @example true
   */
  export type VatUse = boolean;

  /**
   * French Company identification number (also called "SIRET" in french).
   * @maxLength 24
   * @example "814 919 106 00025"
   */
  export type Siret = string;

  /**
   * Not used anymore by INFast. Indicates if the customer is located outside the Schengen area. If this is the case, VAT does not apply. If the field is set to true, all invoices issued for this customer will be VAT-exempt. If you want to know more about VAT and Shengen area, [checkout EU official website](https://europa.eu/youreurope/business/taxation/vat/vat-rules-rates/index_en.htm).
   * @deprecated
   * @default false
   * @example false
   */
  export type OutsideEu = boolean;

  /**
   * Indicates if the customer is subject to VAT reverse charge. To learn more about this concept, [click here](https://intia.fr/fr/ressources/autoliquidation/) (document in French). If the field is set to true, all invoices issued for this customer will be under VAT reverse charge.
   * @default false
   * @example false
   */
  export type ReverseCharge = boolean;

  /**
   * An account identifier linking customer to the proper Revenue Account into the Chart of Accounts. Typically defined by the Portal's accounting firm for its own needs. In France, it's a 411* account.
   * @maxLength 24
   * @example "411COGIP"
   */
  export type AccountNumber = string;

  /**
   * Full name
   * @maxLength 512
   * @example "Hervé Berthier"
   */
  export type CustomerName = string;

  /**
   * email adress of the customer
   * @maxLength 512
   * @example "customer@domain.com"
   */
  export type CustomerEmail = string;

  /**
   * Mobile number
   * @maxLength 24
   * @example "06 01 02 03 04"
   */
  export type PhoneMobile = string;

  /**
   * Landline phone number
   * @maxLength 24
   * @example "02 98 01 02 03"
   */
  export type PhoneLandline = string;

  /**
   * Fax number
   * @maxLength 24
   * @example "02 98 01 02 04"
   */
  export type PhoneFax = string;

  /**
   * The official issuance date of the Document. Note, this date may differ from the actual creation date of the Document.
   * @format date-time
   */
  export type DocumentEmitDate = string;

  /**
   * Version of the document. [More information on document versionning here](../api-docs/definitions/document#versionning)
   * @min 1
   * @example 1.2
   */
  export type DocumentVersion = number;

  /**
   * Due date, after this date, the Document is considered late
   * @format date-time
   */
  export type DocumentDueDate = string;

  /**
   * Reference of the customer. _Automatically generated if empty during creation._
   * @maxLength 24
   * @example "C-000123"
   */
  export type CustomerReference = string;

  /**
   * If this field is true, the customer's delivery address is displayed on their documents.
   * @default false
   * @example false
   */
  export type CustomerUseDelivery = boolean;

  /**
   * If this field is true, the customer's delivery address is displayed above regular address on their documents.
   * @default false
   * @example false
   */
  export type CustomerSendToDelivery = boolean;

  /**
   * Unique identifier of the portal ownwing this resource
   * @minLength 24
   * @maxLength 24
   * @example "63e3c82675de4f6978054555"
   */
  export type PortalId = string;

  /**
   * Entity last update date. Note: some updates might result from INFast internal workflows and can produce updates that are not transcribed in API. Concretely: you might see, sometimes, `lastUpdate` change without any other change on entity. It means that something internal to INFast has been updated.
   * @format date-time
   * @example "2017-07-21T17:32:28Z"
   */
  export type LastUpdate = string;

  /**
   * List of tags IDs of this entity.
   * @example ["66608ad48f4331f19f40f4ee","66608ad25e527d4290ee30ef"]
   */
  export type TagIds = string[];

  /**
   * metadata
   * This field is intended for adding metadata to entities you are creating or updating.
   *
   * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
   *
   * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
   * @maxLength 512
   * @example "INTERNAL_DB_ID=12166Q1S2"
   */
  export type Metadata = string;

  /** Portal Output Data */
  export interface DataPortalOutput {
    data: PortalOutput;
  }

  /** Portal Output */
  export interface PortalOutput {
    /** Unique identifier of this resource */
    id: ObjectId;
    /** Enterprise details */
    enterprise: {
      /**
       * Company name
       * @maxLength 1024
       * @example "INTIA"
       */
      name: string;
      /** Landline phone number */
      phone?: PhoneLandline;
      /** Fax number */
      fax?: PhoneFax;
      /**
       * Company email.
       * Displayed on document PDF
       * Use to send email
       * @maxLength 1024
       * @example "contact@intia.fr"
       */
      email?: string;
      /**
       * Company website.
       * Displayed on document PDF.
       * @maxLength 1024
       * @example "https://intia.fr"
       */
      website?: string;
      /** This model is used throughout all API endpoints to represent a postal address. */
      address?: Address;
      /** European intra-Community VAT identifier */
      vatId?: VatId;
      /** Indicates if the Customer is subject to VAT. [This official article](https://entreprendre.service-public.fr/vosdroits/N13445) (in French) explains who may not be subject to VAT. */
      vatUse: VatUse;
      /**
       * SIREN
       * @maxLength 48
       * @example "814 919 106"
       */
      siren?: string;
      /** French Company identification number (also called "SIRET" in french). */
      siret?: Siret;
      /**
       * NAF/APE Code
       * @maxLength 24
       * @example "6201Z"
       */
      naf?: string;
      /**
       * City where the company has been registered.
       * Registre du commerce et des sociétés
       * @maxLength 512
       * @example "Brest"
       */
      rcs?: string;
      /**
       * Legal form of the [portal](../api-docs/definitions/portal.md)
       * @maxLength 512
       * @example "Société par actions simplifiée"
       */
      legalForm: string;
      /**
       * Information to display on document footer
       * @maxLength 1024
       * @example "En cas de retard de paiement, sera exigible, conformément à l'article L 441-10 du Code de Commerce, une pénalité de retard de 10%, ainsi qu'une indemnité forfaitaire pour frais de recouvrement de 40€.
       * Aucun escompte ne sera accordé en cas de paiement anticipé."
       */
      legalNotice: string;
      /**
       * Capital of the company
       * @min 0
       * @example 65680
       */
      capital?: number;
      /**
       * Company which are not register can create invoice, but they should mention that the registration is in progress
       * @example false
       */
      hasNoSiret: boolean;
      /**
       * If company has no siret, a mention should be displayed on invoice
       * @maxLength 1024
       * @example "Siret en cours d'attribution"
       */
      noSiretMsg: string;
      /**
       * Association registration number.
       * Only for association.
       * @maxLength 48
       * @example "W123456789"
       */
      rna?: string;
      /**
       * RIB, bank information displayed on invoice
       * @maxLength 48
       * @example "12345 12345 12345678901 12"
       */
      rib?: string;
      /**
       * IBAN, bank information displayed on invoice
       * @maxLength 48
       * @example "FR12 1234 1234 1234 1234 1234 123"
       */
      iban?: string;
      /**
       * BIC, bank information displayed on invoice
       * @maxLength 48
       * @example "CMBRFR2BXXX"
       */
      bic?: string;
      /**
       * Name of the bank displayed on invoice
       * @maxLength 512
       * @example "Crédit Mutuel de Bretagne"
       */
      bank?: string;
      /**
       * true if you don't want display logo and initial letter.
       * @example false
       */
      noLogo?: boolean;
    };
    /** Default email model use during send emails. */
    modelEmail: {
      /** Model use by default. During first email send to a customer. */
      user: {
        /**
         * Email subject
         * @maxLength 512
         * @example "[{company.name}] Votre {document.type} {document.reference}"
         */
        subject: string;
        /**
         * Email message
         * @maxLength 8196
         * @example "Bonjour,\n\nJe vous prie de bien vouloir trouver votre {document.type} en date du {document.date}.\n\nVous en souhaitant bonne réception, merci de votre confiance.\n\nCordialement,\n\n{user.name}"
         */
        message: string;
      };
      /** Model use when the document is soon late. It's preferable to send an email before the document is late. Customer just can ommit to pay invoice or accept quotation. */
      preRelaunch: {
        /**
         * Email subject
         * @maxLength 512
         * @example "[{company.name}] Votre {document.type} {document.reference}"
         */
        subject: string;
        /**
         * Email message
         * @maxLength 8196
         * @example "Bonjour,\n\nNous nous permettons de vous contacter afin de vous signaler que votre {document.type} arrive bientôt à échéance.\n\nNous vous prions de bien vouloir faire le nécessaire dans les meilleurs délais. Nous attendons votre retour.\n\nSi vous avez déjà traité ce document, nous vous prions de ne pas tenir compte de cette pré-relance.\n\nCordialement, \n\n{user.name}"
         */
        message: string;
      };
      /** Model use when the document is late to encourage customer to pay. */
      relaunch1: {
        /**
         * Email subject
         * @maxLength 512
         * @example "[{company.name}] Votre {document.type} {document.reference}"
         */
        subject: string;
        /**
         * Email message
         * @maxLength 8196
         * @example "Bonjour,\n\nNous nous permettons de vous contacter afin de vous signaler que nous n'avons toujours pas reçu le règlement de la facture en date du {document.date}.\n\nNous vous prions de nous adresser votre paiement dans les meilleurs délais.\n\nDans cette attente, veuillez recevoir, Madame, Monsieur, l'expression de nos sincères salutations.\n\nDans le cas où le règlement de votre {document.type} aurait été adressé entre temps, nous vous prions de ne pas tenir compte de cette relance.\n\nCordialement, \n\n{user.name}"
         */
        message: string;
      };
      /** Model use when the document is late and a first relaunch email was been sent. */
      relaunch2: {
        /**
         * Email subject
         * @maxLength 512
         * @example "[{company.name}] Votre {document.type} {document.reference}"
         */
        subject: string;
        /**
         * Email message
         * @maxLength 8196
         * @example "Bonjour,\n\nEn dépit de notre relance précédente, nous constatons que vous nous êtes toujours redevable du règlement de la facture en date du {document.date}.\n\nNous vous prions de nous adresser votre paiement dans les 8 jours à compter de la réception des présentes.\n\nSans réponse de votre part dans le délai imparti, nous nous verrons  dans l'obligation de faire valoir ce que de droit.\n\nDans cette attente, veuillez recevoir, Madame, Monsieur, l'expression de nos sincères salutations.\n\nDans le cas où le règlement de votre {document.type} aurait été adressé entre temps, nous vous prions de ne pas tenir compte de cette relance.\n\nCordialement, \n\n{user.name}"
         */
        message: string;
      };
    };
    /**
     * Timezone of the [portal](../api-docs/definitions/portal.md).
     *  here the list of all possibbles value : https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
     * @maxLength 48
     * @default "Europe/Paris"
     * @example "Europe/Paris"
     */
    timezone?: string;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
    /**
     * portal creation date
     * @format date-time
     */
    creationDate: string;
    /**
     * Expiration date, after this date, INFast account will be not accessible
     * @format date-time
     */
    endPortalDate: string;
    /**
     * Last connection date on this [portal](../api-docs/definitions/portal.md)
     * @format date-time
     */
    lastConnectionDate: string;
    /** Defined which is the selected pack plan */
    pack: SubscriptionPack;
    /** Define the subscription mode */
    recurrence: SubscriptionRecurrence;
    /** List of dates and turnovers */
    moves: {
      /**
       * List of dates and turnovers realized before start use INFast. Allow to display a turnover graph with previous data.
       * Each array item defined a month and an amount without tax
       */
      historicalTurnover?: {
        /**
         * Date to define a turnover.
         * The first day of the month
         * @format date-time
         */
        date: string;
        /**
         * Turnover amount realized this month.
         * @example 12457.45
         */
        amount: number;
      }[];
      /**
       * List of dates and turnovers realized since use INFast. Allow to display a turnover graph.
       * Each array item defined a month and an amount without tax
       */
      turnover: {
        /**
         * Date to define a turnover.
         * The first day of the month
         * @format date-time
         */
        date: string;
        /**
         * Turnover amount realized this month.
         * @example 9874.36
         */
        amount: number;
      }[];
    };
    /**
     * Sales turnover created with INFast
     * @example 254120.29
     */
    totalTurnover: number;
  }

  /**
   * Webhook Input (Model)
   * Webhook allow your service to receive request when an action is done on your INFast account.
   *
   * You can listen event as "new customer created", "item updated", ...
   * You can create as many webhook you want
   */
  export interface WebhookInput {
    /**
     * Url called on event
     * @example "https://domain.com/webhook"
     */
    endpoint: string;
    /**
     * List of event listenned
     * @minItems 1
     */
    events: WebhookEvent[];
    /**
     * Description of the webhook
     * @example "Webhook fired when an invoice is paid to 3td party"
     */
    description?: string;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
  }

  /** Webhook Output Data */
  export interface DataWebhookOutput {
    /** The webhook object */
    data: WebhookOutput;
  }

  /** Webhook Array Output Data */
  export interface DataArrayWebhookOutput {
    data: WebhookOutput[];
  }

  /**
   * Webhook Output (Model)
   * The webhook object
   */
  export interface WebhookOutput {
    /** Unique identifier of this resource */
    id: ObjectId;
    /**
     * Url called on event
     * @example "https://domain.com/webhook"
     */
    endpoint: string;
    /** List of event listenned */
    events: WebhookEvent[];
    /**
     * Description of the webhook
     * @example "Webhook fired when an invoice is paid to 3td party"
     */
    description?: string;
    /**
     * This field is intended for adding metadata to entities you are creating or updating.
     *
     * You'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).
     *
     * Whatever value you enter here will be included in all outputs related to that entity. This functionality is especially useful for synchronizing your system's entities with those in INFast, allowing for seamless integration
     */
    metadata?: Metadata;
  }

  /**
   * Postal address
   * This model is used throughout all API endpoints to represent a postal address.
   */
  export interface Address {
    /**
     * Street address (Number, street, extension). _Can be multiline_
     * @maxLength 1024
     * @example "149 rue Pierre Sémard
     * Appartement 2"
     */
    street?: string;
    /**
     * Zip code
     * @maxLength 12
     * @example "29200"
     */
    postalCode?: string;
    /**
     * City
     * @maxLength 512
     * @example "Brest"
     */
    city?: string;
    /**
     * Country of the address
     * @maxLength 512
     * @example "FRANCE"
     */
    country?: string;
  }

  /**
   * Delivery Contact (Inner Model)
   * Information on delivery contact.
   *
   * Documents can have a delivery contact that is different from the customer.
   */
  export interface DeliveryContact {
    /** This model is used throughout all API endpoints to represent a postal address. */
    address?: Address;
    /**
     * Name of the delivery contact
     * @maxLength 1024
     * @example "Contact name"
     */
    name?: string;
    /**
     * Phone number of the delivery contact
     * @maxLength 24
     * @example "06 01 02 03 04"
     */
    phone?: string;
    /**
     * Additionnal "to attention" for the delivery address
     * @maxLength 1024
     * @example "Alexandre LEGLISE"
     */
    toAttention?: string;
  }

  export interface WebhookInvoiceUsageAddedPayload {
    /** The properties that are included when fetching a list of documents. */
    document: DocumentOutput;
    usage: TransactionUsageOutput;
  }

  export interface AuthenticatePayload {
    /**
     * OAuth grant type. Must be `client_credentials`.
     * @example "client_credentials"
     */
    grant_type: 'client_credentials';
    /**
     * Scope of the access token. `read` allows you to make read-only requests. `write` allows you to make read and write requests. More information on [scopes in documentation](../api-docs/definitions/authentication#scopes).
     * @example "write"
     */
    scope: 'read' | 'write' | 'read write';
  }

  export interface AuthenticateData {
    /** @example "9db3a8296b68b7889f2803fc1143610922997ads" */
    access_token?: string;
    /** @example "Bearer" */
    token_type?: 'Bearer';
    /**
     * @format int32
     * @example 604799
     */
    expires_in?: number;
    /** @example "write" */
    scope?: string;
  }

  export interface ListTransactionUsagesParams {
    /**
     * Sorts transaction usages by a specific field name. The sort order is defined in `order`. Possible values are:
     * - **date** (default): sorts the results by the transaction usage  date.
     * - **amount**: sorts the results by the transaction amount.
     * @default "date"
     */
    orderBy?: 'lastUpdate' | 'date' | 'amount';
    /**
     * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
     *
     * `sortOrder` can have 2 values:
     * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
     * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
     * @default 1
     * @example 1
     */
    sortOrder?: -1 | 1;
    /**
     * Filters entities where the date is before the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
     * @format date-time
     */
    startDate?: string;
    /**
     * Filters entities where the date is after the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
     * @format date-time
     */
    endDate?: string;
    /** Filter transactions that belong to a specific Customer */
    customerId?: ObjectId;
    /** Filter transaction usages that belong to a specific document */
    documentId?: ObjectId;
    /** Filters entities where the amount is less than the value of the field. */
    minimumAmount?: number;
    /** Filters entities where the amount is more than the value of the field. */
    maximumAmount?: number;
    /**
     * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedSince?: string;
    /**
     * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedUntil?: string;
    /**
     * Limit the number of results returned by the request.
     * @min 0
     * @max 100
     * @default 50
     */
    limit?: number;
    /**
     * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
     * @min 0
     * @default 0
     */
    skip?: number;
  }

  export type ListTransactionUsagesData = DataArrayTransactionUsageOutput;

  export interface GetTransactionUsageParams {
    /** ID of the requested resource */
    id: string;
  }

  export type GetTransactionUsageData = DataTransactionUsageOutput;

  export interface ListTransactionsParams {
    /**
     * Sorts transactions by a specific field name. The sort order is defined in `order`. Possible values are:
     * - **date** (default): sorts the results by the transaction date.
     * - **customerName**: sorts the results by the name of the customer involved in the transaction.
     * - **amount**: sorts the results by the transaction amount.
     * - **method**: sorts the results by the payment method of the transaction.
     * @default "date"
     */
    orderBy?: 'lastUpdate' | 'date' | 'customerName' | 'amount' | 'method';
    /**
     * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
     *
     * `sortOrder` can have 2 values:
     * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
     * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
     * @default 1
     * @example 1
     */
    sortOrder?: -1 | 1;
    /**
     * Filters entities where the date is before the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
     * @format date-time
     */
    startDate?: string;
    /**
     * Filters entities where the date is after the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
     * @format date-time
     */
    endDate?: string;
    /** Filter transactions that belong to a specific Customer */
    customerId?: ObjectId;
    /** Filters entities where the amount is less than the value of the field. */
    minimumAmount?: number;
    /** Filters entities where the amount is more than the value of the field. */
    maximumAmount?: number;
    /**
     * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedSince?: string;
    /**
     * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedUntil?: string;
    /**
     * Limit the number of results returned by the request.
     * @min 0
     * @max 100
     * @default 50
     */
    limit?: number;
    /**
     * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
     * @min 0
     * @default 0
     */
    skip?: number;
  }

  export type ListTransactionsData = DataArrayTransactionOutput;

  export interface GetTransactionParams {
    /** ID of the requested resource */
    id: string;
  }

  export type GetTransactionData = DataTransactionOutput;

  export interface GetTagParams {
    id: string;
  }

  export interface UpdateTagParams {
    id: string;
  }

  export interface DeleteTagParams {
    id: string;
  }

  export type GetMeData = DataUserOutput;

  export interface FindItemsParams {
    /**
     * Sorts request results by a specific field name. The sort order is defined in `order`. Possible values are:
     * - **lastUpdate**: Sort results by items last update (_note: some updates might result from INFast internal workflows and can produce updates that are not transcribed in API_)
     *   - **name**: Sort by items name
     *   - **isService**: Sort by item type (service or item). If `order=1`, items are returned first.
     *   - **reference**: Sort by item reference
     *   - **price**: Sort by item price (excluding taxes)
     * @default "name"
     */
    orderBy?: 'lastUpdate' | 'name' | 'type' | 'reference' | 'price';
    /**
     * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
     *
     * `sortOrder` can have 2 values:
     * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
     * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
     * @default 1
     * @example 1
     */
    sortOrder?: -1 | 1;
    /**
     * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedSince?: string;
    /**
     * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedUntil?: string;
    /**
     * Limit the number of results returned by the request.
     * @min 0
     * @max 100
     * @default 50
     */
    limit?: number;
    /**
     * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
     * @min 0
     * @default 0
     */
    skip?: number;
    /**
     * Filter by item type.
     * @example "item"
     */
    type?: ItemType;
    /**
     * Search value of parameter in all majors fields (name, description, reference).
     * To search with multiple parameters use space as separator. For example: if you want to find items with `parpaing` or `chantier` in name or description, you can use the following search query: `parpaing chantier`.
     *
     * If you want to search exactly by name or reference, use `name` or `reference` parameters.
     * @example "parpaing chantier"
     */
    search?: string;
    /**
     * Search by item name.
     * @example "Déplcement"
     */
    name?: string;
    /**
     * Search by item reference.
     * @example "CL-2913"
     */
    reference?: string;
    /** Search for items with a price higher than or equal to minimumPrice */
    minimumPrice?: number;
    /** Search for items with a price lower than or equal to maximumPrice. */
    maximumPrice?: number;
  }

  export type FindItemsData = DataArrayItemOutput;

  export type CreateItemData = DataItemOutput;

  export interface GetItemParams {
    /** ID of the requested resource */
    id: string;
  }

  export type GetItemData = DataItemOutput;

  export interface DeleteItemParams {
    /** ID of the requested resource */
    id: string;
  }

  export type DeleteItemData = object;

  export interface UpdateItemParams {
    /** ID of the requested resource */
    id: string;
  }

  export type UpdateItemData = DataItemOutput;

  export interface FindCustomersParams {
    /**
     * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
     *
     * `sortOrder` can have 2 values:
     * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
     * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
     * @default 1
     * @example 1
     */
    sortOrder?: -1 | 1;
    /**
     * Sorts request results by a specific field name. The sort order is defined in `order`. Possible values are:
     * - **lastUpdate**: Sort results by items last update (_note: some updates might result from INFast internal workflows and can produce updates that are not transcribed in API_)
     * - **name**: Sort by customers name
     * - **reference**: Sort by customer reference
     * - **phone**: Sort by customer phone number reference (if customer has multiple phone numbers, we'll look for mobile number, then for landline number)
     * - **dueAmount**: Sort by customer current due amount
     * - **documentsCount**: Sort customers by number of documents
     * @default "name"
     */
    orderBy?: 'lastUpdate' | 'name' | 'reference' | 'phone' | 'dueAmount' | 'documentsCount';
    /**
     * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedSince?: string;
    /**
     * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedUntil?: string;
    /**
     * Limit the number of results returned by the request.
     * @min 0
     * @max 100
     * @default 50
     */
    limit?: number;
    /**
     * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
     * @min 0
     * @default 0
     */
    skip?: number;
    /**
     * Search this parameter in all majors fields (name, reference, email, phone, mobile, fax, siret, vat, address fields, contacts fields and delivery fields).
     * To search with multiple parameters use space as separator.
     * @example "Berthier Strasbourg"
     */
    search?: string;
    /**
     * Search by customers name
     * @example "Jean Patrick Ranu"
     */
    name?: string;
    /**
     * Search by customers reference
     * @example "CL-1265"
     */
    reference?: string;
    /**
     * Search by customers email
     * @example "bertier@cogip29.com"
     */
    email?: string;
    /**
     * Search for customers with an amount due higher than or equal to this value
     * @example 100
     */
    minimumDueAmount?: number;
    /**
     * Search for customers with an amount due less than or equal to this value
     * @example 5000
     */
    maximumDueAmount?: number;
    /** Filter documents by status. `ACTIVE` corresponds to validated documents that are not overdue. `LATE` corresponds to overdue documents (i.e., those that have not been paid or accepted before the deadline).             */
    documentStatus?: 'ACTIVE' | 'LATE';
  }

  export type FindCustomersData = DataArrayCustomerOutput;

  export type CreateCustomerData = DataCustomerOutput;

  export interface GetCustomerParams {
    /** ID of the requested resource */
    id: string;
  }

  export type GetCustomerData = DataCustomerOutput;

  export interface DeleteCustomerParams {
    /** ID of the requested resource */
    id: string;
  }

  export type DeleteCustomerData = object;

  export interface UpdateCustomerParams {
    /** ID of the requested resource */
    id: string;
  }

  export type UpdateCustomerData = DataCustomerOutput;

  export interface ListCustomerTransactionsParams {
    /**
     * Sorts transactions by a specific field name. The sort order is defined in `order`. Possible values are:
     * - **date** (default): sorts the results by the transaction date.
     * - **amount**: sorts the results by the transaction amount.
     * - **method**: sorts the results by the payment method of the transaction.
     * @default "date"
     */
    orderBy?: 'lastUpdate' | 'date' | 'amount' | 'method';
    /**
     * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
     *
     * `sortOrder` can have 2 values:
     * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
     * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
     * @default 1
     * @example 1
     */
    sortOrder?: -1 | 1;
    /**
     * Filters entities where the date is before the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
     * @format date-time
     */
    startDate?: string;
    /**
     * Filters entities where the date is after the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
     * @format date-time
     */
    endDate?: string;
    /** Filters entities where the amount is less than the value of the field. */
    minimumAmount?: number;
    /** Filters entities where the amount is more than the value of the field. */
    maximumAmount?: number;
    /**
     * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedSince?: string;
    /**
     * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedUntil?: string;
    /**
     * Limit the number of results returned by the request.
     * @min 0
     * @max 100
     * @default 50
     */
    limit?: number;
    /**
     * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
     * @min 0
     * @default 0
     */
    skip?: number;
    id: string;
  }

  export type ListCustomerTransactionsData = DataArrayTransactionOutput;

  export interface ListContactsParams {
    /** ID of the requested resource */
    id: string;
  }

  export interface CreateContactParams {
    /** ID of the requested resource */
    id: string;
  }

  export interface GetContactParams {
    /** ID of the requested resource */
    id: string;
    contactid: string;
  }

  export interface UpdateContactParams {
    /** ID of the requested resource */
    id: string;
    contactid: string;
  }

  export interface DeleteContactParams {
    /** ID of the requested resource */
    id: string;
    contactid: string;
  }

  export interface FindDocumentsParams {
    /**
     * Sorts documents by a specific field name. The sort order is defined in `order`. Possible values are:
     *  - **lastUpdate**: Sort results by items last update.
     *   - **to.name**: Sort by document customer name.
     *   - **emitDate**: Sort by official issuance date of the Document. Note, this date may differ from the actual creation date of the Document.
     *   - **reference**: Sort by document reference
     *   - **amount**: Sort by document total amount (without taxes and global discount)
     *   - **refInt**: Sort by document internal reference
     * @default "emitDate"
     */
    orderBy?: 'lastUpdate' | 'emitDate' | 'to.name' | 'reference' | 'amount' | 'refInt';
    /**
     * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
     *
     * `sortOrder` can have 2 values:
     * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
     * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
     * @default 1
     * @example 1
     */
    sortOrder?: -1 | 1;
    /**
     * Search this parameter in all majors fields (title, reference, referenceInternal, messageTop, messageBottom, customerName, amountVatNet, amountNet).
     * To search with multiple parameters use space as separator
     */
    search?: string;
    /** Filters by status of the Document. [More information on the different statuses here](../api-docs/definitions/document#status) */
    status?: DocumentStatus;
    /** Filters by type of document. [More information on the different types here](../api-docs/definitions/document#types) */
    type?: 'QUOTATION' | 'PURCHASE_ORDER' | 'INVOICE' | 'OTHER';
    /** Filters by subtype of document. [More information on the different subtypes here](../api-docs/definitions/document#subtypes) */
    subtype?:
      | 'QUOTATION'
      | 'PURCHASE_ORDER'
      | 'INVOICE'
      | 'DEPOSIT'
      | 'CREDIT_NOTE'
      | 'PROFORMA'
      | 'SITUATION'
      | 'ORDER_FORM';
    /**
     * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedSince?: string;
    /**
     * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedUntil?: string;
    /**
     * Search by document reference
     * @example "F2302-1265"
     */
    reference?: string;
    /** Search documents belonging to a specific customer */
    customerId?: ObjectId;
    /**
     * Filters document having emit date higher than or equal to startEmitDate
     * @format date-time
     */
    startEmitDate?: string;
    /**
     * Filters document having emit date less than or equal to endEmitDate
     * @format date-time
     */
    endEmitDate?: string;
    /**
     * Filter documents with an amount (without VAT) lower than this value.
     * @example 100
     */
    minimumAmount?: number;
    /**
     * Filter documents with an net amount (without VAT) greater than this value.
     * @example 5000
     */
    maximumAmount?: number;
    /**
     * Filter documents with an amount (with VAT) lower than this value.
     * @example 120
     */
    minimumAmountWithVat?: number;
    /**
     * Filter documents with an net amount (with VAT) greater than this value.
     * @example 6000
     */
    maximumAmountWithVat?: number;
    /**
     * Limit the number of results returned by the request.
     * @min 0
     * @max 100
     * @default 50
     */
    limit?: number;
    /**
     * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
     * @min 0
     * @default 0
     */
    skip?: number;
  }

  export type FindDocumentsData = DataArrayDocumentOutput;

  export type CreateDocumentData = DataDocumentOutput;

  export interface GetDocumentParams {
    /** ID of the requested resource */
    id: string;
  }

  export type GetDocumentData = DataDocumentOutput;

  export interface DeleteDocumentParams {
    /** ID of the requested resource */
    id: string;
  }

  export type DeleteDocumentData = any;

  export interface ListDocumentTransactionUsagesParams {
    /**
     * Sorts transaction usages by a specific field name. The sort order is defined in `order`. Possible values are:
     * - **date** (default): sorts the results by the transaction usage  date.
     * - **amount**: sorts the results by the transaction amount.
     * @default "date"
     */
    orderBy?: 'lastUpdate' | 'date' | 'amount';
    /**
     * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
     *
     * `sortOrder` can have 2 values:
     * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
     * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
     * @default 1
     * @example 1
     */
    sortOrder?: -1 | 1;
    /**
     * Filters entities where the date is before the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
     * @format date-time
     */
    startDate?: string;
    /**
     * Filters entities where the date is after the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
     * @format date-time
     */
    endDate?: string;
    /** Filters entities where the amount is less than the value of the field. */
    minimumAmount?: number;
    /** Filters entities where the amount is more than the value of the field. */
    maximumAmount?: number;
    /**
     * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedSince?: string;
    /**
     * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
     *
     * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
     * @format date-time
     */
    updatedUntil?: string;
    /**
     * Limit the number of results returned by the request.
     * @min 0
     * @max 100
     * @default 50
     */
    limit?: number;
    /**
     * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
     * @min 0
     * @default 0
     */
    skip?: number;
    id: string;
  }

  export type ListDocumentTransactionUsagesData = DataArrayTransactionUsageOutput;

  export interface ExportPdfParams {
    /** ID of the requested resource */
    id: string;
  }

  export interface ExportPdfData {
    /** The pdf file encoded in B64 */
    pdfB64?: string;
  }

  export interface GetMessagesParams {
    /** ID of the requested resource */
    id: string;
  }

  export type GetMessagesData = DataArrayDocumentMessage;

  export interface SendMessageParams {
    /** ID of the requested resource */
    id: string;
  }

  export type SendMessageData = DataDocumentMessage;

  export interface AcceptQuotationParams {
    /** ID of the requested resource */
    id: string;
  }

  export type AcceptQuotationData = DataDocumentOutput;

  export interface RefuseQuotationParams {
    /** ID of the requested resource */
    id: string;
  }

  export type RefuseQuotationData = DataDocumentOutput;

  export interface ValidateDocumentParams {
    /** ID of the requested resource */
    id: string;
  }

  export type ValidateDocumentData = DataDocumentOutput;

  export interface ConvertToInvoiceParams {
    /** ID of the requested resource */
    id: string;
  }

  export type ConvertToInvoiceData = DataDocumentOutput;

  export interface AddPaymentOnInvoiceParams {
    /** ID of the requested resource */
    id: string;
  }

  export type AddPaymentOnInvoiceData = DataTransactionOutput;

  export type GetPortalData = DataPortalOutput;

  export type UpdatePortalData = DataPortalOutput;

  export type ListWebhooksData = DataArrayWebhookOutput;

  export type CreateWebhookData = DataWebhookOutput;

  export interface GetWebhookParams {
    /** ID of the requested resource */
    id: string;
  }

  export type GetWebhookData = DataWebhookOutput;

  export interface DeleteWebhookParams {
    /** ID of the requested resource */
    id: string;
  }

  export type DeleteWebhookData = object;

  export namespace Oauth2 {
    /**
     * @description This enpoint is used to get access token required to make requests on INFast API. This is a standard OAUth2 endpoint. You'll find more information on [Authentication section of documentation](../api-docs/definitions/authentication.md). Use your `client_id` as `username` and your `client_secret` as `password`.
     * @tags Authentication
     * @name Authenticate
     * @summary OAuth access token
     * @request POST:/oauth2/token
     * @secure
     */
    export namespace Authenticate {
      export type RequestParams = {};
      export type RequestQuery = {};
      export type RequestBody = AuthenticatePayload;
      export type RequestHeaders = {};
      export type ResponseBody = AuthenticateData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }
  }

  export namespace TransactionUsages {
    /**
     * @description Fetch the list of Transaction Usages for a Portal. The results can be sorted, filtered, and paginated. 🚨Unfortunately, we are experiencing a bug with the documentation for this endpoint. **The API's response schema is not displayed**. However, you can find an example of the response in the "Example" tab. Otherwise, the definition is accessible in the OpenApi file here: `/components/schemas/data-array-transaction-usage-output`.
     * @tags Transactions
     * @name ListTransactionUsages
     * @summary List Transactions Usages
     * @request GET:/transaction-usages
     * @secure
     */
    export namespace ListTransactionUsages {
      export type RequestParams = {};
      export type RequestQuery = {
        /**
         * Sorts transaction usages by a specific field name. The sort order is defined in `order`. Possible values are:
         * - **date** (default): sorts the results by the transaction usage  date.
         * - **amount**: sorts the results by the transaction amount.
         * @default "date"
         */
        orderBy?: 'lastUpdate' | 'date' | 'amount';
        /**
         * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
         *
         * `sortOrder` can have 2 values:
         * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
         * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
         * @default 1
         * @example 1
         */
        sortOrder?: -1 | 1;
        /**
         * Filters entities where the date is before the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
         * @format date-time
         */
        startDate?: string;
        /**
         * Filters entities where the date is after the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
         * @format date-time
         */
        endDate?: string;
        /** Filter transactions that belong to a specific Customer */
        customerId?: ObjectId;
        /** Filter transaction usages that belong to a specific document */
        documentId?: ObjectId;
        /** Filters entities where the amount is less than the value of the field. */
        minimumAmount?: number;
        /** Filters entities where the amount is more than the value of the field. */
        maximumAmount?: number;
        /**
         * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedSince?: string;
        /**
         * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedUntil?: string;
        /**
         * Limit the number of results returned by the request.
         * @min 0
         * @max 100
         * @default 50
         */
        limit?: number;
        /**
         * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
         * @min 0
         * @default 0
         */
        skip?: number;
      };
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = ListTransactionUsagesData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Transactions
     * @name GetTransactionUsage
     * @summary Get a Transaction Usage
     * @request GET:/transaction-usages/{id}
     * @secure
     */
    export namespace GetTransactionUsage {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = GetTransactionUsageData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }
  }

  export namespace Transactions {
    /**
     * @description Fetch the list of Transactions for a Portal. The results can be sorted, filtered, and paginated. 🚨Unfortunately, we are experiencing a bug with the documentation for this endpoint. **The API's response schema is not displayed**. However, you can find an example of the response in the "Example" tab. Otherwise, the definition is accessible in the OpenApi file here: `/components/schemas/data-array-transaction-output`.
     * @tags Transactions
     * @name ListTransactions
     * @summary List Transactions
     * @request GET:/transactions
     * @secure
     */
    export namespace ListTransactions {
      export type RequestParams = {};
      export type RequestQuery = {
        /**
         * Sorts transactions by a specific field name. The sort order is defined in `order`. Possible values are:
         * - **date** (default): sorts the results by the transaction date.
         * - **customerName**: sorts the results by the name of the customer involved in the transaction.
         * - **amount**: sorts the results by the transaction amount.
         * - **method**: sorts the results by the payment method of the transaction.
         * @default "date"
         */
        orderBy?: 'lastUpdate' | 'date' | 'customerName' | 'amount' | 'method';
        /**
         * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
         *
         * `sortOrder` can have 2 values:
         * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
         * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
         * @default 1
         * @example 1
         */
        sortOrder?: -1 | 1;
        /**
         * Filters entities where the date is before the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
         * @format date-time
         */
        startDate?: string;
        /**
         * Filters entities where the date is after the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
         * @format date-time
         */
        endDate?: string;
        /** Filter transactions that belong to a specific Customer */
        customerId?: ObjectId;
        /** Filters entities where the amount is less than the value of the field. */
        minimumAmount?: number;
        /** Filters entities where the amount is more than the value of the field. */
        maximumAmount?: number;
        /**
         * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedSince?: string;
        /**
         * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedUntil?: string;
        /**
         * Limit the number of results returned by the request.
         * @min 0
         * @max 100
         * @default 50
         */
        limit?: number;
        /**
         * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
         * @min 0
         * @default 0
         */
        skip?: number;
      };
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = ListTransactionsData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Transactions
     * @name GetTransaction
     * @summary Get a Transaction
     * @request GET:/transactions/{id}
     * @secure
     */
    export namespace GetTransaction {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = GetTransactionData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }
  }

  export namespace Tags {
    /**
     * No description
     * @tags Tags
     * @name GetTag
     * @summary Tag details
     * @request GET:/tags/{id}
     * @secure
     */
    export namespace GetTag {
      export type RequestParams = {
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = any;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Tags
     * @name UpdateTag
     * @summary Tag update
     * @request PATCH:/tags/{id}
     * @secure
     */
    export namespace UpdateTag {
      export type RequestParams = {
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = any;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Tags
     * @name DeleteTag
     * @summary Tag delete
     * @request DELETE:/tags/{id}
     * @secure
     */
    export namespace DeleteTag {
      export type RequestParams = {
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = any;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Tags
     * @name ListTags
     * @summary Tag list - filter par type
     * @request GET:/tags
     * @secure
     */
    export namespace ListTags {
      export type RequestParams = {};
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = any;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Tags
     * @name CreateTag
     * @summary Tag create
     * @request POST:/tags
     * @secure
     */
    export namespace CreateTag {
      export type RequestParams = {};
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = any;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }
  }

  export namespace Me {
    /**
     * @description Retrieve the currently logged user (based on [OAuth authentication](../api-docs/definitions/authentication.md)).
     * @tags User
     * @name GetMe
     * @summary Get current user
     * @request GET:/me
     * @secure
     */
    export namespace GetMe {
      export type RequestParams = {};
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = GetMeData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }
  }

  export namespace Items {
    /**
     * @description Fetch a list of the portals items. Results are paginated and can be filtered by a search query.
     * @tags Items
     * @name FindItems
     * @summary List Items
     * @request GET:/items
     * @secure
     */
    export namespace FindItems {
      export type RequestParams = {};
      export type RequestQuery = {
        /**
         * Sorts request results by a specific field name. The sort order is defined in `order`. Possible values are:
         * - **lastUpdate**: Sort results by items last update (_note: some updates might result from INFast internal workflows and can produce updates that are not transcribed in API_)
         *   - **name**: Sort by items name
         *   - **isService**: Sort by item type (service or item). If `order=1`, items are returned first.
         *   - **reference**: Sort by item reference
         *   - **price**: Sort by item price (excluding taxes)
         * @default "name"
         */
        orderBy?: 'lastUpdate' | 'name' | 'type' | 'reference' | 'price';
        /**
         * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
         *
         * `sortOrder` can have 2 values:
         * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
         * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
         * @default 1
         * @example 1
         */
        sortOrder?: -1 | 1;
        /**
         * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedSince?: string;
        /**
         * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedUntil?: string;
        /**
         * Limit the number of results returned by the request.
         * @min 0
         * @max 100
         * @default 50
         */
        limit?: number;
        /**
         * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
         * @min 0
         * @default 0
         */
        skip?: number;
        /**
         * Filter by item type.
         * @example "item"
         */
        type?: ItemType;
        /**
         * Search value of parameter in all majors fields (name, description, reference).
         * To search with multiple parameters use space as separator. For example: if you want to find items with `parpaing` or `chantier` in name or description, you can use the following search query: `parpaing chantier`.
         *
         * If you want to search exactly by name or reference, use `name` or `reference` parameters.
         * @example "parpaing chantier"
         */
        search?: string;
        /**
         * Search by item name.
         * @example "Déplcement"
         */
        name?: string;
        /**
         * Search by item reference.
         * @example "CL-2913"
         */
        reference?: string;
        /** Search for items with a price higher than or equal to minimumPrice */
        minimumPrice?: number;
        /** Search for items with a price lower than or equal to maximumPrice. */
        maximumPrice?: number;
      };
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = FindItemsData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Create a new item.
     * @tags Items
     * @name CreateItem
     * @summary Create an Item
     * @request POST:/items
     * @secure
     */
    export namespace CreateItem {
      export type RequestParams = {};
      export type RequestQuery = {};
      export type RequestBody = ItemInput;
      export type RequestHeaders = {};
      export type ResponseBody = CreateItemData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Find an Item by ID.
     * @tags Items
     * @name GetItem
     * @summary Get an Item
     * @request GET:/items/{id}
     * @secure
     */
    export namespace GetItem {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = GetItemData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Delete an Item by its ID.
     * @tags Items
     * @name DeleteItem
     * @summary Delete an Item
     * @request DELETE:/items/{id}
     * @secure
     */
    export namespace DeleteItem {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = DeleteItemData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Update an item. Updates are partial. Therefore, when you want to modify an Item, only send the fields you wish to update.
     * @tags Items
     * @name UpdateItem
     * @summary Update an Item
     * @request PATCH:/items/{id}
     * @secure
     */
    export namespace UpdateItem {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = ItemPatch;
      export type RequestHeaders = {};
      export type ResponseBody = UpdateItemData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }
  }

  export namespace Customers {
    /**
     * @description Fetch a list of [Customers](../api-docs/definitions/customer.mdx) for the current [portals](../api-docs/definitions/portal.md). Results are paginated and can be filtered by a search query and ordered.
     * @tags Customers
     * @name FindCustomers
     * @summary List Customers
     * @request GET:/customers
     * @secure
     */
    export namespace FindCustomers {
      export type RequestParams = {};
      export type RequestQuery = {
        /**
         * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
         *
         * `sortOrder` can have 2 values:
         * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
         * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
         * @default 1
         * @example 1
         */
        sortOrder?: -1 | 1;
        /**
         * Sorts request results by a specific field name. The sort order is defined in `order`. Possible values are:
         * - **lastUpdate**: Sort results by items last update (_note: some updates might result from INFast internal workflows and can produce updates that are not transcribed in API_)
         * - **name**: Sort by customers name
         * - **reference**: Sort by customer reference
         * - **phone**: Sort by customer phone number reference (if customer has multiple phone numbers, we'll look for mobile number, then for landline number)
         * - **dueAmount**: Sort by customer current due amount
         * - **documentsCount**: Sort customers by number of documents
         * @default "name"
         */
        orderBy?: 'lastUpdate' | 'name' | 'reference' | 'phone' | 'dueAmount' | 'documentsCount';
        /**
         * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedSince?: string;
        /**
         * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedUntil?: string;
        /**
         * Limit the number of results returned by the request.
         * @min 0
         * @max 100
         * @default 50
         */
        limit?: number;
        /**
         * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
         * @min 0
         * @default 0
         */
        skip?: number;
        /**
         * Search this parameter in all majors fields (name, reference, email, phone, mobile, fax, siret, vat, address fields, contacts fields and delivery fields).
         * To search with multiple parameters use space as separator.
         * @example "Berthier Strasbourg"
         */
        search?: string;
        /**
         * Search by customers name
         * @example "Jean Patrick Ranu"
         */
        name?: string;
        /**
         * Search by customers reference
         * @example "CL-1265"
         */
        reference?: string;
        /**
         * Search by customers email
         * @example "bertier@cogip29.com"
         */
        email?: string;
        /**
         * Search for customers with an amount due higher than or equal to this value
         * @example 100
         */
        minimumDueAmount?: number;
        /**
         * Search for customers with an amount due less than or equal to this value
         * @example 5000
         */
        maximumDueAmount?: number;
        /** Filter documents by status. `ACTIVE` corresponds to validated documents that are not overdue. `LATE` corresponds to overdue documents (i.e., those that have not been paid or accepted before the deadline).             */
        documentStatus?: 'ACTIVE' | 'LATE';
      };
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = FindCustomersData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Create a new customer.
     * @tags Customers
     * @name CreateCustomer
     * @summary Create a Customer
     * @request POST:/customers
     * @secure
     */
    export namespace CreateCustomer {
      export type RequestParams = {};
      export type RequestQuery = {};
      export type RequestBody = CustomerInput;
      export type RequestHeaders = {};
      export type ResponseBody = CreateCustomerData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Get a Customer by its ID
     * @tags Customers
     * @name GetCustomer
     * @summary Get a Customer
     * @request GET:/customers/{id}
     * @secure
     */
    export namespace GetCustomer {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = GetCustomerData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Delete a Customer by its ID.
     * @tags Customers
     * @name DeleteCustomer
     * @summary Delete a Customer
     * @request DELETE:/customers/{id}
     * @secure
     */
    export namespace DeleteCustomer {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = DeleteCustomerData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Update a Customer. Updates are partial. Therefore, when you want to modify a Customer, only send the fields you wish to update.
     * @tags Customers
     * @name UpdateCustomer
     * @summary Update a Customer
     * @request PATCH:/customers/{id}
     * @secure
     */
    export namespace UpdateCustomer {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = CustomerPatch;
      export type RequestHeaders = {};
      export type ResponseBody = UpdateCustomerData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Fetch the list of Transactions for a given Customer. The results can be sorted, filtered, and paginated. 🚨Unfortunately, we are experiencing a bug with the documentation for this endpoint. **The API's response schema is not displayed**. However, you can find an example of the response in the "Example" tab. Otherwise, the definition is accessible in the OpenApi file here: `/components/schemas/data-array-transaction-output`.
     * @tags Customers, Transactions
     * @name ListCustomerTransactions
     * @summary List Transactions of a Customer
     * @request GET:/customers/{id}/transactions
     * @secure
     */
    export namespace ListCustomerTransactions {
      export type RequestParams = {
        id: string;
      };
      export type RequestQuery = {
        /**
         * Sorts transactions by a specific field name. The sort order is defined in `order`. Possible values are:
         * - **date** (default): sorts the results by the transaction date.
         * - **amount**: sorts the results by the transaction amount.
         * - **method**: sorts the results by the payment method of the transaction.
         * @default "date"
         */
        orderBy?: 'lastUpdate' | 'date' | 'amount' | 'method';
        /**
         * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
         *
         * `sortOrder` can have 2 values:
         * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
         * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
         * @default 1
         * @example 1
         */
        sortOrder?: -1 | 1;
        /**
         * Filters entities where the date is before the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
         * @format date-time
         */
        startDate?: string;
        /**
         * Filters entities where the date is after the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
         * @format date-time
         */
        endDate?: string;
        /** Filters entities where the amount is less than the value of the field. */
        minimumAmount?: number;
        /** Filters entities where the amount is more than the value of the field. */
        maximumAmount?: number;
        /**
         * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedSince?: string;
        /**
         * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedUntil?: string;
        /**
         * Limit the number of results returned by the request.
         * @min 0
         * @max 100
         * @default 50
         */
        limit?: number;
        /**
         * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
         * @min 0
         * @default 0
         */
        skip?: number;
      };
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = ListCustomerTransactionsData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Customers
     * @name ListContacts
     * @summary List contacts of a customer
     * @request GET:/customers/{id}/contacts
     * @secure
     */
    export namespace ListContacts {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = any;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Customers
     * @name CreateContact
     * @summary Add a contact to a customer
     * @request POST:/customers/{id}/contacts
     * @secure
     */
    export namespace CreateContact {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = any;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Customers
     * @name GetContact
     * @summary Get a contact
     * @request GET:/customers/{id}/contacts/{contactid}
     * @secure
     */
    export namespace GetContact {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
        contactid: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = any;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Customers
     * @name UpdateContact
     * @summary Update a contact of a customer
     * @request PATCH:/customers/{id}/contacts/{contactid}
     * @secure
     */
    export namespace UpdateContact {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
        contactid: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = any;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Customers
     * @name DeleteContact
     * @summary Delete a contact of a customer
     * @request DELETE:/customers/{id}/contacts/{contactid}
     * @secure
     */
    export namespace DeleteContact {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
        contactid: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = any;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }
  }

  export namespace Documents {
    /**
     * @description Fetch a list of the portals documents. Results are paginated and can be filtered by a search query.
     * @tags Documents
     * @name FindDocuments
     * @summary List Documents
     * @request GET:/documents
     * @secure
     */
    export namespace FindDocuments {
      export type RequestParams = {};
      export type RequestQuery = {
        /**
         * Sorts documents by a specific field name. The sort order is defined in `order`. Possible values are:
         *  - **lastUpdate**: Sort results by items last update.
         *   - **to.name**: Sort by document customer name.
         *   - **emitDate**: Sort by official issuance date of the Document. Note, this date may differ from the actual creation date of the Document.
         *   - **reference**: Sort by document reference
         *   - **amount**: Sort by document total amount (without taxes and global discount)
         *   - **refInt**: Sort by document internal reference
         * @default "emitDate"
         */
        orderBy?: 'lastUpdate' | 'emitDate' | 'to.name' | 'reference' | 'amount' | 'refInt';
        /**
         * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
         *
         * `sortOrder` can have 2 values:
         * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
         * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
         * @default 1
         * @example 1
         */
        sortOrder?: -1 | 1;
        /**
         * Search this parameter in all majors fields (title, reference, referenceInternal, messageTop, messageBottom, customerName, amountVatNet, amountNet).
         * To search with multiple parameters use space as separator
         */
        search?: string;
        /** Filters by status of the Document. [More information on the different statuses here](../api-docs/definitions/document#status) */
        status?: DocumentStatus;
        /** Filters by type of document. [More information on the different types here](../api-docs/definitions/document#types) */
        type?: 'QUOTATION' | 'PURCHASE_ORDER' | 'INVOICE' | 'OTHER';
        /** Filters by subtype of document. [More information on the different subtypes here](../api-docs/definitions/document#subtypes) */
        subtype?:
          | 'QUOTATION'
          | 'PURCHASE_ORDER'
          | 'INVOICE'
          | 'DEPOSIT'
          | 'CREDIT_NOTE'
          | 'PROFORMA'
          | 'SITUATION'
          | 'ORDER_FORM';
        /**
         * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedSince?: string;
        /**
         * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedUntil?: string;
        /**
         * Search by document reference
         * @example "F2302-1265"
         */
        reference?: string;
        /** Search documents belonging to a specific customer */
        customerId?: ObjectId;
        /**
         * Filters document having emit date higher than or equal to startEmitDate
         * @format date-time
         */
        startEmitDate?: string;
        /**
         * Filters document having emit date less than or equal to endEmitDate
         * @format date-time
         */
        endEmitDate?: string;
        /**
         * Filter documents with an amount (without VAT) lower than this value.
         * @example 100
         */
        minimumAmount?: number;
        /**
         * Filter documents with an net amount (without VAT) greater than this value.
         * @example 5000
         */
        maximumAmount?: number;
        /**
         * Filter documents with an amount (with VAT) lower than this value.
         * @example 120
         */
        minimumAmountWithVat?: number;
        /**
         * Filter documents with an net amount (with VAT) greater than this value.
         * @example 6000
         */
        maximumAmountWithVat?: number;
        /**
         * Limit the number of results returned by the request.
         * @min 0
         * @max 100
         * @default 50
         */
        limit?: number;
        /**
         * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
         * @min 0
         * @default 0
         */
        skip?: number;
      };
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = FindDocumentsData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description You can create documents only with the `DRAFT` or `VALIDATED` status. To create a Document, you need a [Customer](../api-docs/definitions/customer.mdx), which you can specify via `customerId`. Similarly, you will need [Items](../api-docs/definitions/item.md) to add to the `lines` of your Document. If required, you can manually set values for the `description`, `price`, `amount`, `vat`, and `amountVat` fields.
     * @tags Documents
     * @name CreateDocument
     * @summary Create Document
     * @request POST:/documents
     * @secure
     */
    export namespace CreateDocument {
      export type RequestParams = {};
      export type RequestQuery = {};
      export type RequestBody = DocumentInput;
      export type RequestHeaders = {};
      export type ResponseBody = CreateDocumentData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Find a document by ID.
     * @tags Documents
     * @name GetDocument
     * @summary Get Document
     * @request GET:/documents/{id}
     * @secure
     */
    export namespace GetDocument {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = GetDocumentData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Deletes a document. The deletion is only available on documents with DRAFT status. If document is not a DRAFT, deletion will be denied.
     * @tags Documents
     * @name DeleteDocument
     * @summary Delete document
     * @request DELETE:/documents/{id}
     * @secure
     */
    export namespace DeleteDocument {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = DeleteDocumentData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Fetch the list of Transaction Usages for a given Document. The results can be sorted, filtered, and paginated. 🚨Unfortunately, we are experiencing a bug with the documentation for this endpoint. **The API's response schema is not displayed**. However, you can find an example of the response in the "Example" tab. Otherwise, the definition is accessible in the OpenApi file here: `/components/schemas/data-array-transaction-usage-output`.
     * @tags Documents, Transactions
     * @name ListDocumentTransactionUsages
     * @summary List Transaction Usages of a Document
     * @request GET:/documents/{id}/transaction-usages
     * @secure
     */
    export namespace ListDocumentTransactionUsages {
      export type RequestParams = {
        id: string;
      };
      export type RequestQuery = {
        /**
         * Sorts transaction usages by a specific field name. The sort order is defined in `order`. Possible values are:
         * - **date** (default): sorts the results by the transaction usage  date.
         * - **amount**: sorts the results by the transaction amount.
         * @default "date"
         */
        orderBy?: 'lastUpdate' | 'date' | 'amount';
        /**
         * Sort the result of the request in either ascending or descending order. This parameter is used in conjunction with `sortBy` (which is used to define the field to sort by).
         *
         * `sortOrder` can have 2 values:
         * - `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)
         * - `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)
         * @default 1
         * @example 1
         */
        sortOrder?: -1 | 1;
        /**
         * Filters entities where the date is before the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
         * @format date-time
         */
        startDate?: string;
        /**
         * Filters entities where the date is after the value of the field. Note, this refers to the actual entity `date` field value. Not the date the payment object creation.
         * @format date-time
         */
        endDate?: string;
        /** Filters entities where the amount is less than the value of the field. */
        minimumAmount?: number;
        /** Filters entities where the amount is more than the value of the field. */
        maximumAmount?: number;
        /**
         * Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedSince?: string;
        /**
         * Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).
         *
         * The date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).
         * @format date-time
         */
        updatedUntil?: string;
        /**
         * Limit the number of results returned by the request.
         * @min 0
         * @max 100
         * @default 50
         */
        limit?: number;
        /**
         * Skip over a number of elements by specifying an offset value for the query. Mainly used for pagination. For example: if you need to paginate through large ammount of elements, you can use the following query: `limit=50&skip=0` to get the first 50 elements, then `limit=5O&skip=50` to get the next 50 elements, and so on.
         * @min 0
         * @default 0
         */
        skip?: number;
      };
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = ListDocumentTransactionUsagesData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Download the document as a PDF file.
     * @tags Documents
     * @name ExportPdf
     * @summary Export document as PDF
     * @request GET:/documents/{id}/pdf
     * @secure
     */
    export namespace ExportPdf {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = ExportPdfData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * No description
     * @tags Documents
     * @name GetMessages
     * @summary TODOJQU - Get messages of a document
     * @request GET:/documents/{id}/messages
     * @secure
     */
    export namespace GetMessages {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = GetMessagesData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Send a document by email. By default send the email: - from portal email or user email - to the customer email (customer's email address must be set) - subject and message are set from selected template - default template used is defined by the document due date - document is not yet due => use STANDARD template - document will soon be due => use PRELAUNCH template - document is overdue => use RELAUNCH1 template - document is overdue and a previous relauch email has been sent => use RELAUNCH2 template You can override: - from (must be a user or portal email) - to - model - subject - message You can add : - cc emails separated by semicolon The email will be added to the document's email history.
     * @tags Documents
     * @name SendMessage
     * @summary Send a message about document
     * @request POST:/documents/{id}/messages
     * @secure
     */
    export namespace SendMessage {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = MessageInput;
      export type RequestHeaders = {};
      export type ResponseBody = SendMessageData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Mark a quotation as accepted by the customer. This action is only applicable to quotations with VALIDATED status (not DRAFT nor ACCEPTED or REFUSED) Once applied, this method will change the quotation status to ACCEPTED.
     * @tags Documents
     * @name AcceptQuotation
     * @summary Mark a quotation as accepted by customer
     * @request POST:/documents/{id}/accept-quotation
     * @secure
     */
    export namespace AcceptQuotation {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = AcceptQuotationData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Mark a quotation as refused by the customer. This action is only applicable to quotations with VALIDATED status (not DRAFT nor ACCEPTED or REFUSED) Once applied, this method will change the quotation status to REFUSED.
     * @tags Documents
     * @name RefuseQuotation
     * @summary Mark a quotation as refused by customer
     * @request POST:/documents/{id}/refuse-quotation
     * @secure
     */
    export namespace RefuseQuotation {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = RefuseQuotationData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Validates a document (i.e. removes the "DRAFT" status). This action is only applicable to document with DRAFT status. Once applied, this method will change the document status to VALIDATED.
     * @tags Documents
     * @name ValidateDocument
     * @summary Validate a document
     * @request POST:/documents/{id}/validate
     * @secure
     */
    export namespace ValidateDocument {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = ValidateDocumentData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Converts a quotation to an invoice. This action is only applicable to quotations with ACCEPTED status (i.e: marked as accepted by the client) This method will return the newly created Invoice. Note: the created invoice will have a DRAFT status.
     * @tags Documents
     * @name ConvertToInvoice
     * @summary Converts a quotation to an invoice
     * @request POST:/documents/{id}/convert/invoice
     * @secure
     */
    export namespace ConvertToInvoice {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = ConvertToInvoiceData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Add a payment on an invoice. A payment is firstly added on a customer, then the payment is used on the invoice. If the payment amount is higher of the invoice amount, the payment can be used on multiple invoices. This endpoint mark the invoice as "PAID" if the payment can completely paid the invoice. If no amount is provided on this endpoint, the created payment will have the invoice rest amount. Use this endpoint with no "payment" parameter create a CREDIT_CARD payment with the amount of the invoice.
     * @tags Documents
     * @name AddPaymentOnInvoice
     * @summary Add a payment
     * @request POST:/documents/{id}/payment
     * @secure
     */
    export namespace AddPaymentOnInvoice {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = TransactionInput;
      export type RequestHeaders = {};
      export type ResponseBody = AddPaymentOnInvoiceData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }
  }

  export namespace Portal {
    /**
     * @description Get the current Portal informations. [This page](../api-docs/definitions/portal.md) explains what a Portal is in INFast.
     * @tags Portal
     * @name GetPortal
     * @summary Get current portal
     * @request GET:/portal
     * @secure
     */
    export namespace GetPortal {
      export type RequestParams = {};
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = GetPortalData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Update the current portal. Updates are applied partailly so you only need to send fields you want update. [This page](../api-docs/definitions/portal.md) explains what a Portal is in INFast.
     * @tags Portal
     * @name UpdatePortal
     * @summary Update current Portal
     * @request PATCH:/portal
     * @secure
     */
    export namespace UpdatePortal {
      export type RequestParams = {};
      export type RequestQuery = {};
      export type RequestBody = PortalPatch;
      export type RequestHeaders = {};
      export type ResponseBody = UpdatePortalData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }
  }

  export namespace Webhooks {
    /**
     * @description List webhook subscriptions of the current Portal. [More information on INFast webhooks](../api-docs/guides/webhooks)
     * @tags Webhooks
     * @name ListWebhooks
     * @summary List webhook subscriptions
     * @request GET:/webhooks
     * @secure
     */
    export namespace ListWebhooks {
      export type RequestParams = {};
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = ListWebhooksData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Create a new endpoint to receive webhook to your specific url. [More information on INFast webhooks](../api-docs/guides/webhooks)
     * @tags Webhooks
     * @name CreateWebhook
     * @summary Create a webhook subscription
     * @request POST:/webhooks
     * @secure
     */
    export namespace CreateWebhook {
      export type RequestParams = {};
      export type RequestQuery = {};
      export type RequestBody = WebhookInput;
      export type RequestHeaders = {};
      export type ResponseBody = CreateWebhookData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Find a webhook subscription by ID. [More information on INFast webhooks](../api-docs/guides/webhooks)
     * @tags Webhooks
     * @name GetWebhook
     * @summary Get a webhook subscription
     * @request GET:/webhooks/{id}
     * @secure
     */
    export namespace GetWebhook {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = GetWebhookData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }

    /**
     * @description Delete a webhook subscription by its ID. [More information on INFast webhooks](../api-docs/guides/webhooks)
     * @tags Webhooks
     * @name DeleteWebhook
     * @summary Delete a webhook subscription
     * @request DELETE:/webhooks/{id}
     * @secure
     */
    export namespace DeleteWebhook {
      export type RequestParams = {
        /** ID of the requested resource */
        id: string;
      };
      export type RequestQuery = {};
      export type RequestBody = never;
      export type RequestHeaders = {};
      export type ResponseBody = DeleteWebhookData;
      export type Request = ExpressRequest<RequestBody, RequestQuery, RequestParams>;
      export type Response = ExpressResponse<ResponseBody>;
    }
  }
}
