{
  "openapi": "3.1.1",
  "info": {
    "title": "Api | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.van-colen.com/"
    }
  ],
  "paths": {
    "/Auth/login": {
      "post": {
        "tags": [
          "Auth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            }
          }
        }
      }
    },
    "/Customers": {
      "get": {
        "tags": [
          "Customers"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "klantNr",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "actief",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "postcode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "gemeente",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "landId",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCustomerModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCustomerModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfCustomerModel"
                }
              }
            }
          }
        }
      }
    },
    "/Orders/{id}": {
      "get": {
        "tags": [
          "Orders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderModel"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Orders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Orders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Orders": {
      "post": {
        "tags": [
          "Orders"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateOrderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateOrderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateOrderResponse"
                }
              }
            }
          }
        }
      }
    },
    "/Products": {
      "get": {
        "tags": [
          "Products"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artikelGroepId",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "artikelVariantId",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "verdelerId",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultOfProductModel"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AddressModel": {
        "type": "object",
        "properties": {
          "street": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "country": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateOrderRequest": {
        "required": [
          "deliveryDate",
          "lines"
        ],
        "type": "object",
        "properties": {
          "vestigingId": {
            "maximum": 2147483647,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "comment": {
            "maxLength": 2000,
            "type": [
              "null",
              "string"
            ]
          },
          "deliveryDate": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineModel"
            }
          }
        }
      },
      "CreateOrderResponse": {
        "type": "object",
        "properties": {
          "orderId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CustomerLocationModel": {
        "type": "object",
        "properties": {
          "vestigingId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "address": {
            "$ref": "#/components/schemas/AddressModel"
          },
          "defaultOrderProducts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DefaultOrderProductModel"
            }
          },
          "orderDays": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        }
      },
      "CustomerModel": {
        "type": "object",
        "properties": {
          "klantId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "naam": {
            "type": [
              "null",
              "string"
            ]
          },
          "vatNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "languageCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "billingAddress": {
            "$ref": "#/components/schemas/AddressModel"
          },
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerLocationModel"
            }
          }
        }
      },
      "DefaultOrderProductModel": {
        "type": "object",
        "properties": {
          "artikelId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "LoginRequest": {
        "required": [
          "password",
          "email"
        ],
        "type": "object",
        "properties": {
          "password": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        }
      },
      "LoginResponse": {
        "required": [
          "token",
          "expiresAtUtc"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "expiresAtUtc": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrderCustomerModel": {
        "type": "object",
        "properties": {
          "vestigingId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "klantId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "vestigingNr": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "country": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OrderLineDetailModel": {
        "type": "object",
        "properties": {
          "shortName": {
            "type": [
              "null",
              "string"
            ]
          },
          "longName": {
            "type": [
              "null",
              "string"
            ]
          },
          "group": {
            "type": [
              "null",
              "string"
            ]
          },
          "variant": {
            "type": [
              "null",
              "string"
            ]
          },
          "distributor": {
            "type": [
              "null",
              "string"
            ]
          },
          "distributorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "weight": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "artikelId": {
            "maximum": 2147483647,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "amount": {
            "maximum": 2147483647,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "OrderLineModel": {
        "type": "object",
        "properties": {
          "artikelId": {
            "maximum": 2147483647,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "amount": {
            "maximum": 2147483647,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "OrderModel": {
        "type": "object",
        "properties": {
          "orderId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "vestigingId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "customer": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OrderCustomerModel"
              }
            ]
          },
          "comment": {
            "type": [
              "null",
              "string"
            ]
          },
          "deliveryDate": {
            "type": "string",
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineDetailModel"
            }
          }
        }
      },
      "PagedResultOfCustomerModel": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerModel"
            }
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PagedResultOfProductModel": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductModel"
            }
          },
          "page": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "pageSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalCount": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "totalPages": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ProductModel": {
        "type": "object",
        "properties": {
          "artikelId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "gewicht": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "names": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ProductNameModel"
            }
          }
        }
      },
      "ProductNameModel": {
        "type": "object",
        "properties": {
          "shortName": {
            "type": [
              "null",
              "string"
            ]
          },
          "longName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateOrderRequest": {
        "required": [
          "lines"
        ],
        "type": "object",
        "properties": {
          "comment": {
            "maxLength": 2000,
            "type": [
              "null",
              "string"
            ]
          },
          "lines": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineModel"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "description": "Enter the JWT obtained from /auth/login.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "tags": [
    {
      "name": "Auth"
    },
    {
      "name": "Customers"
    },
    {
      "name": "Orders"
    },
    {
      "name": "Products"
    }
  ]
}