{
    "swagger": "2.0",
    "host": "lead-api.online.xpogroup.com",
    "basePath": "",
    "schemes": [
        "https"
    ],
    "info": {
        "title": "Tickoweb Lead APi",
        "description": "Tool to get user data from tickoweb api using barcode data",
        "version": "1.0",
        "contact": {
            "email": "support@tickoweb.be"
        }
    },
    "paths": {
        "\/lead\/list": {
            "get": {
                "tags": [
                    "Lead list"
                ],
                "description": "Retrieve a paginated list of leads for a given partner\/event combination.<br>Endpoint can be enabled\/disabled for each API key (partner) in the administration panel.",
                "parameters": [
                    {
                        "name": "X-Api-Key",
                        "in": "header",
                        "description": "API key needed to authorize this request",
                        "type": "string",
                        "required": true
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination (optional)",
                        "type": "integer",
                        "required": false
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully retrieved list of leads",
                        "schema": {
                            "$ref": "#\/definitions\/LeadListObject"
                        }
                    },
                    "401": {
                        "description": "Authorization failed. Example: Invalid API key provided.",
                        "schema": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer"
                                },
                                "message": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Request failed. Example: Event not found.",
                        "schema": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer"
                                },
                                "message": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request. Example: Missing or invalid partner UUID.",
                        "schema": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer"
                                },
                                "message": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/barcode\/{barcode}": {
            "get": {
                "tags": [
                    "Barcode"
                ],
                "description": "Get user data for given barcode.<br>Endpoint can be enabled\/disabled for each API key (partner) in the administration panel.",
                "parameters": [
                    {
                        "name": "barcode",
                        "in": "path",
                        "description": "Barcode string used to retrieve user data",
                        "type": "string",
                        "required": true
                    },
                    {
                        "name": "X-Api-Key",
                        "in": "header",
                        "description": "API key needed to authorize this request",
                        "type": "string",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully retrieved barcode data, including user information.",
                        "schema": {
                            "$ref": "#\/definitions\/BarcodeObject"
                        }
                    },
                    "401": {
                        "description": "Authorization failed. Example: Invalid API key provided.",
                        "schema": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer"
                                },
                                "message": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Request failed. More information provided in the error response.",
                        "schema": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer"
                                },
                                "message": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "BarcodeObject": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "format": "uuid"
                },
                "language": {
                    "type": "string",
                    "description": "shortname for the language of the customer",
                    "enum": [
                        "de",
                        "en",
                        "es",
                        "fr",
                        "it",
                        "nl",
                        "pl",
                        "pt"
                    ]
                },
                "firstName": {
                    "type": "string",
                    "description": "firstname of the customer"
                },
                "lastName": {
                    "type": "string",
                    "description": "lastname of the customer"
                },
                "email": {
                    "type": "string",
                    "description": "email of the customer",
                    "format": "email"
                },
                "street": {
                    "type": "string",
                    "description": "street of the customer"
                },
                "housenumber": {
                    "type": "string"
                },
                "zipcode": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "country": {
                    "type": "string",
                    "enum": [
                        "de",
                        "en",
                        "es",
                        "fr",
                        "it",
                        "nl",
                        "pl",
                        "pt"
                    ]
                },
                "phone": {
                    "type": "string",
                    "description": "phone number of the customer"
                },
                "mobile": {
                    "type": "string",
                    "description": "mobile number of the customer"
                },
                "birthDate": {
                    "type": "string",
                    "format": "date"
                },
                "gender": {
                    "type": "string",
                    "enum": [
                        "m",
                        "v",
                        "x"
                    ]
                },
                "company": {
                    "type": "string"
                },
                "vat": {
                    "type": "string"
                }
            }
        },
        "LeadListObject": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "description": "UUID of the lead",
                    "format": "uuid"
                },
                "partnerId": {
                    "type": "string",
                    "description": "UUID of the partner"
                },
                "channelId": {
                    "type": "string",
                    "description": "UUID of the channel"
                },
                "scannerId": {
                    "type": "string",
                    "description": "UUID of the scanner"
                },
                "barcodeId": {
                    "type": "string",
                    "description": "UUID of the barcode"
                },
                "language": {
                    "type": "string",
                    "description": "Language short code",
                    "enum": [
                        "de",
                        "en",
                        "es",
                        "fr",
                        "it",
                        "nl",
                        "pl",
                        "pt"
                    ]
                },
                "country": {
                    "type": "string",
                    "description": "Object with ISO-2 country code and translated names",
                    "enum": [
                        "de",
                        "en",
                        "es",
                        "fr",
                        "it",
                        "nl",
                        "pl",
                        "pt"
                    ]
                },
                "firstName": {
                    "type": "string",
                    "description": "First name of the lead"
                },
                "lastName": {
                    "type": "string",
                    "description": "Last name of the lead"
                },
                "email": {
                    "type": "string",
                    "description": "Email address of the lead",
                    "format": "email"
                },
                "street": {
                    "type": "string",
                    "description": "Street of the lead"
                },
                "housenumber": {
                    "type": "string",
                    "description": "Housenumber of the lead"
                },
                "zipcode": {
                    "type": "string",
                    "description": "Zipcode of the lead"
                },
                "city": {
                    "type": "string",
                    "description": "City of the lead"
                },
                "mobile": {
                    "type": "string",
                    "description": "Mobile number of the lead"
                },
                "birthDate": {
                    "type": "string",
                    "description": "Birthdate of the lead",
                    "format": "date"
                },
                "gender": {
                    "type": "string",
                    "description": "Gender of the lead",
                    "enum": [
                        "m",
                        "v",
                        "x"
                    ]
                },
                "company": {
                    "type": "string",
                    "description": "Company of the lead"
                },
                "data": {
                    "type": "string",
                    "description": "Array of additional data fields (LeadField objects)"
                },
                "created": {
                    "type": "string",
                    "description": "Creation date (date-time)"
                },
                "updated": {
                    "type": "string",
                    "description": "Last update (date-time, nullable)"
                }
            }
        },
        "LeadFieldObject": {
            "type": "object",
            "properties": {
                "identifier": {
                    "type": "string",
                    "description": "Identifier of the lead field"
                },
                "type": {
                    "type": "string",
                    "description": "Type of the lead field (checkbox, checkbox_list, date, select, text)",
                    "enum": [
                        "checkbox",
                        "checkbox_list",
                        "date",
                        "select",
                        "text"
                    ]
                },
                "name": {
                    "type": "string",
                    "description": "Translated name object"
                },
                "description": {
                    "type": "string",
                    "description": "Translated description object"
                },
                "value": {
                    "type": "string",
                    "description": "Value of the field: boolean | string | LeadFieldOption | LeadFieldOption[]"
                }
            }
        },
        "LeadFieldOptionObject": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Uuid of the lead field option",
                    "format": "uuid"
                },
                "name": {
                    "type": "string",
                    "description": "Translated name object"
                }
            }
        }
    },
    "securityDefinitions": {
        "UserSecurity": {
            "type": "basic"
        }
    }
}