} ], "responses": { "200": { "description": "Extrato retornado com sucesso", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StatementResponse" } } } }, "400": { "description": "Erro ao consultar extrato", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me": { "get": { "description": "Retorna os dados da conta do usuário autenticado", "responses": { "200": { "description": "Dados da conta retornados", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserData" } } } }, "400": { "description": "Erro ao consultar dados do usuário", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/withdraw": { "post": { "description": "Processa retirada para chave PIX previamente cadastrada do Titular da Conta", "requestBody": { "required": true, "description": "Dados para envio Pix", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WithdrawRequest" } } } }, "responses": { "200": { "description": "Dados da conta retornados", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PixSendResponse" } } } }, "400": { "description": "Erro ao realizar o processamento da retirada", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/withdraw/add": { "post": { "description": "Adicionar chave PIX para realizar retirada de saldo", "requestBody": { "required": true, "description": "Dados da chave PIX a ser cadastrada", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WithdrawAddRequest" } } } }, "responses": { "200": { "description": "Chave PIX adicionada com sucesso", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WithdrawAddResponse" } } } }, "400": { "description": "Erro ao adicionar chave PIX", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } }, "components": { "schemas": { "AuthRequest": { "type": "object", "required": ["api_key", "api_secret"], "properties": { "api_key": { "type": "string" }, "api_secret": { "type": "string" } } }, "AuthResponse": { "type": "object", "properties": { "access_token": { "type": "string" }, "token_type": { "type": "string", "exemplo": "Bearer" }, "expires_in": { "type": "integer", "exemplo": 3600 } } }, "PixChargeRequest": { "type": "object", "required": ["amount"], "properties": { "amount": { "type": "number", "format": "float" }, "expire": { "type": "number", "description": "Tempo de expiração em segundos"} } }, "PixChargeResponse": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" }, "transaction_id": { "type": "string" }, "qr_code" : { "type": "string" }, "image" : { "type": "string" }, "amount" : { "type": "number" }, "status" : { "type": "string" }, "created_at": { "type": "string", "format": "date-time" } } }, "PixSendRequest": { "type": "object", "required": ["amount", "key", "unique_id"], "properties": { "amount": { "type": "number" }, "key": { "type": "string", "description": "Chave PIX que deseja enviar o pagamento"}, "unique_id" : { "type": "string", "description": "Código único do seu sistema para evitar envio duplicado"}, "doc" : { "type": "string", "description": "Campo opcional para verificar a correspondência entre a chave Pix e o documento do titular."} } }, "PixSendResponse": { "type": "object", "properties": { "code": { "type": "integer" }, "message" : { "type" : "string"}, "transaction_id": { "type": "string" }, "status": { "type": "string" }, "end2end_id" : { "type" : "string"}, "transaction": { "type": "object"} } }, "PixTransactionStatus": { "type": "object", "properties": { "transaction_id": { "type": "string" }, "qr_code" : { "type": "string" }, "image" : { "type": "string" }, "transaction_amount" : { "type": "number" }, "transaction_total" : { "type": "number" }, "status": { "type": "string" }, "amount": { "type": "number", "format": "float" }, "paid" : { "type" : "integer"}, "end2end_id" : { "type" : "string"}, "transaction_reference" : { "type" : "string"}, "timestamp": { "type": "string", "format": "date-time" } } }, "PixDictResponse": { "type": "object", "properties": { "payee": { "type": "object" }, "dictKey": { "type": "string" }, "endToEndId": { "type": "string" } } }, "StatementResponse": { "type": "array", "items": { "type": "object", "properties": { "current_page": { "type": "integer" }, "data": { "type": "object" }, "first_page_url": { "type": "string" }, "from": { "type": "integer" }, "last_page": { "type": "integer" }, "last_page_url": { "type": "string" }, "next_page_url": { "type": "string" }, "path": { "type": "string" }, "per_page": { "type": "integer" }, "prev_page_url": { "type": "string" }, "to": { "type": "integer" }, "total": { "type": "integer" } } } }, "UserData": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "email": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" } } }, "WithdrawAddRequest": { "type": "object", "required": ["key"], "properties": { "key": { "type": "string" } } }, "WithdrawRequest": { "type": "object", "required": ["amount"], "properties": { "amount": { "type": "number", "format": "float", "example": 250.75, "description": "Valor a ser retirado em reais (R$)" } } }, "WithdrawAddResponse": { "type": "object", "properties": { "code": { "type": "string", "description": "Código de sucesso / erro da operação" }, "message": { "type": "string", "description": "Mensagem confirmando a operação" }, "bank": { "type": "object", "description": "Objeto com as informações da Chave PIX cadastrada" } } }, "WithdrawResponse": { "type": "object", "properties": { "transaction_id": { "type": "string", "example": "wd_987654321", "description": "ID único da transação de retirada" }, "amount": { "type": "number", "format": "float", "example": 250.75, "description": "Valor da retirada" }, "currency": { "type": "string", "example": "BRL" }, "status": { "type": "string", "enum": ["PENDING", "PROCESSING", "COMPLETED", "FAILED"], "example": "PROCESSING", "description": "Status atual da retirada" }, "pix_key": { "type": "string", "example": "user@email.com", "description": "Chave PIX utilizada na retirada" }, "created_at": { "type": "string", "format": "date-time", "example": "2025-09-16T15:30:00Z" } } }, "Error": { "type": "object", "required": ["error", "message"], "properties": { "error": { "type": "integer" }, "message": { "type": "string" } } } }, "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer" } } } }