{
    "openapi": "3.0.0",
    "info": {
        "title": "API Backoffice Marketplace - Suppliers",
        "description": "Supplier API documentation for Backoffice Marketplace",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://api.bairrocomercialcb.pt/",
            "description": "Local server"
        }
    ],
    "paths": {
        "/api/v1/suppliers/has-merchant": {
            "post": {
                "tags": [
                    "Suppliers"
                ],
                "summary": "VR60 - Check if merchant exists.",
                "operationId": "9470792ed6c62b703a2bcc83f5525842",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "login": {
                                        "type": "string",
                                        "example": "supplier@email.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "example": "password123"
                                    },
                                    "email": {
                                        "type": "string",
                                        "example": "user_to_check@email.com"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Comerciante verificado com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "exists": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Sem permissão"
                    },
                    "500": {
                        "description": "Ocorreu um erro inesperado."
                    }
                },
                "security": [
                    {
                        "BearerAuth": []
                    }
                ]
            }
        },
        "/api/v1/suppliers/get-merchant": {
            "post": {
                "tags": [
                    "Suppliers"
                ],
                "summary": "VR360 - Get a merchant's information",
                "operationId": "7c9dfa61fa69f986ce3130a09f039915",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "login": {
                                        "type": "string",
                                        "example": "supplier@email.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "example": "password123"
                                    },
                                    "email": {
                                        "type": "string",
                                        "example": "user_to_check@email.com"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Comerciante recuperado com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SuppliersGetUserResource"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Sem permissão"
                    },
                    "500": {
                        "description": "Ocorreu um erro inesperado."
                    }
                },
                "security": [
                    {
                        "BearerAuth": []
                    }
                ]
            }
        },
        "/api/v1/suppliers/get-stores": {
            "post": {
                "tags": [
                    "Suppliers"
                ],
                "summary": "Get all merchants' information.",
                "operationId": "2256d360e7542a1b993e0f58d6ae000a",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "login": {
                                        "type": "string",
                                        "example": "supplier@email.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "example": "password123"
                                    },
                                    "withTranslations": {
                                        "type": "boolean",
                                        "example": false
                                    },
                                    "withGallery": {
                                        "type": "boolean",
                                        "example": false
                                    },
                                    "withCategories": {
                                        "type": "boolean",
                                        "example": false
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Comerciantes recuperados com sucesso",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/SuppliersGetStoreResource"
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Sem permissão"
                    },
                    "500": {
                        "description": "Ocorreu um erro inesperado."
                    }
                },
                "security": [
                    {
                        "BearerAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "schemas": {
            "SuppliersGetStoreResource": {
                "properties": {
                    "store_owner_email": {
                        "type": "string",
                        "example": "store.owner@gmail.com"
                    },
                    "commercial_name": {
                        "type": "string",
                        "example": "Store Name"
                    },
                    "fiscal_number": {
                        "type": "string",
                        "example": "235124587"
                    },
                    "email": {
                        "type": "string",
                        "example": "store@example.com"
                    },
                    "website": {
                        "type": "string",
                        "example": "http://www.store.com"
                    },
                    "mobile_phone_number": {
                        "type": "string",
                        "example": "965215456"
                    },
                    "address": {
                        "type": "string",
                        "example": "Rua Exemplo, 123"
                    },
                    "postal_code": {
                        "type": "string",
                        "example": "3000-000"
                    },
                    "city": {
                        "type": "string",
                        "example": "Coimbra"
                    },
                    "country": {
                        "type": "string",
                        "example": "Portugal"
                    },
                    "latitude": {
                        "type": "number",
                        "example": 40.20564
                    },
                    "longitude": {
                        "type": "number",
                        "example": -8.41955
                    },
                    "schedule": {
                        "properties": {
                            "schedule_header_1": {
                                "type": "string",
                                "example": "Horário"
                            },
                            "schedule_text_1": {
                                "type": "string",
                                "example": "Seg-Sex: 9h-18h"
                            },
                            "schedule_header_2": {
                                "type": "string",
                                "example": ""
                            },
                            "schedule_text_2": {
                                "type": "string",
                                "example": ""
                            }
                        },
                        "type": "object"
                    },
                    "social_networks": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "url": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "about_text": {
                        "type": "string",
                        "example": "Some text about the store",
                        "nullable": true
                    },
                    "logo_image": {
                        "type": "string",
                        "example": "http://app-url.com/path/to/logo.jpg",
                        "nullable": true
                    },
                    "banner_image": {
                        "type": "string",
                        "example": "http://app-url.com/path/to/banner.jpg",
                        "nullable": true
                    },
                    "images": {
                        "description": "Only present when withGallery=true",
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "http://app-url.com/path/to/image.jpg"
                        }
                    },
                    "translations": {
                        "description": "Only present when withTranslations=true",
                        "type": "array",
                        "items": {
                            "properties": {
                                "field_name": {
                                    "type": "string",
                                    "example": "notes"
                                },
                                "language": {
                                    "type": "string",
                                    "example": "en"
                                },
                                "translated_text": {
                                    "type": "string",
                                    "example": "Some text"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "marketplace_link": {
                        "type": "string",
                        "example": "http://marketplace.com/merchant/uuid"
                    },
                    "categories": {
                        "description": "Only present when withCategories=true",
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "Vestuário"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-03-23T17:21:14.000000Z"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-03-23T17:21:14.000000Z"
                    }
                },
                "type": "object"
            },
            "SuppliersGetUserResource": {
                "properties": {
                    "first_name": {
                        "type": "string",
                        "example": "John"
                    },
                    "last_name": {
                        "type": "string",
                        "example": "Doe"
                    },
                    "email": {
                        "type": "string",
                        "example": "john.doe@example.com"
                    },
                    "photo": {
                        "type": "string",
                        "example": "http://app-url.com/path/to/photo.jpg"
                    },
                    "fiscal_number": {
                        "type": "string",
                        "example": "235124587"
                    },
                    "phone": {
                        "type": "string",
                        "example": "965215456"
                    },
                    "stores": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SuppliersGetStoreResource"
                        }
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "BearerAuth": {
                "type": "http",
                "bearerFormat": "JWT",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "Suppliers",
            "description": "Suppliers"
        }
    ],
    "security": [
        {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "JWT"
            }
        }
    ]
}