{
  "openapi": "3.0.1",
  "info": {
    "title": "INFast API",
    "description": "INFast API allows you to interact with INfast App edited by Intia. This API is subject to a \"Furious Pack\" subscribtion on INFast. More informations: [on Intia website](https://intia.fr/fr/infast/quelles-sont-les-differences-entre-les-offres-pro-et-furious/)",
    "contact": {
      "name": "Intia Dev Team",
      "email": "dev@intia.fr"
    },
    "version": "2.0.1"
  },
  "servers": [
    {
      "url": "https://api.infast.fr/api/v2"
    }
  ],
  "security": [
    {
      "oauth": [
        "read",
        "write"
      ]
    }
  ],
  "tags": [
    {
      "name": "Customers"
    },
    {
      "name": "Documents"
    },
    {
      "name": "Items"
    },
    {
      "name": "Portal"
    },
    {
      "name": "User"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Tags"
    },
    {
      "name": "Transactions"
    },
    {
      "name": "Authentication"
    }
  ],
  "paths": {
    "/oauth2/token": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "authenticate",
        "summary": "OAuth access token",
        "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`.",
        "security": [
          {
            "basicAuthOauth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type",
                  "scope"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "enum": [
                      "client_credentials"
                    ],
                    "example": "client_credentials",
                    "description": "OAuth grant type. Must be `client_credentials`."
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "read",
                      "write",
                      "read write"
                    ],
                    "example": "write",
                    "description": "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)."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OAUth success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string",
                      "example": "9db3a8296b68b7889f2803fc1143610922997ads"
                    },
                    "token_type": {
                      "type": "string",
                      "example": "Bearer",
                      "enum": [
                        "Bearer"
                      ]
                    },
                    "expires_in": {
                      "type": "integer",
                      "example": 604799,
                      "format": "int32"
                    },
                    "scope": {
                      "example": "write",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/transaction-usages": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "operationId": "listTransactionUsages",
        "summary": "List Transactions Usages",
        "description": "Fetch the list of Transaction Usages for a Portal. The results can be sorted, filtered, and paginated.\n\n🚨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`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/transaction-usage-list-orderBy"
          },
          {
            "$ref": "#/components/parameters/sortOrder"
          },
          {
            "$ref": "#/components/parameters/transaction-list-startDate"
          },
          {
            "$ref": "#/components/parameters/transaction-list-endDate"
          },
          {
            "name": "customerId",
            "in": "query",
            "description": "Filter transactions that belong to a specific Customer",
            "schema": {
              "$ref": "#/components/schemas/object-id"
            }
          },
          {
            "name": "documentId",
            "in": "query",
            "description": "Filter transaction usages that belong to a specific document",
            "schema": {
              "$ref": "#/components/schemas/object-id"
            }
          },
          {
            "$ref": "#/components/parameters/transaction-list-minimumAmount"
          },
          {
            "$ref": "#/components/parameters/transaction-list-maximumAmount"
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "$ref": "#/components/parameters/updatedUntil"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          }
        ],
        "responses": {
          "200": {
            "description": "Success response\nReturn an array of desired transaction usages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-array-transaction-usage-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      }
    },
    "/transaction-usages/{id}": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "operationId": "getTransactionUsage",
        "summary": "Get a Transaction Usage",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Details of a given transaction usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-transaction-usage-output"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      }
    },
    "/transactions": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "operationId": "listTransactions",
        "summary": "List Transactions",
        "description": "Fetch the list of Transactions for a Portal. The results can be sorted, filtered, and paginated.\n\n🚨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`.",
        "parameters": [
          {
            "name": "orderBy",
            "in": "query",
            "description": "Sorts transactions by a specific field name. The sort order is defined in `order`. Possible values are:\n- **date** (default): sorts the results by the transaction date.\n- **customerName**: sorts the results by the name of the customer involved in the transaction.\n- **amount**: sorts the results by the transaction amount.\n- **method**: sorts the results by the payment method of the transaction.\n",
            "allowEmptyValue": true,
            "schema": {
              "type": "string",
              "default": "date",
              "enum": [
                "lastUpdate",
                "date",
                "customerName",
                "amount",
                "method"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/sortOrder"
          },
          {
            "$ref": "#/components/parameters/transaction-list-startDate"
          },
          {
            "$ref": "#/components/parameters/transaction-list-endDate"
          },
          {
            "name": "customerId",
            "in": "query",
            "description": "Filter transactions that belong to a specific Customer",
            "schema": {
              "$ref": "#/components/schemas/object-id"
            }
          },
          {
            "$ref": "#/components/parameters/transaction-list-minimumAmount"
          },
          {
            "$ref": "#/components/parameters/transaction-list-maximumAmount"
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "$ref": "#/components/parameters/updatedUntil"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          }
        ],
        "responses": {
          "200": {
            "description": "Success response\nReturn an array of desired transactions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-array-transaction-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      }
    },
    "/transactions/{id}": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "operationId": "getTransaction",
        "summary": "Get a Transaction",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Details of a given transaction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-transaction-output"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      }
    },
    "/me": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get current user",
        "description": "Retrieve the currently logged user (based on [OAuth authentication](../api-docs/definitions/authentication.md)).",
        "operationId": "getMe",
        "responses": {
          "200": {
            "description": "Data of the currently logged user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-user-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      }
    },
    "/items": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "List Items",
        "description": "Fetch a list of the portals items.\n\nResults are paginated and can be filtered by a search query.",
        "operationId": "findItems",
        "parameters": [
          {
            "name": "orderBy",
            "in": "query",
            "description": "Sorts request results by a specific field name. The sort order is defined in `order`. Possible values are:\n- **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_)\n  - **name**: Sort by items name\n  - **isService**: Sort by item type (service or item). If `order=1`, items are returned first.\n  - **reference**: Sort by item reference\n  - **price**: Sort by item price (excluding taxes)",
            "allowEmptyValue": true,
            "schema": {
              "type": "string",
              "default": "name",
              "enum": [
                "lastUpdate",
                "name",
                "type",
                "reference",
                "price"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/sortOrder"
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "$ref": "#/components/parameters/updatedUntil"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "name": "type",
            "in": "query",
            "description": "Filter by item type.",
            "allowEmptyValue": true,
            "example": "item",
            "schema": {
              "$ref": "#/components/schemas/item-type"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search value of parameter in all majors fields (name, description, reference).\nTo 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`.\n\nIf you want to search exactly by name or reference, use `name` or `reference` parameters.",
            "allowEmptyValue": true,
            "example": "parpaing chantier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Search by item name.",
            "allowEmptyValue": true,
            "example": "Déplcement",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reference",
            "in": "query",
            "description": "Search by item reference.",
            "example": "CL-2913",
            "allowEmptyValue": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minimumPrice",
            "in": "query",
            "description": "Search for items with a price higher than or equal to minimumPrice",
            "allowEmptyValue": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "maximumPrice",
            "in": "query",
            "description": "Search for items with a price lower than or equal to maximumPrice.",
            "allowEmptyValue": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success response\nReturns an array of items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-array-item-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read",
              "write"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Items"
        ],
        "summary": "Create an Item",
        "description": "Create a new item.\n",
        "operationId": "createItem",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/item-input"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "description": "Success, the item is created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-item-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    },
    "/items/{id}": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "Get an Item",
        "description": "Find an Item by ID.",
        "operationId": "getItem",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-item-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Items"
        ],
        "summary": "Delete an Item",
        "description": "Delete an Item by its ID.",
        "operationId": "deleteItem",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success, item is deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Items"
        ],
        "summary": "Update an Item",
        "description": "Update an item. Updates are partial. Therefore, when you want to modify an Item, only send the fields you wish to update.        ",
        "operationId": "updateItem",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "requestBody": {
          "description": "Send all fields you want update",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/item-patch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-item-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    },
    "/customers": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List 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.",
        "operationId": "findCustomers",
        "parameters": [
          {
            "$ref": "#/components/parameters/sortOrder"
          },
          {
            "name": "orderBy",
            "in": "query",
            "description": "Sorts request results by a specific field name. The sort order is defined in `order`. Possible values are:\n- **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_) \n- **name**: Sort by customers name \n- **reference**: Sort by customer reference\n- **phone**: Sort by customer phone number reference (if customer has multiple phone numbers, we'll look for mobile number, then for landline number)\n- **dueAmount**: Sort by customer current due amount\n- **documentsCount**: Sort customers by number of documents",
            "schema": {
              "type": "string",
              "default": "name",
              "enum": [
                "lastUpdate",
                "name",
                "reference",
                "phone",
                "dueAmount",
                "documentsCount"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "$ref": "#/components/parameters/updatedUntil"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search this parameter in all majors fields (name, reference, email, phone, mobile, fax, siret, vat, address fields, contacts fields and delivery fields).\nTo search with multiple parameters use space as separator.",
            "schema": {
              "type": "string"
            },
            "example": "Berthier Strasbourg"
          },
          {
            "name": "name",
            "in": "query",
            "description": "Search by customers name",
            "example": "Jean Patrick Ranu",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reference",
            "in": "query",
            "description": "Search by customers reference",
            "example": "CL-1265",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "description": "Search by customers email",
            "example": "bertier@cogip29.com",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minimumDueAmount",
            "in": "query",
            "description": "Search for customers with an amount due higher than or equal to this value",
            "example": 100,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "maximumDueAmount",
            "in": "query",
            "description": "Search for customers with an amount due less than or equal to this value",
            "example": 5000,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "documentStatus",
            "in": "query",
            "description": "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).            ",
            "schema": {
              "type": "string",
              "enum": [
                "ACTIVE",
                "LATE"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns an array of customers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-array-customer-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a Customer",
        "description": "Create a new customer.",
        "operationId": "createCustomer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/customer-input"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "description": "Success, the customer is created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-customer-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    },
    "/customers/{id}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get a Customer",
        "description": "Get a Customer by its ID",
        "operationId": "getCustomer",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-customer-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read",
              "write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Delete a Customer",
        "description": "Delete a Customer by its ID.",
        "operationId": "deleteCustomer",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success, customer is deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Customers"
        ],
        "summary": "Update a Customer",
        "description": "Update a Customer. Updates are partial. Therefore, when you want to modify a Customer, only send the fields you wish to update.",
        "operationId": "updateCustomer",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/customer-patch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-customer-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    },
    "/customers/{id}/transactions": {
      "get": {
        "tags": [
          "Customers",
          "Transactions"
        ],
        "operationId": "listCustomerTransactions",
        "summary": "List Transactions of a Customer",
        "description": "Fetch the list of Transactions for a given Customer. The results can be sorted, filtered, and paginated.\n\n🚨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`.",
        "parameters": [
          {
            "name": "orderBy",
            "in": "query",
            "description": "Sorts transactions by a specific field name. The sort order is defined in `order`. Possible values are:\n- **date** (default): sorts the results by the transaction date.\n- **amount**: sorts the results by the transaction amount.\n- **method**: sorts the results by the payment method of the transaction.\n",
            "allowEmptyValue": true,
            "schema": {
              "type": "string",
              "default": "date",
              "enum": [
                "lastUpdate",
                "date",
                "amount",
                "method"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/sortOrder"
          },
          {
            "$ref": "#/components/parameters/transaction-list-startDate"
          },
          {
            "$ref": "#/components/parameters/transaction-list-endDate"
          },
          {
            "$ref": "#/components/parameters/transaction-list-minimumAmount"
          },
          {
            "$ref": "#/components/parameters/transaction-list-maximumAmount"
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "$ref": "#/components/parameters/updatedUntil"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          }
        ],
        "responses": {
          "200": {
            "description": "Success response\nReturn an array of desired transactions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-array-transaction-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      }
    },
    "/documents": {
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "List Documents",
        "description": "Fetch a list of the portals documents.\n\nResults are paginated and can be filtered by a search query.",
        "operationId": "findDocuments",
        "parameters": [
          {
            "name": "orderBy",
            "in": "query",
            "description": "Sorts documents by a specific field name. The sort order is defined in `order`. Possible values are:\n - **lastUpdate**: Sort results by items last update.\n  - **to.name**: Sort by document customer name.\n  - **emitDate**: Sort by official issuance date of the Document. Note, this date may differ from the actual creation date of the Document.\n  - **reference**: Sort by document reference\n  - **amount**: Sort by document total amount (without taxes and global discount)\n  - **refInt**: Sort by document internal reference",
            "allowEmptyValue": true,
            "schema": {
              "type": "string",
              "default": "emitDate",
              "enum": [
                "lastUpdate",
                "emitDate",
                "to.name",
                "reference",
                "amount",
                "refInt"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/sortOrder"
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search this parameter in all majors fields (title, reference, referenceInternal, messageTop, messageBottom, customerName, amountVatNet, amountNet).\nTo search with multiple parameters use space as separator",
            "allowEmptyValue": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filters by status of the Document. [More information on the different statuses here](../api-docs/definitions/document#status)",
            "schema": {
              "$ref": "#/components/schemas/document-status"
            }
          },
          {
            "$ref": "#/components/parameters/document-type"
          },
          {
            "$ref": "#/components/parameters/document-subtype"
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "$ref": "#/components/parameters/updatedUntil"
          },
          {
            "name": "reference",
            "in": "query",
            "description": "Search by document reference",
            "example": "F2302-1265",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "description": "Search documents belonging to a specific customer",
            "schema": {
              "$ref": "#/components/schemas/object-id"
            }
          },
          {
            "name": "startEmitDate",
            "in": "query",
            "description": "Filters document having emit date higher than or equal to startEmitDate",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endEmitDate",
            "in": "query",
            "description": "Filters document having emit date less than or equal to endEmitDate",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "minimumAmount",
            "in": "query",
            "description": "Filter documents with an amount (without VAT) lower than this value.",
            "schema": {
              "type": "number"
            },
            "example": 100
          },
          {
            "name": "maximumAmount",
            "in": "query",
            "description": "Filter documents with an net amount (without VAT) greater than this value.",
            "schema": {
              "type": "number"
            },
            "example": 5000
          },
          {
            "name": "minimumAmountWithVat",
            "in": "query",
            "description": "Filter documents with an amount (with VAT) lower than this value.",
            "schema": {
              "type": "number"
            },
            "example": 120
          },
          {
            "name": "maximumAmountWithVat",
            "in": "query",
            "description": "Filter documents with an net amount (with VAT) greater than this value.",
            "schema": {
              "type": "number"
            },
            "example": 6000
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          }
        ],
        "responses": {
          "200": {
            "description": "Success response\nReturn an array of desired documents",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-array-document-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Create Document",
        "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`.\n\nSimilarly, you will need [Items](../api-docs/definitions/item.md) to add to the `lines` of your Document.\n\nIf required, you can manually set values for the `description`, `price`, `amount`, `vat`, and `amountVat` fields.\n",
        "operationId": "createDocument",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/document-input"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "description": "Success, the document is created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-document-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    },
    "/documents/{id}": {
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "Get Document",
        "description": "Find a document by ID.\n",
        "operationId": "getDocument",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-document-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read",
              "write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Documents"
        ],
        "summary": "Delete document",
        "description": "Deletes a document. The deletion is only available on documents with DRAFT status. If document is not a DRAFT, deletion will be denied.",
        "operationId": "deleteDocument",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success, document has been deleted",
            "content": {}
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ]
      }
    },
    "/documents/{id}/transaction-usages": {
      "get": {
        "tags": [
          "Documents",
          "Transactions"
        ],
        "operationId": "listDocumentTransactionUsages",
        "summary": "List Transaction Usages of a Document",
        "description": "Fetch the list of Transaction Usages for a given Document. The results can be sorted, filtered, and paginated.\n\n🚨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`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/transaction-usage-list-orderBy"
          },
          {
            "$ref": "#/components/parameters/sortOrder"
          },
          {
            "$ref": "#/components/parameters/transaction-list-startDate"
          },
          {
            "$ref": "#/components/parameters/transaction-list-endDate"
          },
          {
            "$ref": "#/components/parameters/transaction-list-minimumAmount"
          },
          {
            "$ref": "#/components/parameters/transaction-list-maximumAmount"
          },
          {
            "$ref": "#/components/parameters/updatedSince"
          },
          {
            "$ref": "#/components/parameters/updatedUntil"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          }
        ],
        "responses": {
          "200": {
            "description": "Success response\nReturn an array of desired transaction usages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-array-transaction-usage-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      }
    },
    "/documents/{id}/pdf": {
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "Export document as PDF",
        "description": "Download the document as a PDF file.",
        "operationId": "exportPdf",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success, PDF is generated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "pdfB64": {
                      "type": "string",
                      "description": "The pdf file encoded in B64"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read",
              "write"
            ]
          }
        ]
      }
    },
    "/documents/{id}/messages": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Send a message about document",
        "description": "Send a document by email.\n\nBy default send the email:\n- from portal email or user email\n- to the customer email (customer's email address must be set)\n- subject and message are set from selected template\n- default template used is defined by the document due date\n\t - document is not yet due => use STANDARD template\n\t - document will soon be due => use PRELAUNCH template\n\t - document is overdue => use RELAUNCH1 template\n\t - document is overdue and a previous relauch email has been sent => use RELAUNCH2 template\n\nYou can override:\n- from (must be a user or portal email)\n- to\n- model\n- subject\n- message\n\nYou can add :\n- cc emails separated by semicolon\n\nThe email will be added to the document's email history.",
        "operationId": "sendMessage",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "requestBody": {
          "description": "Message to send",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/message-input"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "Success, message is sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-document-message"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    },
    "/documents/{id}/accept-quotation": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Mark a quotation as accepted by customer",
        "description": "Mark a quotation as accepted by the customer.\nThis action is only applicable to quotations with VALIDATED status (not DRAFT nor ACCEPTED or REFUSED)\nOnce applied, this method will change the quotation status to ACCEPTED.",
        "operationId": "acceptQuotation",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success, quotation is accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-document-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ]
      }
    },
    "/documents/{id}/refuse-quotation": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Mark a quotation as refused by customer",
        "description": "Mark a quotation as refused by the customer.\nThis action is only applicable to quotations with VALIDATED status (not DRAFT nor ACCEPTED or REFUSED)\nOnce applied, this method will change the quotation status to REFUSED.",
        "operationId": "refuseQuotation",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success, quotation is accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-document-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ]
      }
    },
    "/documents/{id}/validate": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Validate a document",
        "description": "Validates a document (i.e. removes the \"DRAFT\" status).\nThis action is only applicable to document with DRAFT status.\nOnce applied, this method will change the document status to VALIDATED.",
        "operationId": "validateDocument",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success, document is validated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-document-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ]
      }
    },
    "/documents/{id}/convert/invoice": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Converts a quotation to an invoice",
        "description": "Converts a quotation to an invoice.\nThis action is only applicable to quotations with ACCEPTED status (i.e: marked as accepted by the client)\nThis method will return the newly created Invoice. Note: the created invoice will have a DRAFT status.",
        "operationId": "convertToInvoice",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success, quotation is converted to invoice. The new invoice is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-document-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ]
      }
    },
    "/documents/{id}/payment": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Add a payment",
        "description": "Add a payment on an invoice.\n\nA payment is firstly added on a customer, then the payment is used on the invoice.\nIf the payment amount is higher of the invoice amount, the payment can be used on multiple invoices.\n\nThis endpoint mark the invoice as \"PAID\" if the payment can completely paid the invoice.\n\nIf no amount is provided on this endpoint, the created payment will have the invoice rest amount.\n\nUse this endpoint with no \"payment\" parameter create a CREDIT_CARD payment with the amount of the invoice.",
        "operationId": "addPaymentOnInvoice",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/transaction-input"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "Success, created transaction is returned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-transaction-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    },
    "/portal": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "Get current portal",
        "description": "Get the current Portal informations.\n\n[This page](../api-docs/definitions/portal.md) explains what a Portal is in INFast.",
        "operationId": "getPortal",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-portal-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Portal"
        ],
        "summary": "Update current Portal",
        "description": "Update the current portal.\n\nUpdates are applied partailly so you only need to send fields you want update.\n\n[This page](../api-docs/definitions/portal.md) explains what a Portal is in INFast.",
        "operationId": "updatePortal",
        "requestBody": {
          "description": "Send all fields you want update.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/portal-patch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-portal-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    },
    "/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "listWebhooks",
        "summary": "List webhook subscriptions",
        "description": "List webhook subscriptions of the current Portal.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "responses": {
          "200": {
            "description": "Return the all webhooks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-array-webhook-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a webhook subscription",
        "description": "Create a new endpoint to receive webhook to your specific url.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "createWebhook",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/webhook-input"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Return the created webhook",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-webhook-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ],
        "x-codegen-request-body-name": "body"
      }
    },
    "/webhooks/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Get a webhook subscription",
        "description": "Find a webhook subscription by ID.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "getWebhook",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/data-webhook-output"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook subscription",
        "description": "Delete a webhook subscription by its ID.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "deleteWebhook",
        "parameters": [
          {
            "$ref": "#/components/parameters/path-id"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/error"
          }
        },
        "security": [
          {
            "oauth": [
              "write"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "data-user-output": {
        "title": "User Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/user-output"
          }
        }
      },
      "user-output": {
        "title": "User Output",
        "required": [
          "id",
          "creationDate",
          "email",
          "lastConnectionDate",
          "name"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/object-id"
          },
          "name": {
            "type": "string",
            "description": "Fullname of the user",
            "example": "Martin DUPOND"
          },
          "email": {
            "type": "string",
            "description": "Email address of user",
            "example": "martin.dupond@duponsa.com"
          },
          "mobile": {
            "$ref": "#/components/schemas/phone-mobile"
          },
          "phone": {
            "$ref": "#/components/schemas/phone-landline"
          },
          "address": {
            "$ref": "#/components/schemas/address"
          },
          "creationDate": {
            "type": "string",
            "format": "date-time",
            "description": "Date of this user's account creation",
            "example": "2023-04-12T19:56:04.311Z"
          },
          "lastConnectionDate": {
            "type": "string",
            "format": "date-time",
            "description": "Date of this user's last connection to INFast",
            "example": "2023-10-03T15:08:46.174Z"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          }
        },
        "description": ""
      },
      "item-type": {
        "type": "string",
        "description": "Tells if item is a product or a service. More information on that [here](../api-docs/definitions/item#type).",
        "example": "PRODUCT",
        "enum": [
          "PRODUCT",
          "SERVICE"
        ]
      },
      "item-input": {
        "title": "Item Input (Model)",
        "required": [
          "name",
          "price",
          "vat"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "maxLength": 1024,
            "type": "string",
            "description": "Name of the item",
            "example": "Article 1"
          },
          "price": {
            "type": "number",
            "description": "Selling price (without tax) of the item in default currency (Euro)",
            "example": 45.96
          },
          "vat": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "The default VAT rate applied to this item (Ex, 20%, value = 20)",
            "example": 20
          },
          "description": {
            "maxLength": 8196,
            "type": "string",
            "description": "Optional description of the item.\nDisplayed under item name in document.",
            "example": "My beautiful description"
          },
          "reference": {
            "maxLength": 24,
            "type": "string",
            "description": "Reference of the item.\nAutomatically generated if empty during creation.",
            "example": "P-000123"
          },
          "type": {
            "$ref": "#/components/schemas/item-type"
          },
          "buyingPrice": {
            "type": "number",
            "description": "Buying price (without tax) of this item (cost price), allow to compute margin",
            "example": 35.74
          },
          "unit": {
            "maxLength": 24,
            "type": "string",
            "description": "Sales unit",
            "example": "m"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          }
        },
        "description": "Items are used in documents to describe document content.\n\nThey save all information to allow easy reuse in documents.\n\nDuring document creation you can use existing proctucts and/or override the information if required.\n\nItems can represent items or services."
      },
      "item-patch": {
        "title": "Item Patch (Model)",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "maxLength": 1024,
            "type": "string",
            "description": "Name of the item",
            "example": "Article 1"
          },
          "price": {
            "type": "number",
            "description": "Selling price (without tax) of the item in default currency (Euro)",
            "example": 45.96
          },
          "vat": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "The default VAT rate applied to this item (Ex, 20%, value = 20)",
            "example": 20
          },
          "description": {
            "maxLength": 8196,
            "type": "string",
            "description": "Optional description of the item.\nDisplayed under item name in document.",
            "example": "My beautiful description"
          },
          "reference": {
            "maxLength": 24,
            "type": "string",
            "description": "Reference of the item.\nAutomatically generated if empty during creation.",
            "example": "P-000123"
          },
          "type": {
            "$ref": "#/components/schemas/item-type"
          },
          "buyingPrice": {
            "type": "number",
            "description": "Buying price (without tax) of this item (cost price), allow to compute margin",
            "example": 35.74
          },
          "unit": {
            "maxLength": 24,
            "type": "string",
            "description": "Sales unit",
            "example": "m"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          }
        },
        "description": "Updates are applied partailly so you only need to send fields you want update."
      },
      "data-item-output": {
        "title": "Item Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/item-output"
          }
        }
      },
      "data-array-item-output": {
        "title": "Items Array Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/item-output"
            }
          }
        }
      },
      "item-output": {
        "title": "Item Output",
        "required": [
          "id",
          "type",
          "name",
          "price",
          "reference",
          "vat",
          "lastUpdate"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/object-id"
          },
          "portalId": {
            "$ref": "#/components/schemas/portal-id"
          },
          "name": {
            "maxLength": 1024,
            "type": "string",
            "description": "Name of the item",
            "example": "Robinet Mitigeur GH520"
          },
          "type": {
            "$ref": "#/components/schemas/item-type"
          },
          "price": {
            "type": "number",
            "description": "Selling price (without tax) of the item in default currency (Euro)",
            "example": 45.96
          },
          "vat": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "The default VAT rate applied to this item (Ex, 20%, value = 20)",
            "example": 20
          },
          "buyingPrice": {
            "type": "number",
            "description": "Buying price (without tax) of this item (cost price), allow to compute margin",
            "example": 35.74
          },
          "reference": {
            "maxLength": 24,
            "type": "string",
            "description": "Reference of the item.\nAutomatically generated if empty during creation.",
            "example": "P-000123"
          },
          "unit": {
            "maxLength": 24,
            "type": "string",
            "description": "Sales unit",
            "example": "m"
          },
          "description": {
            "maxLength": 8196,
            "type": "string",
            "description": "Optional description of the item.\nDisplayed under item name in document.",
            "example": "My beautiful description"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          },
          "tagIds": {
            "$ref": "#/components/schemas/tag-ids"
          },
          "lastUpdate": {
            "$ref": "#/components/schemas/last-update"
          }
        },
        "description": "Describe the complete item model."
      },
      "customer-input": {
        "title": "Customer Creation Input",
        "allOf": [
          {
            "$ref": "#/components/schemas/customer-patch"
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "$ref": "#/components/schemas/customer-name"
              }
            },
            "required": [
              "name"
            ]
          }
        ]
      },
      "customer-patch": {
        "title": "Customer Patch",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "$ref": "#/components/schemas/customer-name"
          },
          "address": {
            "$ref": "#/components/schemas/address"
          },
          "email": {
            "$ref": "#/components/schemas/customer-email"
          },
          "mobile": {
            "$ref": "#/components/schemas/phone-mobile"
          },
          "phone": {
            "$ref": "#/components/schemas/phone-landline"
          },
          "fax": {
            "$ref": "#/components/schemas/phone-fax"
          },
          "reference": {
            "$ref": "#/components/schemas/customer-reference"
          },
          "type": {
            "$ref": "#/components/schemas/customer-type"
          },
          "delivery": {
            "$ref": "#/components/schemas/deliveryContact"
          },
          "useDelivery": {
            "$ref": "#/components/schemas/customer-use-delivery"
          },
          "sendToDelivery": {
            "$ref": "#/components/schemas/customer-send-to-delivery"
          },
          "vatId": {
            "$ref": "#/components/schemas/vat-id"
          },
          "siret": {
            "$ref": "#/components/schemas/siret"
          },
          "outsideEU": {
            "$ref": "#/components/schemas/outside-eu"
          },
          "reverseCharge": {
            "$ref": "#/components/schemas/reverse-charge"
          },
          "accountNumber": {
            "$ref": "#/components/schemas/account-number"
          },
          "defaultPaymentMethod": {
            "$ref": "#/components/schemas/payment-method"
          },
          "defaultScheduleInvoice": {
            "$ref": "#/components/schemas/payment-schedule"
          },
          "defaultScheduleQuotation": {
            "$ref": "#/components/schemas/payment-schedule"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          }
        },
        "description": "Customers are used in documents to describe the recipient.\n\nDuring document creation, the recipient information is copied from the customer."
      },
      "data-customer-output": {
        "title": "Customer Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/customer-output"
          }
        }
      },
      "data-array-customer-output": {
        "title": "Customers Array Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/customer-output"
            }
          }
        }
      },
      "contact-output": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/object-id"
          },
          "name": {
            "maxLength": 512,
            "type": "string",
            "description": "Contact's full name",
            "example": "Contact Name"
          },
          "email": {
            "maxLength": 512,
            "type": "string",
            "description": "Contact's email",
            "example": "contact@domain.com"
          },
          "phone": {
            "$ref": "#/components/schemas/phone-landline"
          },
          "address": {
            "$ref": "#/components/schemas/address"
          },
          "role": {
            "maxLength": 512,
            "type": "string",
            "description": "Contact's role",
            "example": "Directeur Général"
          }
        }
      },
      "transaction-base-output": {
        "title": "Transaction Base Output (without usages)",
        "required": [
          "id",
          "name",
          "reference",
          "lastUpdate"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/object-id"
          },
          "customerId": {
            "maxLength": 24,
            "minLength": 24,
            "type": "string",
            "description": "Unique identifier the customer attached to this transaction",
            "example": "63e3c82675de4f6978054579"
          },
          "amount": {
            "type": "number",
            "description": "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
          },
          "usedAmount": {
            "type": "number",
            "description": "The amount used in this transaction on the documents.",
            "example": 40
          },
          "refundedAmount": {
            "type": "number",
            "description": "The amount used in this transaction to refund the final customer.",
            "example": 12.5
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "description": "Date of when the transaction was made.",
            "example": "2024-04-29T19:56:04.311Z"
          },
          "method": {
            "$ref": "#/components/schemas/transaction-method"
          },
          "lastUpdate": {
            "$ref": "#/components/schemas/last-update"
          },
          "details": {
            "type": "object",
            "description": "Details of the transaction",
            "properties": {
              "check": {
                "type": "object",
                "description": "In case of payment via check, provides the details of the check.",
                "properties": {
                  "emiter": {
                    "type": "string",
                    "description": "Emiter of the check",
                    "example": "Intia SAS"
                  },
                  "bank": {
                    "type": "string",
                    "description": "The bank emitting the check",
                    "example": "Société Générale"
                  }
                }
              },
              "number": {
                "type": "string",
                "description": "Transaction number (in case of a CHECK transaction: the check number)",
                "example": "TR-000123"
              },
              "additionalInformations": {
                "type": "string",
                "description": "Additionnal informations about the transaction. In case of a BANK transfer, it can be the bank reference.",
                "example": "VIR Intia SAS FAC F-201402223"
              }
            }
          }
        }
      },
      "transaction-output": {
        "title": "Transaction Output",
        "required": [
          "id",
          "name",
          "reference",
          "lastUpdate"
        ],
        "type": "object",
        "additionalProperties": false,
        "allOf": [
          {
            "$ref": "#/components/schemas/transaction-base-output"
          },
          {
            "type": "object",
            "properties": {
              "usages": {
                "type": "array",
                "description": "All the Transaction Usage tied to this transaction.",
                "items": {
                  "$ref": "#/components/schemas/transaction-usage-base-output"
                }
              }
            }
          }
        ]
      },
      "data-transaction-usage-output": {
        "title": "Transaction Usage Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/transaction-usage-output"
          }
        }
      },
      "data-array-transaction-usage-output": {
        "title": "Transaction Usage Output Array Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/transaction-usage-output"
            }
          }
        }
      },
      "transaction-usage-base-output": {
        "title": "Transaction Usage Base Output (without transaction",
        "required": [
          "id",
          "type",
          "customerId",
          "date",
          "documentId",
          "amount"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/object-id"
          },
          "type": {
            "$ref": "#/components/schemas/transaction-usage-type"
          },
          "customerId": {
            "maxLength": 24,
            "minLength": 24,
            "type": "string",
            "description": "Unique identifier the customer attached to this transaction usage",
            "example": "63e3c82675de4f6978054579"
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "description": "Date of when the original transaction was made.",
            "example": "2024-04-29T19:56:04.311Z"
          },
          "invoiceId": {
            "maxLength": 24,
            "minLength": 24,
            "type": "string",
            "description": "Unique identifier the invoice attached to this transaction usage",
            "example": "63e3c82675de4f6978054579"
          },
          "amount": {
            "type": "number",
            "description": "The amount of the original transaction used.",
            "example": 52.5
          }
        }
      },
      "transaction-usage-output": {
        "title": "Transaction Usage Output",
        "required": [
          "id",
          "customerId",
          "date",
          "transaction",
          "invoiceId",
          "amount"
        ],
        "type": "object",
        "additionalProperties": false,
        "allOf": [
          {
            "$ref": "#/components/schemas/transaction-usage-base-output"
          },
          {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "transaction": {
                    "$ref": "#/components/schemas/transaction-base-output"
                  }
                }
              },
              {
                "type": "object",
                "properties": {
                  "creditNoteId": {
                    "maxLength": 24,
                    "minLength": 24,
                    "type": "string",
                    "description": "Unique identifier of the Document (of type `INVOICE` and subtype `CREDIT_NOTE`)  attached to this transaction usage",
                    "example": "63e3c82675de4f6978054579"
                  }
                }
              }
            ]
          }
        ]
      },
      "customer-output": {
        "title": "Customer Output (Model)",
        "required": [
          "id",
          "portalId",
          "name",
          "reference",
          "lastUpdate"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/object-id"
          },
          "portalId": {
            "$ref": "#/components/schemas/portal-id"
          },
          "name": {
            "type": "string",
            "description": "Full name",
            "example": "Paul Berthier"
          },
          "type": {
            "$ref": "#/components/schemas/customer-type"
          },
          "address": {
            "$ref": "#/components/schemas/address"
          },
          "email": {
            "$ref": "#/components/schemas/customer-email"
          },
          "mobile": {
            "$ref": "#/components/schemas/phone-mobile"
          },
          "phone": {
            "$ref": "#/components/schemas/phone-landline"
          },
          "fax": {
            "$ref": "#/components/schemas/phone-fax"
          },
          "reference": {
            "$ref": "#/components/schemas/customer-reference"
          },
          "delivery": {
            "$ref": "#/components/schemas/deliveryContact"
          },
          "useDelivery": {
            "$ref": "#/components/schemas/customer-use-delivery"
          },
          "sendToDelivery": {
            "$ref": "#/components/schemas/customer-send-to-delivery"
          },
          "vatId": {
            "$ref": "#/components/schemas/vat-id"
          },
          "siret": {
            "$ref": "#/components/schemas/siret"
          },
          "reverseCharge": {
            "$ref": "#/components/schemas/reverse-charge"
          },
          "accountNumber": {
            "$ref": "#/components/schemas/account-number"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          },
          "tagIds": {
            "$ref": "#/components/schemas/tag-ids"
          },
          "contacts": {
            "type": "array",
            "description": "Contacts list of this customer",
            "items": {
              "$ref": "#/components/schemas/contact-output"
            }
          },
          "lastUpdate": {
            "$ref": "#/components/schemas/last-update"
          },
          "defaultPaymentMethod": {
            "$ref": "#/components/schemas/payment-method"
          },
          "defaultScheduleInvoice": {
            "$ref": "#/components/schemas/payment-schedule"
          },
          "defaultScheduleQuotation": {
            "$ref": "#/components/schemas/payment-schedule"
          }
        }
      },
      "payment-schedule": {
        "type": "string",
        "enum": [
          "CASH",
          "7_DAYS",
          "15_DAYS",
          "MONTH_END",
          "30_DAYS",
          "30_DAYS_MONTH_END",
          "45_DAYS",
          "45_DAYS_MONTH_END",
          "60_DAYS",
          "60_DAYS_MONTH_END",
          "90_DAYS",
          "90_DAYS_MONTH_END",
          "CUSTOM"
        ],
        "title": "Customer Schedule (Enum)",
        "description": "Possible value for document validity periods"
      },
      "document-type": {
        "title": "Document Types (Enum)",
        "type": "string",
        "description": "The type of the document. [More information on the different types here](../api-docs/definitions/document#types).",
        "enum": [
          "QUOTATION",
          "INVOICE",
          "PURCHASE_ORDER",
          "OTHER"
        ]
      },
      "document-type-input": {
        "title": "Document Types Input (Enum)",
        "type": "string",
        "description": "Defines the type of the new document. [More information on the different types here](../api-docs/definitions/document#types)",
        "enum": [
          "QUOTATION",
          "INVOICE"
        ]
      },
      "document-subtype-input": {
        "type": "string",
        "title": "Document Subtypes Input (Enum)",
        "description": "Defines the subtype of the document. [More information on the different subtypes here](../api-docs/definitions/document#subtypes)",
        "enum": [
          "QUOTATION",
          "INVOICE",
          "PROFORMA"
        ]
      },
      "document-subtype": {
        "title": "Document Subtypes Output (Enum)",
        "type": "string",
        "description": "The subtype of the document. [More information on the different subtypes here](../api-docs/definitions/document#subtypes)",
        "enum": [
          "QUOTATION",
          "PURCHASE_ORDER",
          "INVOICE",
          "DEPOSIT",
          "CREDIT_NOTE",
          "PROFORMA",
          "SITUATION",
          "ORDER_FORM",
          "DELIVERY_NOTE",
          "CUSTOM"
        ]
      },
      "document-status": {
        "title": "Document Status (Enum)",
        "type": "string",
        "description": "Indicates the status of the Document. [More information on the different statuses here](../api-docs/definitions/document#status).",
        "enum": [
          "VALIDATED",
          "CONVERTED",
          "CANCELLED",
          "PAID",
          "DRAFT",
          "ACCEPTED",
          "REFUSED",
          "CLOSED",
          "ARCHIVED"
        ]
      },
      "document-input": {
        "title": "Document Input (Model)",
        "required": [
          "customerId",
          "lines",
          "type"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "$ref": "#/components/schemas/document-type-input"
          },
          "subtype": {
            "$ref": "#/components/schemas/document-subtype-input"
          },
          "status": {
            "type": "string",
            "description": "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)",
            "example": "VALIDATED",
            "default": "VALIDATED",
            "enum": [
              "VALIDATED",
              "DRAFT"
            ]
          },
          "customerId": {
            "maxLength": 24,
            "minLength": 24,
            "type": "string",
            "description": "Identifier of the customer",
            "example": "63e3c82675de4f6978054579"
          },
          "contactId": {
            "maxLength": 24,
            "minLength": 24,
            "type": "string",
            "description": "If we the document is for a customer's contact, set the unique identifier of the contact",
            "example": "63e3c82675de4f6978054579"
          },
          "referenceInternal": {
            "$ref": "#/components/schemas/document-reference-internal"
          },
          "title": {
            "maxLength": 1024,
            "type": "string",
            "description": "Optional document title\nDisplayed on documents list\nNot displayed on the PDF\nCan be use to make search",
            "example": "Projet global"
          },
          "emitDate": {
            "$ref": "#/components/schemas/document-emit-date"
          },
          "dueDate": {
            "$ref": "#/components/schemas/document-due-date"
          },
          "lines": {
            "minItems": 1,
            "type": "array",
            "description": "All documents lines (items, groups or comments)",
            "items": {
              "$ref": "#/components/schemas/document-line-input"
            }
          },
          "paymentMethod": {
            "$ref": "#/components/schemas/payment-method"
          },
          "paymentMethodInfo": {
            "maxLength": 512,
            "type": "string",
            "description": "Information displayed on invoice when paymentMethod === OTHER",
            "example": "PayPal"
          },
          "discount": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "$ref": "#/components/schemas/percent-or-amount"
              },
              "percent": {
                "maximum": 100,
                "minimum": 0,
                "type": "number",
                "description": "The discount express in percent"
              },
              "amount": {
                "minimum": 0,
                "type": "number",
                "description": "The discount express in currency (discount are always express without taxes)"
              }
            },
            "description": "Global discount applied on document total amount without tax"
          },
          "discountGross": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "$ref": "#/components/schemas/percent-or-amount"
              },
              "percent": {
                "maximum": 100,
                "minimum": 0,
                "type": "number",
                "description": "The discount express in percent"
              },
              "amount": {
                "minimum": 0,
                "type": "number",
                "description": "The discount express in currency"
              },
              "label": {
                "type": "string",
                "description": "Label used to display the discount name (Ex: Prime CEE)",
                "example": "Prime CEE"
              }
            },
            "description": "Global discount gross on this document, VAT is not affected by this discount"
          },
          "deposit": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "$ref": "#/components/schemas/percent-or-amount"
              },
              "percent": {
                "type": "number",
                "description": "The deposit express in percent"
              },
              "amountVat": {
                "type": "number",
                "description": "The deposit express in currency (set by the user with taxes)"
              },
              "dueDate": {
                "$ref": "#/components/schemas/document-due-date"
              }
            },
            "description": "If the document has a deposit this field is set.\nEx: If this document is a quotation, we want to display a deposit amount\nIf this document is an invoice generated from a quotation with a deposit, this field references the deposit amount"
          },
          "amountNotice": {
            "maxLength": 1024,
            "type": "string",
            "description": "Legal informations on the document.\nEx: Law articles in case of VAT exemption.\nIf empty, we check if we need to add a notice.\nIf not empty, we use this string, without check.\nExemple of notice computed\n- TVA non applicable, article 293 B du Code Général des Impôts\n- Autoliquidation de TVA, article 283 du Code général des impôts\n- Exonération de TVA, article 262 ter, I du Code général des impôts\n- Exonération de TVA, article 283-2 du Code général des impôts",
            "example": "Autoliquidation de TVA, article 283 du Code général des impôts"
          },
          "signNotice": {
            "maxLength": 1024,
            "type": "string",
            "description": "Used on quotation to override default message on sign zone",
            "example": "Signature, date et mention \"Bon pour accord\"",
            "default": "Signature, date et mention \"Bon pour accord\"\nLe cas échéant, cachet de l'organisme"
          },
          "messageTop": {
            "maxLength": 8196,
            "type": "string",
            "description": "Top message to display on document, can be multi-line",
            "example": "Pensez à la promotion du mois : ..."
          },
          "messageBottom": {
            "maxLength": 8196,
            "type": "string",
            "description": "Bottom message to display on document, can be multi-line",
            "example": "Description du projet : ..."
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          }
        },
        "description": "Document model used to create a new document."
      },
      "data-document-output": {
        "title": "Document Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/document-output"
          }
        }
      },
      "data-array-document-output": {
        "title": "Document Array Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/document-output"
            }
          }
        }
      },
      "document-reference": {
        "maxLength": 24,
        "type": "string",
        "description": "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)"
      },
      "document-reference-internal": {
        "maxLength": 24,
        "type": "string",
        "description": "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)",
        "example": "PROJ-123"
      },
      "document-reference-temporary": {
        "maxLength": 24,
        "type": "string",
        "description": "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)",
        "example": "RT-202403-0012"
      },
      "document-emiter": {
        "title": "Document Emiter (Model)",
        "required": [
          "address",
          "hasNoSiret",
          "legalForm",
          "legalNotice",
          "name",
          "noSiretMsg",
          "vatUse"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "maxLength": 1024,
            "type": "string",
            "description": "Company name",
            "example": "INTIA"
          },
          "phone": {
            "$ref": "#/components/schemas/phone-landline"
          },
          "fax": {
            "$ref": "#/components/schemas/phone-fax"
          },
          "email": {
            "maxLength": 1024,
            "type": "string",
            "description": "Company email.\nDisplayed on document PDF\nUse to send email",
            "example": "contact@intia.fr"
          },
          "website": {
            "maxLength": 1024,
            "type": "string",
            "description": "Company website.\nDisplayed on document PDF.",
            "example": "https://intia.fr"
          },
          "address": {
            "$ref": "#/components/schemas/address"
          },
          "vatId": {
            "$ref": "#/components/schemas/vat-id"
          },
          "vatUse": {
            "type": "boolean",
            "description": "Define if the company is subject to vat",
            "example": true
          },
          "siren": {
            "maxLength": 24,
            "type": "string",
            "description": "SIREN",
            "example": "814 919 106"
          },
          "siret": {
            "$ref": "#/components/schemas/siret"
          },
          "naf": {
            "maxLength": 24,
            "type": "string",
            "description": "NAF/APE Code",
            "example": "6201Z"
          },
          "rcs": {
            "maxLength": 512,
            "type": "string",
            "description": "City where the company has been registered.\nRegistre du commerce et des sociétés",
            "example": "Brest"
          },
          "legalForm": {
            "maxLength": 512,
            "type": "string",
            "description": "Legal form of the portal",
            "example": "Société par actions simplifiée"
          },
          "legalNotice": {
            "maxLength": 1024,
            "type": "string",
            "description": "Information to display on document footer",
            "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€.\nAucun escompte ne sera accordé en cas de paiement anticipé."
          },
          "capital": {
            "minimum": 0,
            "type": "number",
            "description": "Capital of the company",
            "example": 65680
          },
          "hasNoSiret": {
            "type": "boolean",
            "description": "Company which are not register can create invoice, but they should mention that the registration is in progress",
            "example": false
          },
          "noSiretMsg": {
            "maxLength": 1024,
            "type": "string",
            "description": "If company has no siret, a mention should be displayed on invoice",
            "example": "Siret en cours d'attribution"
          },
          "rna": {
            "maxLength": 512,
            "type": "string",
            "description": "Association registration number.\nOnly for association.",
            "example": "W123456789"
          },
          "rib": {
            "maxLength": 48,
            "type": "string",
            "description": "RIB, bank information displayed on invoice",
            "example": "12345 12345 12345678901 12"
          },
          "iban": {
            "maxLength": 48,
            "type": "string",
            "description": "IBAN, bank information displayed on invoice",
            "example": "FR12 1234 1234 1234 1234 1234 123"
          },
          "bic": {
            "maxLength": 48,
            "type": "string",
            "description": "BIC, bank information displayed on invoice",
            "example": "CMBRFR2BXXX"
          },
          "bank": {
            "maxLength": 512,
            "type": "string",
            "description": "Name of the bank displayed on invoice",
            "example": "Crédit Mutuel de Bretagne"
          },
          "noLogo": {
            "type": "boolean",
            "description": "true if you don't want display logo and initial letter.",
            "example": false
          },
          "timezone": {
            "maxLength": 48,
            "type": "string",
            "description": "Timezone of the portal.\n here the list of all possibbles value : https://en.wikipedia.org/wiki/List_of_tz_database_time_zones",
            "example": "Europe/Paris",
            "default": "Europe/Paris"
          }
        },
        "description": "Description of the document emiter (Company informations)\nAll informations comes from portal during document creation."
      },
      "document-receiver": {
        "required": [
          "name",
          "reference"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "maxLength": 512,
            "type": "string",
            "description": "Customer name",
            "example": "Customer Name"
          },
          "address": {
            "$ref": "#/components/schemas/address"
          },
          "email": {
            "$ref": "#/components/schemas/customer-email"
          },
          "phone": {
            "$ref": "#/components/schemas/phone-landline"
          },
          "mobile": {
            "$ref": "#/components/schemas/phone-mobile"
          },
          "fax": {
            "$ref": "#/components/schemas/phone-fax"
          },
          "toAttention": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "$ref": "#/components/schemas/object-id"
              },
              "name": {
                "maxLength": 512,
                "type": "string",
                "description": "Full name",
                "example": "Alexandre LEGLISE"
              },
              "address": {
                "$ref": "#/components/schemas/address"
              },
              "email": {
                "maxLength": 512,
                "type": "string",
                "description": "email of the contact",
                "example": "toAttention@domain.com"
              },
              "mobile": {
                "$ref": "#/components/schemas/phone-mobile"
              },
              "phone": {
                "$ref": "#/components/schemas/phone-landline"
              },
              "role": {
                "maxLength": 512,
                "type": "string",
                "description": "Role of the contact in the customer company",
                "example": "Directeur Général"
              }
            },
            "description": "Customer's contact information"
          },
          "reference": {
            "maxLength": 24,
            "type": "string",
            "example": "C-000123"
          },
          "delivery": {
            "$ref": "#/components/schemas/deliveryContact"
          },
          "useDelivery": {
            "$ref": "#/components/schemas/customer-use-delivery"
          },
          "sendToDelivery": {
            "$ref": "#/components/schemas/customer-send-to-delivery"
          },
          "vatId": {
            "$ref": "#/components/schemas/vat-id"
          },
          "siret": {
            "$ref": "#/components/schemas/siret"
          },
          "reverseCharge": {
            "$ref": "#/components/schemas/reverse-charge"
          }
        },
        "description": "Document receiptient information\nAll informations come from customer during document creation."
      },
      "document-output": {
        "title": "Document Output (Model)",
        "required": [
          "id",
          "amount",
          "amountNet",
          "amountVat",
          "amountVatNet",
          "creatorId",
          "customerId",
          "dueDate",
          "emitDate",
          "from",
          "lines",
          "status",
          "subtype",
          "to",
          "type",
          "version",
          "lastUpdate"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/object-id"
          },
          "portalId": {
            "$ref": "#/components/schemas/portal-id"
          },
          "status": {
            "$ref": "#/components/schemas/document-status"
          },
          "type": {
            "$ref": "#/components/schemas/document-type"
          },
          "subtype": {
            "$ref": "#/components/schemas/document-subtype"
          },
          "creatorId": {
            "maxLength": 24,
            "minLength": 24,
            "type": "string",
            "description": "Unique identifier of the user who created the document"
          },
          "from": {
            "$ref": "#/components/schemas/document-emiter"
          },
          "title": {
            "maxLength": 1024,
            "type": "string",
            "description": "Optional document title\nDisplayed on documents list\nNot displayed on the PDF\nCan be use to make search",
            "example": "Facture initiale projet Alpha"
          },
          "reference": {
            "$ref": "#/components/schemas/document-reference"
          },
          "referenceTemporary": {
            "$ref": "#/components/schemas/document-reference-temporary"
          },
          "referenceInternal": {
            "$ref": "#/components/schemas/document-reference-internal"
          },
          "version": {
            "$ref": "#/components/schemas/document-version"
          },
          "emitDate": {
            "$ref": "#/components/schemas/document-emit-date"
          },
          "dueDate": {
            "$ref": "#/components/schemas/document-due-date"
          },
          "customerId": {
            "maxLength": 24,
            "minLength": 24,
            "type": "string",
            "description": "Identifier of the customer bellonging to this document",
            "example": "63e3c82675de4f6978054579"
          },
          "contactId": {
            "maxLength": 24,
            "minLength": 24,
            "type": "string",
            "description": "If we the document is for a customer's contact, set the unique identifier of the contact",
            "example": "63e3c82675de4f6978054579"
          },
          "to": {
            "$ref": "#/components/schemas/document-receiver"
          },
          "lines": {
            "minItems": 1,
            "type": "array",
            "description": "All documents lines (items, groups or comments)",
            "items": {
              "$ref": "#/components/schemas/document-line-output"
            }
          },
          "discount": {
            "required": [
              "amount",
              "percent",
              "type"
            ],
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "$ref": "#/components/schemas/percent-or-amount"
              },
              "percent": {
                "maximum": 100,
                "minimum": 0,
                "type": "number",
                "description": "The discount express in percent"
              },
              "amount": {
                "minimum": 0,
                "type": "number",
                "description": "The discount express in currency (discount are always express without taxes)"
              }
            },
            "description": "Global discount applied on document total amount without tax"
          },
          "discountGross": {
            "required": [
              "amount",
              "percent",
              "type"
            ],
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "$ref": "#/components/schemas/percent-or-amount"
              },
              "percent": {
                "maximum": 100,
                "minimum": 0,
                "type": "number",
                "description": "The discount express in percent"
              },
              "amount": {
                "minimum": 0,
                "type": "number",
                "description": "The discount express in currency"
              },
              "label": {
                "type": "string",
                "description": "Label used to display the discount name (Ex: Prime CEE)",
                "example": "Prime CEE"
              }
            },
            "description": "Global discount gross on this document, VAT is not affected by this discount"
          },
          "deposit": {
            "required": [
              "amount",
              "percent",
              "type"
            ],
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "$ref": "#/components/schemas/percent-or-amount"
              },
              "percent": {
                "type": "number",
                "description": "The deposit express in percent"
              },
              "amount": {
                "minimum": 0,
                "type": "number",
                "description": "The deposit express in currency without taxes"
              },
              "amountVat": {
                "type": "number",
                "description": "The deposit express in currency (set by the user with taxes)"
              },
              "vats": {
                "type": "array",
                "description": "Part of vat on the deposit invoice, needed to recompte VATs on this invoice",
                "items": {
                  "required": [
                    "amount",
                    "vat"
                  ],
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "vat": {
                      "maximum": 100,
                      "minimum": 0,
                      "type": "number",
                      "example": 20,
                      "description": "The vat rate on the deposit (Ex, 20%, value = 20)"
                    },
                    "amount": {
                      "minimum": 0,
                      "type": "number",
                      "description": "Sums of amount without tax"
                    }
                  }
                }
              },
              "dueDate": {
                "$ref": "#/components/schemas/document-due-date"
              },
              "invoiceId": {
                "maxLength": 24,
                "minLength": 24,
                "type": "string",
                "description": "Identifier of the deposit invoice"
              },
              "reference": {
                "$ref": "#/components/schemas/document-reference"
              },
              "referenceTemporary": {
                "$ref": "#/components/schemas/document-reference-temporary"
              },
              "originalQuotationId": {
                "maxLength": 24,
                "minLength": 24,
                "type": "string",
                "description": "Identifier of the quotation which generate the deposit"
              },
              "originalQuotationReference": {
                "$ref": "#/components/schemas/document-reference"
              },
              "originalQuotationReferenceTemporary": {
                "$ref": "#/components/schemas/document-reference-temporary"
              },
              "originalQuotationDepositPercent": {
                "type": "number",
                "maximum": 100,
                "minimum": 0,
                "description": "Deposit percent of the quotation which generate the deposit"
              },
              "paidDate": {
                "type": "string",
                "description": "Date when the deposit was paid",
                "format": "date-time"
              }
            },
            "description": "If the document has a deposit this field is set.\nEx: If this document is a quotation, we want to display a deposit amount\nIf this document is an invoice generated from a quotation with a deposit, this field references the deposit amount"
          },
          "amount": {
            "minimum": 0,
            "type": "number",
            "description": "The sum of the amounts (without VAT) of all lines, without taking into account any potential global discount."
          },
          "amountNet": {
            "minimum": 0,
            "type": "number",
            "description": "The sum of the amounts (without VAT) of all lines, including any potential global discount."
          },
          "vatSummary": {
            "type": "array",
            "description": "List of all vat used\nCompute according to document's lines and discount",
            "items": {
              "required": [
                "amount",
                "vatPart",
                "vat"
              ],
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "vat": {
                  "maximum": 100,
                  "minimum": 0,
                  "type": "number",
                  "example": 20,
                  "description": "The vat rate value (Ex, 20%, value = 20)"
                },
                "vatPart": {
                  "minimum": 0,
                  "type": "number",
                  "description": "Sums of vat part after global discount.\nEx: If thesums of all items sells at 20% is 1000€ without tax, value is 200"
                },
                "amount": {
                  "minimum": 0,
                  "type": "number",
                  "description": "Sums of amount without tax after global discount.\nEx: If the sums of all items sells at 20% is 1000€ without tax, value is 1000"
                }
              }
            }
          },
          "amountVat": {
            "$ref": "#/components/schemas/document-amount-vat"
          },
          "amountVatNet": {
            "$ref": "#/components/schemas/document-amount-vat-net"
          },
          "margin": {
            "type": "number",
            "description": "Margin of this document, in percentage\nCompute according to document's lines"
          },
          "profit": {
            "type": "number",
            "description": "Margin of this document, in currency\nCompute according to document's lines"
          },
          "paymentMethod": {
            "$ref": "#/components/schemas/payment-method"
          },
          "paymentMethodInfo": {
            "maxLength": 512,
            "type": "string",
            "description": "Information displayed on invoice when paymentMethod === OTHER",
            "example": "PayPal"
          },
          "acceptedDate": {
            "type": "string",
            "description": "Date when the customer accept the quotation\nOnly for quotation",
            "format": "date-time"
          },
          "refusedDate": {
            "type": "string",
            "description": "Date when the customer refuse the quotation\nOnly for quotation",
            "format": "date-time"
          },
          "paidDate": {
            "type": "string",
            "description": "Date when the customer fully paid the invoice",
            "format": "date-time"
          },
          "totalPayments": {
            "type": "number",
            "description": "The sum of all payments on this invoice"
          },
          "amountNotice": {
            "maxLength": 1024,
            "type": "string",
            "description": "Legal informations on the document.\nEx: Law articles in case of VAT exemption.\nIf empty, we check if we need to add a notice.\nIf not empty, we use this string, without check.\nExemple of notice computed\n- TVA non applicable, article 293 B du Code Général des Impôts\n- Autoliquidation de TVA, article 283 du Code général des impôts\n- Exonération de TVA, article 262 ter, I du Code général des impôts\n- Exonération de TVA, article 283-2 du Code général des impôts",
            "example": "Autoliquidation de TVA, article 283 du Code général des impôts"
          },
          "signNotice": {
            "maxLength": 1024,
            "type": "string",
            "description": "Used on quotation to override default message on sign zone",
            "example": "Signature, date et mention \"Bon pour accord\"",
            "default": "Signature, date et mention \"Bon pour accord\"\nLe cas échéant, cachet de l'organisme"
          },
          "messageTop": {
            "maxLength": 8196,
            "type": "string",
            "description": "Top message to display on document, can be multi-line",
            "example": "Pensez à la promotion du mois : ..."
          },
          "messageBottom": {
            "maxLength": 8196,
            "type": "string",
            "description": "Bottom message to display on document, can be multi-line",
            "example": "Description du projet : ..."
          },
          "creditNoteFromInvoice": {
            "required": [
              "amountVatNet",
              "documentId",
              "reference"
            ],
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "documentId": {
                "maxLength": 24,
                "minLength": 24,
                "type": "string",
                "description": "The unique identifier of the invoice that created this creditnote"
              },
              "reference": {
                "maxLength": 24,
                "type": "string",
                "description": "The reference of the invoice that created this creditnote"
              },
              "amountVatNet": {
                "$ref": "#/components/schemas/document-amount-vat-net"
              }
            },
            "description": "If the document is a creditNote and is created from a previous invoice, this object should be set"
          },
          "creditNotesId": {
            "type": "array",
            "description": "List of creditNotes generated from this invoice",
            "items": {
              "required": [
                "amountVatNet",
                "documentId",
                "reference"
              ],
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "documentId": {
                  "maxLength": 24,
                  "minLength": 24,
                  "type": "string",
                  "description": "Identifier of the credit note"
                },
                "reference": {
                  "maxLength": 24,
                  "type": "string"
                },
                "amountVatNet": {
                  "$ref": "#/components/schemas/document-amount-vat-net"
                },
                "refund": {
                  "type": "boolean",
                  "description": "true if the credit note refund the customer, else false or empty"
                }
              }
            }
          },
          "prevDoc": {
            "required": [
              "amount",
              "amountNet",
              "amountVat",
              "amountVatNet",
              "documentId",
              "dueDate",
              "emitDate",
              "reference",
              "status",
              "subtype",
              "type",
              "version"
            ],
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "documentId": {
                "maxLength": 24,
                "minLength": 24,
                "type": "string",
                "description": "Identifier of the previous document"
              },
              "reference": {
                "maxLength": 24,
                "type": "string",
                "description": "Reference of the previous document"
              },
              "referenceInternal": {
                "$ref": "#/components/schemas/document-reference-internal"
              },
              "version": {
                "$ref": "#/components/schemas/document-version"
              },
              "type": {
                "$ref": "#/components/schemas/document-type"
              },
              "subtype": {
                "$ref": "#/components/schemas/document-subtype"
              },
              "status": {
                "$ref": "#/components/schemas/document-status"
              },
              "emitDate": {
                "$ref": "#/components/schemas/document-emit-date"
              },
              "dueDate": {
                "$ref": "#/components/schemas/document-due-date"
              },
              "amount": {
                "minimum": 0,
                "type": "number"
              },
              "amountNet": {
                "minimum": 0,
                "type": "number"
              },
              "amountVat": {
                "minimum": 0,
                "type": "number"
              },
              "amountVatNet": {
                "$ref": "#/components/schemas/document-amount-vat-net"
              },
              "prevDocId": {
                "maxLength": 24,
                "minLength": 24,
                "type": "string",
                "description": "Identifier of the previous document of this previous document"
              }
            },
            "description": "Reference the previous document.\nEx: if this document is an invoice, prevDoc can be a quotation.\nOr if this document is a quotation version 1.1, the previous document is the quotation version 1.0"
          },
          "nextDoc": {
            "required": [
              "documentId",
              "version"
            ],
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "documentId": {
                "maxLength": 24,
                "minLength": 24,
                "type": "string"
              },
              "reference": {
                "maxLength": 24,
                "type": "string"
              },
              "referenceTemporary": {
                "$ref": "#/components/schemas/document-reference-temporary"
              },
              "version": {
                "$ref": "#/components/schemas/document-version"
              }
            },
            "description": "Reference the next document.\nEx: If this document is a quotation, the next document can be an invoice"
          },
          "situationNumber": {
            "minimum": 1,
            "type": "number",
            "description": "The situation number (start at 1)"
          },
          "projectId": {
            "maxLength": 24,
            "minLength": 24,
            "type": "string",
            "description": "When a situation invoice is created, we create a project which contains all documents of the situation.\nQuotation, Deposit note, situation 1, situation 2, ..."
          },
          "messages": {
            "type": "array",
            "description": "List of messages sent about this document",
            "items": {
              "$ref": "#/components/schemas/document-message"
            }
          },
          "uneditable": {
            "type": "boolean",
            "description": "When accountant lock a period, the document is not editable."
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          },
          "lastUpdate": {
            "$ref": "#/components/schemas/last-update"
          }
        },
        "description": "The properties that are included when fetching a list of documents."
      },
      "document-line-type": {
        "type": "string",
        "description": "Type of the line ('ITEM', 'COMMENT' or 'GROUP')\nFor GROUP, only name and lines are used.\nFor COMMENT, only name is used",
        "example": "ITEM",
        "enum": [
          "ITEM",
          "COMMENT",
          "GROUP"
        ]
      },
      "document-line-compute-method": {
        "type": "string",
        "description": "To avoid rounding issues, this specify which reference field to consider for the price: `price`, `amount`, or `amountWithVat`.",
        "example": "PRICE",
        "enum": [
          "PRICE",
          "AMOUNT",
          "AMOUNT_WITH_VAT"
        ],
        "default": "PRICE"
      },
      "document-line-item-pricing": {
        "title": "Document Line Item Pricing",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "computeMethod": {
            "$ref": "#/components/schemas/document-line-compute-method"
          },
          "price": {
            "type": "number",
            "description": "Unitary price (excluding VAT). *Should be defined when computeMethod = PRICE (or empty)*",
            "example": 45.25
          },
          "vat": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "VAT rate (Ex, 20%, value = 20)",
            "example": 20
          },
          "discount": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "Discount of this line expressed in percent",
            "example": 10
          },
          "quantity": {
            "minimum": 0,
            "type": "number",
            "description": "Quantity sold",
            "example": 4
          },
          "amountWithVat": {
            "type": "number",
            "description": "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
          },
          "amount": {
            "type": "number",
            "description": "Total price (excluding VAT) of the line (will not be multiplied by quantity). *Should be defined when computeMethod = AMOUNT (or empty)*",
            "example": 45.25
          }
        }
      },
      "document-line-item-reuse": {
        "title": "Document Line Item Reuse Input",
        "required": [
          "itemId",
          "lineType"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "lineType": {
            "enum": [
              "ITEM"
            ],
            "example": "ITEM"
          },
          "itemId": {
            "minLength": 1,
            "type": "string",
            "description": "Identifier of the item",
            "example": "63e3c82675de4f6978054579"
          },
          "description": {
            "maxLength": 8196,
            "type": "string",
            "description": "Description of the item",
            "example": "My beautiful description"
          },
          "reference": {
            "minLength": 1,
            "type": "string",
            "description": "Item's reference",
            "example": "P-000123"
          },
          "buyingPrice": {
            "type": "number",
            "description": "Buying price without tax (used to compute margin and profit)",
            "example": 30.9
          },
          "unit": {
            "type": "string",
            "description": "Item's unit",
            "example": "m"
          },
          "computeMethod": {
            "$ref": "#/components/schemas/document-line-compute-method"
          },
          "price": {
            "type": "number",
            "description": "Unitary price (excluding VAT). *Should be defined when computeMethod = PRICE (or empty)*",
            "example": 45.25
          },
          "vat": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "VAT rate (Ex, 20%, value = 20)",
            "example": 20
          },
          "discount": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "Discount of this line expressed in percent",
            "example": 10
          },
          "quantity": {
            "minimum": 0,
            "type": "number",
            "description": "Quantity sold",
            "example": 4
          },
          "amountWithVat": {
            "type": "number",
            "description": "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
          },
          "amount": {
            "type": "number",
            "description": "Total price (excluding VAT) of the line (will not be multiplied by quantity). *Should be defined when computeMethod = AMOUNT (or empty)*",
            "example": 45.25
          }
        }
      },
      "document-line-item-create": {
        "title": "Document Line Item Create Input",
        "required": [
          "name",
          "lineType",
          "price",
          "vat"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "lineType": {
            "enum": [
              "ITEM"
            ],
            "example": "ITEM"
          },
          "name": {
            "minLength": 1,
            "type": "string",
            "description": "Items's name",
            "example": "Radiateur D 500"
          },
          "description": {
            "maxLength": 8196,
            "type": "string",
            "description": "Description of the Item",
            "example": "Radiateur electrique - 500W"
          },
          "reference": {
            "minLength": 1,
            "type": "string",
            "description": "Item's reference",
            "example": "P-000123"
          },
          "type": {
            "$ref": "#/components/schemas/item-type"
          },
          "buyingPrice": {
            "type": "number",
            "description": "Buying price without tax (used to compute margin and profit)",
            "example": 30.9
          },
          "unit": {
            "type": "string",
            "description": "Item's unit (if applies)",
            "example": "m"
          },
          "phantom": {
            "type": "boolean",
            "description": "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."
          },
          "computeMethod": {
            "$ref": "#/components/schemas/document-line-compute-method"
          },
          "price": {
            "type": "number",
            "description": "Unitary price (excluding VAT). *Should be defined when computeMethod = PRICE (or empty)*",
            "example": 45.25
          },
          "vat": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "VAT rate (Ex, 20%, value = 20)",
            "example": 20
          },
          "discount": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "Discount of this line expressed in percent",
            "example": 10
          },
          "quantity": {
            "minimum": 0,
            "type": "number",
            "description": "Quantity sold",
            "example": 4
          },
          "amountWithVat": {
            "type": "number",
            "description": "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
          },
          "amount": {
            "type": "number",
            "description": "Total price (excluding VAT) of the line (will not be multiplied by quantity). *Should be defined when computeMethod = AMOUNT (or empty)*",
            "example": 45.25
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          }
        }
      },
      "document-line-item-input": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/document-line-item-reuse"
          },
          {
            "$ref": "#/components/schemas/document-line-item-create"
          }
        ]
      },
      "document-line-item-output": {
        "title": "Document Line Item Output",
        "required": [
          "lineType",
          "name",
          "itemId",
          "description",
          "reference",
          "type",
          "price",
          "quantity",
          "vat",
          "discount",
          "computeMethod",
          "phantom",
          "amount",
          "amountVat",
          "vatPart",
          "isNewLine"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "lineType": {
            "enum": [
              "ITEM"
            ],
            "example": "ITEM"
          },
          "name": {
            "minLength": 1,
            "type": "string",
            "description": "Item's name",
            "example": "Radiateur à eau T223"
          },
          "itemId": {
            "minLength": 1,
            "type": "string",
            "description": "Identifier of the item, only required in case an existing item is used",
            "example": "63e3c82675de4f6978054579"
          },
          "description": {
            "maxLength": 8196,
            "type": "string",
            "description": "Description of the item",
            "example": "My beautiful description"
          },
          "reference": {
            "minLength": 1,
            "type": "string",
            "description": "Item's reference",
            "example": "P-000123"
          },
          "type": {
            "$ref": "#/components/schemas/item-type"
          },
          "price": {
            "type": "number",
            "description": "Price excluding VAT",
            "example": 45.25
          },
          "buyingPrice": {
            "type": "number",
            "description": "Buying price without tax (used to compute margin and profit)",
            "example": 30.9
          },
          "unit": {
            "type": "string",
            "description": "Item's unit",
            "example": "m"
          },
          "quantity": {
            "minimum": 0,
            "type": "number",
            "description": "Quantity sold",
            "example": 4
          },
          "vat": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "VAT rate (Ex, 20%, value = 20)",
            "example": 20
          },
          "discount": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "Discount of this line expressed in percent",
            "example": 10
          },
          "computeMethod": {
            "$ref": "#/components/schemas/document-line-compute-method"
          },
          "phantom": {
            "type": "boolean",
            "description": "Set to true, if you don't want to save this item in database"
          },
          "amount": {
            "type": "number",
            "description": "Total amount without tax (price * quantity).",
            "example": 181
          },
          "amountVat": {
            "$ref": "#/components/schemas/document-amount-vat"
          },
          "vatPart": {
            "type": "number",
            "description": "VAT part. For example if the item is sold 100€ with 20% VAT, vatPart value is 20)",
            "example": 36.2
          },
          "isNewLine": {
            "type": "boolean",
            "description": "Only use on situation invoice.\nTrue if this line was not on quotation and not on a previous situation",
            "example": false
          },
          "progress": {
            "$ref": "#/components/schemas/document-line-progress"
          },
          "previousProgress": {
            "$ref": "#/components/schemas/document-line-progress"
          }
        }
      },
      "document-line-comment-input": {
        "title": "Document Line Comment Input",
        "required": [
          "lineType",
          "name"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "lineType": {
            "enum": [
              "COMMENT"
            ],
            "example": "COMMENT"
          },
          "name": {
            "maxLength": 8196,
            "type": "string",
            "description": "The comment to display on the document",
            "example": "My beautiful comment"
          }
        }
      },
      "document-line-comment-output": {
        "title": "Document Line Comment Input",
        "required": [
          "lineType",
          "name"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "lineType": {
            "enum": [
              "COMMENT"
            ],
            "example": "COMMENT"
          },
          "name": {
            "maxLength": 8196,
            "type": "string",
            "description": "The comment to display on the document",
            "example": "My beautiful comment"
          },
          "isNewLine": {
            "type": "boolean",
            "description": "Only use on situation invoice.\nTrue if this line was not on quotation and not on a previous situation",
            "example": false
          }
        }
      },
      "document-line-group-input": {
        "title": "Document Line Group Input",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "lineType",
          "lines",
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Group displayed name",
            "example": "Materiaux"
          },
          "lineType": {
            "enum": [
              "GROUP"
            ],
            "example": "GROUP"
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/document-line-item-input"
                },
                {
                  "$ref": "#/components/schemas/document-line-comment-input"
                }
              ]
            }
          }
        }
      },
      "document-line-group-output": {
        "title": "Document Line Group Output",
        "required": [
          "lineType"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "lineType": {
            "enum": [
              "GROUP"
            ],
            "example": "GROUP"
          },
          "name": {
            "type": "string",
            "description": "Group displayed name",
            "example": "Materiaux"
          },
          "isNewLine": {
            "type": "boolean",
            "description": "Only use on situation invoice.\nTrue if this line was not on quotation and not on a previous situation",
            "example": false
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/document-line-item-output"
                },
                {
                  "$ref": "#/components/schemas/document-line-comment-output"
                }
              ]
            }
          }
        }
      },
      "document-line-progress": {
        "required": [
          "amount",
          "percentage",
          "progressType",
          "quantity"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "percentage": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "Advancement express in percent",
            "example": 25
          },
          "quantity": {
            "minimum": 0,
            "type": "number",
            "description": "Advancement express in quantity",
            "example": 1
          },
          "amount": {
            "type": "number",
            "description": "Advancement express in amount",
            "example": 45.25
          },
          "progressType": {
            "maximum": 3,
            "minimum": 1,
            "type": "number",
            "description": "Need know what the user set\n1 = percentage\n2 = quantity\n3 = amount",
            "example": 1
          }
        },
        "description": "Only used on situation invoice\nDescribes the progress of the line for the current situation invoice"
      },
      "document-line-input": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/document-line-item-input"
          },
          {
            "$ref": "#/components/schemas/document-line-comment-input"
          },
          {
            "$ref": "#/components/schemas/document-line-group-input"
          }
        ],
        "discriminator": {
          "propertyName": "lineType",
          "x-explicitMappingOnly": true,
          "mapping": {
            "ITEM": "#/components/schemas/document-line-item-input",
            "COMMENT": "#/components/schemas/document-line-comment-input",
            "GROUP": "#/components/schemas/document-line-group-input"
          }
        }
      },
      "document-line-output": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/document-line-item-output"
          },
          {
            "$ref": "#/components/schemas/document-line-comment-output"
          },
          {
            "$ref": "#/components/schemas/document-line-group-output"
          }
        ],
        "discriminator": {
          "propertyName": "lineType",
          "x-explicitMappingOnly": true,
          "mapping": {
            "ITEM": "#/components/schemas/document-line-item-output",
            "COMMENT": "#/components/schemas/document-line-comment-output",
            "GROUP": "#/components/schemas/document-line-group-output"
          }
        }
      },
      "subscription-pack": {
        "title": "Subscription pack",
        "type": "string",
        "description": "Defined which is the selected pack plan",
        "example": "FURIOUS",
        "enum": [
          "PRO",
          "FURIOUS"
        ]
      },
      "subscription-recurrence": {
        "title": "Subscription recurence",
        "type": "string",
        "description": "Define the subscription mode",
        "example": "MONTHLY",
        "enum": [
          "NONE",
          "MONTHLY",
          "YEARLY",
          "BI_YEARLY"
        ]
      },
      "data-document-message": {
        "title": "Document message Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/document-message"
          }
        }
      },
      "data-array-document-message": {
        "title": "Document Array message",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/document-message"
            }
          }
        }
      },
      "document-message": {
        "title": "Document Message (Inner Model)",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/object-id"
          },
          "model": {
            "$ref": "#/components/schemas/email-model-type"
          },
          "from": {
            "maxLength": 1024,
            "type": "string",
            "description": "The sender email address.\nShould be one of INFast's user",
            "example": "contact@intia.fr"
          },
          "to": {
            "maxLength": 1024,
            "type": "string",
            "description": "Emails list of recipient (separated by semicolon)",
            "example": "customer@domain.com"
          },
          "cc": {
            "maxLength": 1024,
            "type": "string",
            "description": "Emails list to send in copy (separated by semicolon)",
            "example": "copy1@domain.com;copy2@domain.com"
          },
          "subject": {
            "maxLength": 1024,
            "type": "string",
            "description": "Email subject",
            "example": "[INTIA] Votre facture F-000123"
          },
          "message": {
            "maxLength": 8192,
            "type": "string",
            "description": "Email body",
            "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"
          },
          "send": {
            "type": "string",
            "description": "Date when the email is send (need synchro with server).",
            "format": "date-time"
          },
          "view": {
            "type": "string",
            "description": "Date when the customer see this email",
            "format": "date-time"
          },
          "source": {
            "$ref": "#/components/schemas/email-source"
          },
          "attachments": {
            "type": "array",
            "description": "List of email attachments",
            "items": {
              "$ref": "#/components/schemas/email-attachment"
            }
          },
          "inboxUrl": {
            "type": "string",
            "description": "INBox url to visualize the message"
          }
        },
        "description": "Object in document.historyEmails"
      },
      "email-attachment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "filename": {
            "maxLength": 512,
            "type": "string",
            "description": "Attachment file name",
            "example": "Fiche technique article.pdf"
          },
          "attachmentId": {
            "maxLength": 24,
            "minLength": 24,
            "type": "string",
            "example": "63e3c82675de4f6978054579"
          },
          "size": {
            "minimum": 0,
            "type": "number",
            "description": "Size of the file in byte",
            "example": 23456
          },
          "source": {
            "$ref": "#/components/schemas/email-attachment-source"
          }
        },
        "description": "Describes an email attachments"
      },
      "email-source": {
        "title": "Email sources (Enum)",
        "type": "string",
        "description": "Designates if email is sent by INFast [portal](../api-docs/definitions/portal.md) 'PORTAL' or sent by INBox customer 'CUSTOMER'",
        "enum": [
          "PORTAL",
          "CUSTOMER"
        ]
      },
      "payment-method": {
        "title": "Payment methods (Enum)",
        "type": "string",
        "description": "Invoice payment method. If the desired payment method is not available, use OTHER",
        "enum": [
          "CHECK",
          "CASH",
          "DIRECT_DEBIT",
          "TRANSFER",
          "CREDITCARD",
          "TIP",
          "UNKNOWN",
          "CREDITNOTE",
          "OTHER"
        ]
      },
      "document-amount-vat": {
        "minimum": 0,
        "type": "number",
        "description": "The total amount of the line including taxes and taking into account potential discount.",
        "example": 1456.23
      },
      "document-amount-vat-net": {
        "minimum": 0,
        "type": "number",
        "description": "The net amount payable (total with taxes) for the document. This is the `amountVat` minus the amount of any deposit already paid."
      },
      "transaction-method": {
        "title": "Transaction methods",
        "type": "string",
        "description": "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`)",
        "enum": [
          "CHECK",
          "CASH",
          "DIRECT_DEBIT",
          "TRANSFER",
          "CREDITCARD",
          "TIP",
          "CREDITNOTE",
          "OTHER"
        ]
      },
      "data-transaction-output": {
        "title": "Transaction Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/transaction-output"
          }
        }
      },
      "data-array-transaction-output": {
        "title": "Transaction Output Array Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/transaction-output"
            }
          }
        }
      },
      "transaction-input": {
        "title": "Transaction Input (Model)",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "method": {
            "$ref": "#/components/schemas/transaction-method"
          },
          "amount": {
            "minimum": 0,
            "type": "number",
            "description": "Amount of the transaction.\n\nIf not set, the transaction amount will have the invoice rest amount to fully pay the invoice.",
            "example": 1456.23
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "description": "The date of the actual transaction. If not set, INFast use the current date.",
            "example": "2025-12-30T10:00:00.000Z"
          },
          "emitter": {
            "type": "string",
            "description": "Emitter name\n\nAdditionnal information on transaction. Often use with check transaction method",
            "example": "Customer Name"
          },
          "bank": {
            "type": "string",
            "description": "Bank name\n\nAdditionnal information on transaction. Often use with check transaction method",
            "example": "Crédit Agricole"
          },
          "number": {
            "type": "string",
            "description": "Additionnal information on transaction. Often use with check or transfert transaction method",
            "example": "123456789"
          },
          "info": {
            "type": "string",
            "description": "Additionnal information on transaction.\n\nDisplayed on invoice for transaction method type \"OTHER\"\n\nExemple, we can set \"Paypal\" as information",
            "example": "PayPal"
          }
        },
        "description": "Model to pay an invoice.\n\nDefault transaction method is \"CREDITCARD\".\n"
      },
      "email-model-type": {
        "title": "Email model type (Enum)",
        "type": "string",
        "description": "When you send email you can use a template.\n\nThis enum defines which email template is used.\n\n- USER\n\t- Template used by default and first email sent to a customer.\n- PRERELAUNCH\n\t- 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.\n- RELAUNCH1\n\t- Template used when the document is overdue to remind the customer to pay.\n- RELAUNCH2\n\t- Template used when the document is overdue and a first relaunch email has already been sent.",
        "enum": [
          "USER",
          "PRERELAUNCH",
          "RELAUNCH1",
          "RELAUNCH2"
        ]
      },
      "message-input": {
        "title": "Message Input (Model)",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "from": {
            "type": "string",
            "description": "Use user email by default.\n\nYou 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"
          },
          "to": {
            "type": "string",
            "description": "If set send email to these email list and ignore customer email.\n\nTo set multiple emails, separate emails by semicolons",
            "example": "customer@domain.com"
          },
          "cc": {
            "type": "string",
            "description": "To set multiple emails, separate emails by semicolons",
            "example": "copy1@domain.com;copy2@domain.com"
          },
          "model": {
            "$ref": "#/components/schemas/email-model-type"
          },
          "subject": {
            "type": "string",
            "description": "If not set, use subject configured in model\n",
            "example": "[INTIA] Votre facture F-000123"
          },
          "message": {
            "type": "string",
            "description": "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"
          }
        },
        "description": "Template used to send document by email"
      },
      "portal-patch": {
        "title": "Portal Patch (Model)",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enterprise": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "maxLength": 1024,
                "type": "string",
                "description": "Company name",
                "example": "INTIA"
              },
              "phone": {
                "$ref": "#/components/schemas/phone-landline"
              },
              "fax": {
                "$ref": "#/components/schemas/phone-fax"
              },
              "email": {
                "maxLength": 1024,
                "type": "string",
                "description": "Company email.\nDisplayed on document PDF\nUse to send email",
                "example": "contact@intia.fr"
              },
              "website": {
                "maxLength": 1024,
                "type": "string",
                "description": "Company website.\nDisplayed on document PDF.",
                "example": "https://intia.fr"
              },
              "address": {
                "$ref": "#/components/schemas/address"
              },
              "vatId": {
                "$ref": "#/components/schemas/vat-id"
              },
              "vatUse": {
                "$ref": "#/components/schemas/vat-use"
              },
              "siren": {
                "maxLength": 48,
                "type": "string",
                "description": "SIREN",
                "example": "814 919 106"
              },
              "siret": {
                "$ref": "#/components/schemas/siret"
              },
              "naf": {
                "maxLength": 24,
                "type": "string",
                "description": "NAF/APE Code",
                "example": "6201Z"
              },
              "rcs": {
                "maxLength": 512,
                "type": "string",
                "description": "City where the company has been registered.\nRegistre du commerce et des sociétés",
                "example": "Brest"
              },
              "legalForm": {
                "maxLength": 512,
                "type": "string",
                "description": "Legal form of the [portal](../api-docs/definitions/portal.md)",
                "example": "Société par actions simplifiée"
              },
              "legalNotice": {
                "maxLength": 1024,
                "type": "string",
                "description": "Information to display on document footer",
                "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€.\nAucun escompte ne sera accordé en cas de paiement anticipé."
              },
              "capital": {
                "minimum": 0,
                "type": "number",
                "description": "Capital of the company",
                "example": 65680
              },
              "hasNoSiret": {
                "type": "boolean",
                "description": "Company which are not register can create invoice, but they should mention that the registration is in progress",
                "example": false
              },
              "noSiretMsg": {
                "maxLength": 1024,
                "type": "string",
                "description": "If company has no siret, a mention should be displayed on invoice",
                "example": "Siret en cours d'attribution"
              },
              "rna": {
                "maxLength": 48,
                "type": "string",
                "description": "Association registration number.\nOnly for association.",
                "example": "W123456789"
              },
              "rib": {
                "maxLength": 48,
                "type": "string",
                "description": "RIB, bank information displayed on invoice",
                "example": "12345 12345 12345678901 12"
              },
              "iban": {
                "maxLength": 48,
                "type": "string",
                "description": "IBAN, bank information displayed on invoice",
                "example": "FR12 1234 1234 1234 1234 1234 123"
              },
              "bic": {
                "maxLength": 48,
                "type": "string",
                "description": "BIC, bank information displayed on invoice",
                "example": "CMBRFR2BXXX"
              },
              "bank": {
                "maxLength": 512,
                "type": "string",
                "description": "Name of the bank displayed on invoice",
                "example": "Crédit Mutuel de Bretagne"
              },
              "noLogo": {
                "type": "boolean",
                "description": "true if you don't want display logo and initial letter.",
                "example": false
              }
            },
            "description": "Enterprise details"
          },
          "modelEmail": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "user": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "subject": {
                    "maxLength": 512,
                    "type": "string",
                    "description": "Email subject",
                    "example": "[{company.name}] Votre {document.type} {document.reference}"
                  },
                  "message": {
                    "maxLength": 8196,
                    "type": "string",
                    "description": "Email message",
                    "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}"
                  }
                },
                "description": "Model use by default. During first email send to a customer."
              },
              "preRelaunch": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "subject": {
                    "maxLength": 512,
                    "type": "string",
                    "description": "Email subject",
                    "example": "[{company.name}] Votre {document.type} {document.reference}"
                  },
                  "message": {
                    "maxLength": 8196,
                    "type": "string",
                    "description": "Email message",
                    "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}"
                  }
                },
                "description": "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."
              },
              "relaunch1": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "subject": {
                    "maxLength": 512,
                    "type": "string",
                    "description": "Email subject",
                    "example": "[{company.name}] Votre {document.type} {document.reference}"
                  },
                  "message": {
                    "maxLength": 8196,
                    "type": "string",
                    "description": "Email message",
                    "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}"
                  }
                },
                "description": "Model use when the document is late to encourage customer to pay."
              },
              "relaunch2": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "subject": {
                    "maxLength": 512,
                    "type": "string",
                    "description": "Email subject",
                    "example": "[{company.name}] Votre {document.type} {document.reference}"
                  },
                  "message": {
                    "maxLength": 8196,
                    "type": "string",
                    "description": "Email message",
                    "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}"
                  }
                },
                "description": "Model use when the document is late and a first relaunch email was been sent."
              }
            },
            "description": "Default email model use during send emails"
          },
          "timezone": {
            "maxLength": 48,
            "type": "string",
            "description": "Timezone of the [portal](../api-docs/definitions/portal.md).\n here the list of all possibbles value : https://en.wikipedia.org/wiki/List_of_tz_database_time_zones",
            "example": "Europe/Paris",
            "default": "Europe/Paris"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          }
        },
        "description": ""
      },
      "object-id": {
        "maxLength": 24,
        "minLength": 24,
        "type": "string",
        "description": "Unique identifier of this resource",
        "example": "63e3c82675de4f6978054579"
      },
      "vat-id": {
        "maxLength": 24,
        "type": "string",
        "description": "European intra-Community VAT identifier",
        "example": "FR79 814919106"
      },
      "vat-use": {
        "type": "boolean",
        "description": "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.",
        "example": true,
        "default": true
      },
      "siret": {
        "type": "string",
        "description": "French Company identification number (also called \"SIRET\" in french).",
        "example": "814 919 106 00025",
        "maxLength": 24
      },
      "outside-eu": {
        "type": "boolean",
        "description": "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).",
        "example": false,
        "default": false,
        "deprecated": true
      },
      "reverse-charge": {
        "type": "boolean",
        "description": "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.",
        "example": false,
        "default": false
      },
      "account-number": {
        "maxLength": 24,
        "type": "string",
        "description": "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.",
        "example": "411COGIP"
      },
      "customer-name": {
        "maxLength": 512,
        "type": "string",
        "description": "Full name",
        "example": "Hervé Berthier"
      },
      "customer-type": {
        "type": "string",
        "description": "Type of the customer",
        "example": "consumer",
        "enum": [
          "consumer",
          "business"
        ]
      },
      "customer-email": {
        "maxLength": 512,
        "type": "string",
        "description": "email adress of the customer",
        "example": "customer@domain.com"
      },
      "phone-mobile": {
        "maxLength": 24,
        "type": "string",
        "description": "Mobile number",
        "example": "06 01 02 03 04"
      },
      "phone-landline": {
        "maxLength": 24,
        "type": "string",
        "description": "Landline phone number",
        "example": "02 98 01 02 03"
      },
      "phone-fax": {
        "maxLength": 24,
        "type": "string",
        "description": "Fax number",
        "example": "02 98 01 02 04"
      },
      "document-emit-date": {
        "type": "string",
        "format": "date-time",
        "description": "The official issuance date of the Document. Note, this date may differ from the actual creation date of the Document."
      },
      "document-version": {
        "minimum": 1,
        "type": "number",
        "example": 1.2,
        "description": "Version of the document. [More information on document versionning here](../api-docs/definitions/document#versionning)"
      },
      "document-due-date": {
        "type": "string",
        "description": "Due date, after this date, the Document is considered late",
        "format": "date-time"
      },
      "customer-reference": {
        "maxLength": 24,
        "type": "string",
        "description": "Reference of the customer. _Automatically generated if empty during creation._",
        "example": "C-000123"
      },
      "customer-use-delivery": {
        "type": "boolean",
        "description": "If this field is true, the customer's delivery address is displayed on their documents.",
        "example": false,
        "default": false
      },
      "customer-send-to-delivery": {
        "type": "boolean",
        "description": "If this field is true, the customer's delivery address is displayed above regular address on their documents.",
        "example": false,
        "default": false
      },
      "portal-id": {
        "maxLength": 24,
        "minLength": 24,
        "type": "string",
        "description": "Unique identifier of the portal ownwing this resource",
        "example": "63e3c82675de4f6978054555"
      },
      "last-update": {
        "type": "string",
        "format": "date-time",
        "description": "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.",
        "example": "2017-07-21T17:32:28Z"
      },
      "tag-ids": {
        "type": "array",
        "description": "List of tags IDs of this entity.",
        "items": {
          "maxLength": 24,
          "minLength": 24,
          "type": "string"
        },
        "example": [
          "66608ad48f4331f19f40f4ee",
          "66608ad25e527d4290ee30ef"
        ]
      },
      "metadata": {
        "title": "metadata",
        "maxLength": 512,
        "type": "string",
        "description": "This field is intended for adding metadata to entities you are creating or updating.\n\nYou'll find more informations on [our documentation about this field](../api-docs/definitions/metadata.md).\n\nWhatever 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",
        "example": "INTERNAL_DB_ID=12166Q1S2"
      },
      "data-portal-output": {
        "title": "Portal Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/portal-output"
          }
        }
      },
      "portal-output": {
        "title": "Portal Output",
        "required": [
          "id",
          "creationDate",
          "customerTags",
          "endPortalDate",
          "enterprise",
          "lastConnectionDate",
          "modelEmail",
          "moves",
          "pack",
          "itemTags",
          "recurrence",
          "totalTurnover"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/object-id"
          },
          "enterprise": {
            "required": [
              "hasNoSiret",
              "legalForm",
              "legalNotice",
              "name",
              "noSiretMsg",
              "vatUse"
            ],
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "maxLength": 1024,
                "type": "string",
                "description": "Company name",
                "example": "INTIA"
              },
              "phone": {
                "$ref": "#/components/schemas/phone-landline"
              },
              "fax": {
                "$ref": "#/components/schemas/phone-fax"
              },
              "email": {
                "maxLength": 1024,
                "type": "string",
                "description": "Company email.\nDisplayed on document PDF\nUse to send email",
                "example": "contact@intia.fr"
              },
              "website": {
                "maxLength": 1024,
                "type": "string",
                "description": "Company website.\nDisplayed on document PDF.",
                "example": "https://intia.fr"
              },
              "address": {
                "$ref": "#/components/schemas/address"
              },
              "vatId": {
                "$ref": "#/components/schemas/vat-id"
              },
              "vatUse": {
                "$ref": "#/components/schemas/vat-use"
              },
              "siren": {
                "maxLength": 48,
                "type": "string",
                "description": "SIREN",
                "example": "814 919 106"
              },
              "siret": {
                "$ref": "#/components/schemas/siret"
              },
              "naf": {
                "maxLength": 24,
                "type": "string",
                "description": "NAF/APE Code",
                "example": "6201Z"
              },
              "rcs": {
                "maxLength": 512,
                "type": "string",
                "description": "City where the company has been registered.\nRegistre du commerce et des sociétés",
                "example": "Brest"
              },
              "legalForm": {
                "maxLength": 512,
                "type": "string",
                "description": "Legal form of the [portal](../api-docs/definitions/portal.md)",
                "example": "Société par actions simplifiée"
              },
              "legalNotice": {
                "maxLength": 1024,
                "type": "string",
                "description": "Information to display on document footer",
                "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€.\nAucun escompte ne sera accordé en cas de paiement anticipé."
              },
              "capital": {
                "minimum": 0,
                "type": "number",
                "description": "Capital of the company",
                "example": 65680
              },
              "hasNoSiret": {
                "type": "boolean",
                "description": "Company which are not register can create invoice, but they should mention that the registration is in progress",
                "example": false
              },
              "noSiretMsg": {
                "maxLength": 1024,
                "type": "string",
                "description": "If company has no siret, a mention should be displayed on invoice",
                "example": "Siret en cours d'attribution"
              },
              "rna": {
                "maxLength": 48,
                "type": "string",
                "description": "Association registration number.\nOnly for association.",
                "example": "W123456789"
              },
              "rib": {
                "maxLength": 48,
                "type": "string",
                "description": "RIB, bank information displayed on invoice",
                "example": "12345 12345 12345678901 12"
              },
              "iban": {
                "maxLength": 48,
                "type": "string",
                "description": "IBAN, bank information displayed on invoice",
                "example": "FR12 1234 1234 1234 1234 1234 123"
              },
              "bic": {
                "maxLength": 48,
                "type": "string",
                "description": "BIC, bank information displayed on invoice",
                "example": "CMBRFR2BXXX"
              },
              "bank": {
                "maxLength": 512,
                "type": "string",
                "description": "Name of the bank displayed on invoice",
                "example": "Crédit Mutuel de Bretagne"
              },
              "noLogo": {
                "type": "boolean",
                "description": "true if you don't want display logo and initial letter.",
                "example": false
              }
            },
            "description": "Enterprise details"
          },
          "modelEmail": {
            "required": [
              "preRelaunch",
              "relaunch1",
              "relaunch2",
              "user"
            ],
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "user": {
                "required": [
                  "message",
                  "subject"
                ],
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "subject": {
                    "maxLength": 512,
                    "type": "string",
                    "description": "Email subject",
                    "example": "[{company.name}] Votre {document.type} {document.reference}"
                  },
                  "message": {
                    "maxLength": 8196,
                    "type": "string",
                    "description": "Email message",
                    "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}"
                  }
                },
                "description": "Model use by default. During first email send to a customer."
              },
              "preRelaunch": {
                "required": [
                  "message",
                  "subject"
                ],
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "subject": {
                    "maxLength": 512,
                    "type": "string",
                    "description": "Email subject",
                    "example": "[{company.name}] Votre {document.type} {document.reference}"
                  },
                  "message": {
                    "maxLength": 8196,
                    "type": "string",
                    "description": "Email message",
                    "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}"
                  }
                },
                "description": "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."
              },
              "relaunch1": {
                "required": [
                  "message",
                  "subject"
                ],
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "subject": {
                    "maxLength": 512,
                    "type": "string",
                    "description": "Email subject",
                    "example": "[{company.name}] Votre {document.type} {document.reference}"
                  },
                  "message": {
                    "maxLength": 8196,
                    "type": "string",
                    "description": "Email message",
                    "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}"
                  }
                },
                "description": "Model use when the document is late to encourage customer to pay."
              },
              "relaunch2": {
                "required": [
                  "message",
                  "subject"
                ],
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "subject": {
                    "maxLength": 512,
                    "type": "string",
                    "description": "Email subject",
                    "example": "[{company.name}] Votre {document.type} {document.reference}"
                  },
                  "message": {
                    "maxLength": 8196,
                    "type": "string",
                    "description": "Email message",
                    "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}"
                  }
                },
                "description": "Model use when the document is late and a first relaunch email was been sent."
              }
            },
            "description": "Default email model use during send emails."
          },
          "timezone": {
            "maxLength": 48,
            "type": "string",
            "description": "Timezone of the [portal](../api-docs/definitions/portal.md).\n here the list of all possibbles value : https://en.wikipedia.org/wiki/List_of_tz_database_time_zones",
            "example": "Europe/Paris",
            "default": "Europe/Paris"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          },
          "creationDate": {
            "type": "string",
            "description": "portal creation date",
            "format": "date-time"
          },
          "endPortalDate": {
            "type": "string",
            "description": "Expiration date, after this date, INFast account will be not accessible",
            "format": "date-time"
          },
          "lastConnectionDate": {
            "type": "string",
            "description": "Last connection date on this [portal](../api-docs/definitions/portal.md)",
            "format": "date-time"
          },
          "pack": {
            "$ref": "#/components/schemas/subscription-pack"
          },
          "recurrence": {
            "$ref": "#/components/schemas/subscription-recurrence"
          },
          "moves": {
            "required": [
              "turnover"
            ],
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "historicalTurnover": {
                "type": "array",
                "description": "List of dates and turnovers realized before start use INFast. Allow to display a turnover graph with previous data.\nEach array item defined a month and an amount without tax",
                "items": {
                  "required": [
                    "amount",
                    "date"
                  ],
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "date": {
                      "type": "string",
                      "description": "Date to define a turnover.\nThe first day of the month",
                      "format": "date-time"
                    },
                    "amount": {
                      "type": "number",
                      "description": "Turnover amount realized this month.",
                      "example": 12457.45
                    }
                  }
                }
              },
              "turnover": {
                "type": "array",
                "description": "List of dates and turnovers realized since use INFast. Allow to display a turnover graph.\nEach array item defined a month and an amount without tax",
                "items": {
                  "required": [
                    "amount",
                    "date"
                  ],
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "date": {
                      "type": "string",
                      "description": "Date to define a turnover.\nThe first day of the month",
                      "format": "date-time"
                    },
                    "amount": {
                      "type": "number",
                      "description": "Turnover amount realized this month.",
                      "example": 9874.36
                    }
                  }
                }
              }
            },
            "description": "List of dates and turnovers"
          },
          "totalTurnover": {
            "type": "number",
            "description": "Sales turnover created with INFast",
            "example": 254120.29
          }
        },
        "description": ""
      },
      "webhook-event": {
        "title": "Webhook Event (Enum)",
        "type": "string",
        "description": "All events which can be listened",
        "example": "invoice.paid",
        "enum": [
          "document.created",
          "document.updated",
          "document.deleted",
          "customer.created",
          "customer.deleted",
          "customer.updated",
          "item.created",
          "item.updated",
          "item.deleted",
          "invoice.paid",
          "invoice.usage-added",
          "invoice.validated",
          "quotation.validated",
          "quotation.accepted",
          "quotation.refused",
          "test"
        ]
      },
      "webhook-input": {
        "title": "Webhook Input (Model)",
        "required": [
          "endpoint",
          "events"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "endpoint": {
            "type": "string",
            "description": "Url called on event",
            "example": "https://domain.com/webhook"
          },
          "events": {
            "type": "array",
            "description": "List of event listenned",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/webhook-event"
            }
          },
          "description": {
            "type": "string",
            "description": "Description of the webhook",
            "example": "Webhook fired when an invoice is paid to 3td party"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          }
        },
        "description": "Webhook allow your service to receive request when an action is done on your INFast account.\n\nYou can listen event as \"new customer created\", \"item updated\", ...\nYou can create as many webhook you want"
      },
      "data-webhook-output": {
        "title": "Webhook Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/webhook-output"
          }
        }
      },
      "data-array-webhook-output": {
        "title": "Webhook Array Output Data",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/webhook-output"
            }
          }
        }
      },
      "webhook-output": {
        "title": "Webhook Output (Model)",
        "required": [
          "id",
          "endpoint",
          "events"
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/object-id"
          },
          "endpoint": {
            "type": "string",
            "description": "Url called on event",
            "example": "https://domain.com/webhook"
          },
          "events": {
            "type": "array",
            "description": "List of event listenned",
            "items": {
              "$ref": "#/components/schemas/webhook-event"
            }
          },
          "description": {
            "type": "string",
            "description": "Description of the webhook",
            "example": "Webhook fired when an invoice is paid to 3td party"
          },
          "metadata": {
            "$ref": "#/components/schemas/metadata"
          }
        },
        "description": "The webhook object"
      },
      "address": {
        "title": "Postal address",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "street": {
            "maxLength": 1024,
            "type": "string",
            "description": "Street address (Number, street, extension). _Can be multiline_",
            "example": "149 rue Pierre Sémard\nAppartement 2"
          },
          "postalCode": {
            "maxLength": 12,
            "type": "string",
            "description": "Zip code",
            "example": "29200"
          },
          "city": {
            "maxLength": 512,
            "type": "string",
            "description": "City",
            "example": "Brest"
          },
          "country": {
            "maxLength": 512,
            "type": "string",
            "description": "Country of the address",
            "example": "FRANCE"
          }
        },
        "description": "This model is used throughout all API endpoints to represent a postal address."
      },
      "deliveryContact": {
        "title": "Delivery Contact (Inner Model)",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "address": {
            "$ref": "#/components/schemas/address"
          },
          "name": {
            "maxLength": 1024,
            "type": "string",
            "description": "Name of the delivery contact",
            "example": "Contact name"
          },
          "phone": {
            "maxLength": 24,
            "type": "string",
            "description": "Phone number of the delivery contact",
            "example": "06 01 02 03 04"
          },
          "toAttention": {
            "maxLength": 1024,
            "type": "string",
            "description": "Additionnal \"to attention\" for the delivery address",
            "example": "Alexandre LEGLISE"
          }
        },
        "description": "Information on delivery contact.\n\nDocuments can have a delivery contact that is different from the customer."
      },
      "percent-or-amount": {
        "title": "Percent or Cash (Enum)",
        "type": "string",
        "description": "Defines if the amount is defined in cash or as a percentage.",
        "example": "PERCENT",
        "enum": [
          "PERCENT",
          "CASH"
        ]
      },
      "email-attachment-source": {
        "title": "Attachment Source (Enum)",
        "type": "string",
        "description": "When sending a document by email you can add attachments.\n\nAttachments can be added from multiple sources:\n- CGV\n\t - From [portal](../api-docs/definitions/portal.md) CGV\n- [portal](../api-docs/definitions/portal.md)\n- CUSTOMER\n- ITEM\n- DOCUMENT\n- CUSTOM\n\t - From local file",
        "example": "ITEM",
        "enum": [
          "CGV",
          "PORTAL",
          "CUSTOMER",
          "ITEM",
          "DOCUMENT",
          "CUSTOM",
          "USER",
          "PROJECT"
        ]
      },
      "webhook-invoice-usage-added-payload": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "document",
          "usage"
        ],
        "properties": {
          "document": {
            "$ref": "#/components/schemas/document-output"
          },
          "usage": {
            "$ref": "#/components/schemas/transaction-usage-output"
          }
        }
      },
      "transaction-usage-type": {
        "title": "Transaction Usage Types (Enum)",
        "type": "string",
        "description": "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`).",
        "enum": [
          "TRANSACTION",
          "CREDIT_NOTE"
        ]
      }
    },
    "responses": {
      "error": {
        "description": "Error occured. Refere to HTTP status and content for details.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "description": "A description of the error",
                  "example": "Customer not found"
                },
                "code": {
                  "description": "The HTTP code of this error (will also be sent in headers)",
                  "type": "integer",
                  "example": 404
                },
                "details": {
                  "type": "object",
                  "description": "Additional details about the error",
                  "example": {
                    "path": "/body/isService",
                    "message": "must NOT have additional properties",
                    "errorCode": "additionalProperties.openapi.validation"
                  }
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "transaction-list-startDate": {
        "name": "startDate",
        "in": "query",
        "description": "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.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "transaction-list-endDate": {
        "name": "endDate",
        "in": "query",
        "description": "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.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "transaction-usage-list-orderBy": {
        "name": "orderBy",
        "in": "query",
        "description": "Sorts transaction usages by a specific field name. The sort order is defined in `order`. Possible values are:\n- **date** (default): sorts the results by the transaction usage  date.\n- **amount**: sorts the results by the transaction amount.",
        "allowEmptyValue": true,
        "schema": {
          "type": "string",
          "default": "date",
          "enum": [
            "lastUpdate",
            "date",
            "amount"
          ]
        }
      },
      "transaction-list-minimumAmount": {
        "name": "minimumAmount",
        "in": "query",
        "description": "Filters entities where the amount is less than the value of the field.",
        "schema": {
          "type": "number"
        }
      },
      "transaction-list-maximumAmount": {
        "name": "maximumAmount",
        "in": "query",
        "description": "Filters entities where the amount is more than the value of the field.",
        "schema": {
          "type": "number"
        }
      },
      "path-id": {
        "name": "id",
        "description": "ID of the requested resource",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "sortOrder": {
        "name": "sortOrder",
        "in": "query",
        "description": "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).\n\n`sortOrder` can have 2 values:\n- `1` which indicates sorting in natural order (ascending, _a.k.a_ `ASC`)\n- `-1` which indicates sorting in reverse order (descending, _a.k.a_ `DESC`)",
        "schema": {
          "type": "number",
          "default": 1,
          "enum": [
            -1,
            1
          ],
          "example": 1
        }
      },
      "limit": {
        "name": "limit",
        "in": "query",
        "description": "Limit the number of results returned by the request. ",
        "schema": {
          "maximum": 100,
          "minimum": 0,
          "type": "number",
          "default": 50
        }
      },
      "updatedSince": {
        "name": "updatedSince",
        "in": "query",
        "description": "Filters results that have not been updated since the given date (_based on `lastUpdate` field of the entity_).\n\nThe date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "updatedUntil": {
        "name": "updatedUntil",
        "in": "query",
        "description": "Filters results that have not been updated until the given date (_based on `lastUpdate` field of the entity_).\n\nThe date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ).",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "document-status": {
        "name": "status",
        "in": "query",
        "description": "Status of document:\n* VALIDATED\n\t* Assigned when a draft document is validated\n\t* Removes the DRAFT watermark from the PDF's\n* CONVERTED\n\t* Quotation which has been converted to an invoice\n* CANCELLED\n\t* Assigned when a document has been replaced by a newer version\n\t* Or for quotation which has been cancelled by a user\n* PAID\n\t* An invoice which has paid in full\n* DRAFT\n\t* Initial status of a document\n\t* A DRAFT watermark is displayed on the PDF\n* ACCEPTED\n\t* Quotation accepted by customer\n* REFUSED\n  * Quotation refused by customer",
        "schema": {
          "type": "string",
          "enum": [
            "VALIDATED",
            "CONVERTED",
            "CANCELLED",
            "PAID",
            "DRAFT",
            "ACCEPTED",
            "REFUSED",
            "CLOSED"
          ]
        }
      },
      "skip": {
        "name": "skip",
        "in": "query",
        "description": "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.",
        "schema": {
          "minimum": 0,
          "type": "number",
          "default": 0
        }
      },
      "document-type": {
        "name": "type",
        "in": "query",
        "description": "Filters by type of document. [More information on the different types here](../api-docs/definitions/document#types)",
        "schema": {
          "type": "string",
          "enum": [
            "QUOTATION",
            "PURCHASE_ORDER",
            "INVOICE",
            "OTHER"
          ]
        }
      },
      "document-subtype": {
        "name": "subtype",
        "in": "query",
        "description": "Filters by subtype of document. [More information on the different subtypes here](../api-docs/definitions/document#subtypes)",
        "schema": {
          "type": "string",
          "enum": [
            "QUOTATION",
            "PURCHASE_ORDER",
            "INVOICE",
            "DEPOSIT",
            "CREDIT_NOTE",
            "PROFORMA",
            "SITUATION",
            "ORDER_FORM"
          ]
        }
      }
    },
    "securitySchemes": {
      "basicAuthOauth": {
        "description": "This security is used to authenticate on OAuth get token. Authorization header is a HTTP basic with a base 64 string of `client_id:client_secret`. You'll find more information on [Authentication section of documentation](../api-docs/definitions/authentication.md).",
        "type": "http",
        "scheme": "basic"
      },
      "oauth": {
        "type": "oauth2",
        "description": "The API is secured via OAuth2. You'll need to provide a `client_id` and a `client_secret` to access user's data. You'll find more information on [Authentication section of documentation](../api-docs/definitions/authentication.md).",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://api.infast.fr/api/v2/oauth2/token",
            "scopes": {
              "read": "Read only access to the API",
              "write": "Read and write access to the API"
            }
          }
        }
      }
    }
  },
  "x-webhooks": {
    "customer-deleted": {
      "post": {
        "summary": "Customer deleted",
        "description": "This event is triggered when an existing [Customer](../api-docs/definitions/customer.mdx) is deleted.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "webhook-customer-deleted",
        "tags": [
          "Webhooks",
          "Customers"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "customer.deleted"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "customerId"
                        ],
                        "properties": {
                          "customerId": {
                            "$ref": "#/components/schemas/object-id"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully"
          }
        }
      }
    },
    "customer-created": {
      "post": {
        "summary": "Customer created",
        "operationId": "webhook-customer-created",
        "description": "This event is triggered when a new [Customer](../api-docs/definitions/customer.mdx) is created.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "tags": [
          "Webhooks",
          "Customers"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "customer.created"
                      },
                      "data": {
                        "$ref": "#/components/schemas/customer-output"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully"
          }
        }
      }
    },
    "customer-updated": {
      "post": {
        "summary": "Customer updated",
        "description": "This event is triggered when an existing [Customer](../api-docs/definitions/customer.mdx) is modified. This event is also triggered when a customer is deleted. The `deleted` field will be set to `true`.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "webhook-customer-updated",
        "tags": [
          "Webhooks",
          "Customers"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "customer.updated"
                      },
                      "data": {
                        "$ref": "#/components/schemas/customer-output"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully"
          }
        }
      }
    },
    "document-created": {
      "post": {
        "summary": "Document created",
        "description": "This event is triggered when a new [Document](../api-docs/definitions/document.md) is created.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "webhook-document-created",
        "tags": [
          "Webhooks",
          "Documents"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "document.created"
                      },
                      "data": {
                        "$ref": "#/components/schemas/customer-output"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully           "
          }
        }
      }
    },
    "document-updated": {
      "post": {
        "summary": "Document updated",
        "description": "This event is triggered when an existing [Document](../api-docs/definitions/document.md) is modified.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "webhook-document-updated",
        "tags": [
          "Webhooks",
          "Documents"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "document.updated"
                      },
                      "data": {
                        "$ref": "#/components/schemas/document-output"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully                       "
          }
        }
      }
    },
    "document-deleted": {
      "post": {
        "summary": "Document deleted",
        "description": "This event is triggered when an existing [Document](../api-docs/definitions/document.md) is deleted. More information on document deletion [can be found here](../api-docs/definitions/document#delete).\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "webhook-document-deleted",
        "tags": [
          "Webhooks",
          "Documents"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "document.deleted"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "documentId"
                        ],
                        "properties": {
                          "documentId": {
                            "$ref": "#/components/schemas/object-id"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully    "
          }
        }
      }
    },
    "invoice-paid": {
      "post": {
        "summary": "Invoice paid",
        "description": "This event is triggered when an invoice (i.e., a Document with `type = INVOICE`) is marked as fully paid. Its [[status](../api-docs/definitions/document#status) changes to `PAID`. More information on transactions [can be found here](../api-docs/definitions/transaction.mdx).\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "webhook-invoice-paid",
        "tags": [
          "Webhooks",
          "Documents"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "invoice.paid"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "document",
                          "transactionUsages"
                        ],
                        "properties": {
                          "document": {
                            "$ref": "#/components/schemas/document-output"
                          },
                          "transactionUsages": {
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/transaction-usage-output"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully                                        "
          }
        }
      }
    },
    "invoice-usage-added": {
      "post": {
        "summary": "Invoice usage added",
        "description": "This event is triggered when an invoice (i.e., a Document with `type = INVOICE`) has a new [TransactionUsage](../api-docs/definitions/transaction-usage.mdx) added. Specifically, it is a payment from the client (or a credit) used to settle part (or all) of the invoice.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks.mdx)",
        "operationId": "webhook-invoice-usage-added",
        "tags": [
          "Webhooks",
          "Documents",
          "Transactions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "invoice.usage-added"
                      },
                      "data": {
                        "$ref": "#/components/schemas/webhook-invoice-usage-added-payload"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully                                        "
          }
        }
      }
    },
    "invoice-validated": {
      "post": {
        "summary": "Invoice validated",
        "description": "This event is triggered when an invoice (i.e., a [Document](../api-docs/definitions/document.md) with `type = INVOICE`) is finalized. Its [status](../api-docs/definitions/document#status) changes from `DRAFT` to `VALIDATED`.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "webhook-invoice-validated",
        "tags": [
          "Webhooks",
          "Documents"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "invoice.validated"
                      },
                      "data": {
                        "$ref": "#/components/schemas/document-output"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully                                                    "
          }
        }
      }
    },
    "quotation-refused": {
      "post": {
        "summary": "Quotation refused",
        "description": "This event is triggered when a quotation (i.e., a [Document](../api-docs/definitions/document.md) with `type = QUOTATION`) is marked as refused by the client.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "webhook-quotation-refused",
        "tags": [
          "Webhooks",
          "Documents"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "quotation.refused"
                      },
                      "data": {
                        "$ref": "#/components/schemas/document-output"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully                                                                "
          }
        }
      }
    },
    "quotation-accepted": {
      "post": {
        "summary": "Quotation accepted",
        "description": "This event is triggered when a quotation (i.e., a [Document](../api-docs/definitions/document.md) with `type = QUOTATION`) is marked as accepted by the client.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "webhook-quotation-accepted",
        "tags": [
          "Webhooks",
          "Documents"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "quotation.accepted"
                      },
                      "data": {
                        "$ref": "#/components/schemas/document-output"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully      "
          }
        }
      }
    },
    "quotation-validated": {
      "post": {
        "summary": "Quotation validated",
        "description": "This event is triggered when a quotation (i.e., a [Document](../api-docs/definitions/document.md) with `type = QUOTATION`) is finalized. Its [status](../api-docs/definitions/document#status) changes from `DRAFT` to `VALIDATED`.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "operationId": "webhook-quotation-validated",
        "tags": [
          "Webhooks",
          "Documents"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "quotation.validated"
                      },
                      "data": {
                        "$ref": "#/components/schemas/document-output"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully                       "
          }
        }
      }
    },
    "item-updated": {
      "post": {
        "summary": "Item updated",
        "operationId": "webhook-item-updated",
        "description": "This event is triggered when an existing [Item](../api-docs/definitions/item.md) is modified.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "tags": [
          "Webhooks",
          "Items"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "item.updated"
                      },
                      "data": {
                        "$ref": "#/components/schemas/item-output"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully"
          }
        }
      }
    },
    "item-deleted": {
      "post": {
        "summary": "Item deleted",
        "operationId": "webhook-item-deleted",
        "tags": [
          "Webhooks",
          "Items"
        ],
        "description": "This event is triggered when an existing [Item](../api-docs/definitions/item.md) is deleted.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "item.deleted"
                      },
                      "data": {
                        "type": "object",
                        "required": [
                          "itemId"
                        ],
                        "properties": {
                          "itemId": {
                            "$ref": "#/components/schemas/object-id"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully"
          }
        }
      }
    },
    "item-created": {
      "post": {
        "summary": "Item created",
        "operationId": "webhook-item-created",
        "description": "This event is triggered when a new [Item](../api-docs/definitions/item.md) is created.\n\n[More information on INFast webhooks](../api-docs/guides/webhooks)",
        "tags": [
          "Webhooks",
          "Items"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "portalId",
                  "event"
                ],
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/object-id",
                    "description": "Unique identifier of the webhook"
                  },
                  "portalId": {
                    "$ref": "#/components/schemas/portal-id"
                  },
                  "event": {
                    "type": "object",
                    "required": [
                      "eventId",
                      "data"
                    ],
                    "properties": {
                      "eventId": {
                        "type": "string",
                        "description": "Webhook event name/identifier",
                        "example": "item.created"
                      },
                      "data": {
                        "$ref": "#/components/schemas/item-output"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 200 status to indicate that the data was received successfully"
          }
        }
      }
    }
  }
}