{
    "openapi": "3.0.3",
    "info": {
        "title": "Charge Type API",
        "description": "The Charge Type API provides read-only endpoints for retrieving charge types.",
        "termsOfService": "https://legal.riege.com/en-de/terms",
        "version": "1.0.2"
    },
    "tags": [
        {
            "name": "Charge Types endpoint",
            "description": "Endpoint for querying charge types"
        }
    ],
    "components": {
        "securitySchemes": {
            "basicAuth": {
                "type": "http",
                "scheme": "basic"
            }
        }
    },
    "security": [
        {
            "basicAuth": []
        }
    ],
    "servers": [
        {
            "url": "https://{server}/scope/rest",
            "description": "The base URL",
            "variables": {
                "server": {
                    "default": "example.riege.com",
                    "description": "The server may vary depending on the Scope organization and differs between the test and production environments."
                }
            }
        }
    ],
    "paths": {
        "/v2/chargetypes/{chargeTypeId}": {
            "get": {
                "tags": [
                    "Charge Types endpoint"
                ],
                "summary": "Returns the charge type with the given identifier",
                "parameters": [
                    {
                        "name": "chargeTypeId",
                        "in": "path",
                        "description": "The charge type identifier in Scope",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/xml": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "xml": {
                                        "summary":"XML example file",
                                        "externalValue": "chargeType-example-1.0.xml"
                                    }
                                }
                            },
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "jsonObject": {
                                        "summary": "JSON example file",
                                        "externalValue": "chargeType-example-1.0.json"
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden. User is not allowed to access the resource."
                    },
                    "404": {
                        "description": "Charge type not found"
                    }
                }
            }
        },
        "/v2/chargetypes": {
            "get": {
                "tags": [
                    "Charge Types endpoint"
                ],
                "summary": "List all filtered charge types with paging support",
                "description": "By default 1000 charge types are returned per page, and the page can be chosen by the 'page' parameter. The page size can be set by the 'size' parameter",
                "parameters": [
                    {
                        "name": "organizationCode",
                        "in": "query",
                        "description": "The Scope organization code is required if the user has access to multiple organizations.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "description": "The charge type code can be used to filter the results. If not provided, all charge types are returned.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "The page number to return, increasing by one for each subsequent page",
                        "required": false,
                        "schema": {
                            "format": "int32",
                            "default": 0,
                            "minimum": 0,
                            "type": "integer"
                        }
                    },
                    {
                        "name": "size",
                        "in": "query",
                        "description": "The page size",
                        "required": false,
                        "schema": {
                            "format": "int32",
                            "default": 1000,
                            "minimum": 1,
                            "maximum": 1000,
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/xml" : {
                                "schema" : {
                                    "type": "object"
                                },
                                "examples": {
                                    "xml": {
                                        "summary": "XML example file",
                                        "externalValue": "chargeTypes-example-1.0.xml"
                                    }
                                }
                            },
                            "application/json": {
                                "schema" : {
                                    "type": "object"
                                },
                                "examples": {
                                    "jsonObject" : {
                                        "summary" : "JSON example file",
                                        "externalValue" : "chargeTypes-example-1.0.json"
                                    }
                                }
                            }
                        }
                    },
                    "204": {
                        "description": "No content. No content was sent in the response, possibly due to filter criteria or reaching the end of pagination."
                    },
                    "400": {
                        "description": "Bad request. For example, caused by invalid request parameter values."
                    },
                    "403": {
                        "description": "Forbidden. User is not allowed to access the resource."
                    }
                }
            }
        }
    }
}
