{"openapi":"3.1.0","info":{"title":"API Iterpec - Cartão Virtual","description":"API para operações de cartão virtual (VCN). Exige autenticação JWT Bearer.\nUse o botão **Authorize** e cole o token obtido no servidor de autenticação externo.","version":"1.0.0"},"servers":[{"url":"/","description":"Servidor atual"}],"security":[{"bearerAuth":[]}],"paths":{"/vcn/require":{"post":{"tags":["API de cartão virtual"],"description":"Solicita um cartão virtual","operationId":"require","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequireVanRequest"}}},"required":true},"responses":{"200":{"description":"Cartão virtual obtido com sucesso","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RequireVanResponse"}}}},"400":{"description":"Requisição inválida (ex.: reservation ausente ou inválida)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RequireVanResponse"}}}},"401":{"description":"Não autorizado (token inválido ou expirado)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RequireVanResponse"}}}},"500":{"description":"Erro interno do servidor","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RequireVanResponse"}}}}}}},"/vcn/cancel":{"post":{"tags":["API de cartão virtual"],"description":"Cancela um cartão de uma reserva","operationId":"cancel","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelVanRequest"}}},"required":true},"responses":{"200":{"description":"Cartão cancelado com sucesso","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CancelVanResponse"}}}},"400":{"description":"Requisição inválida (ex.: reservationID/serviceID ausentes ou cartão inexistente)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CancelVanResponse"}}}},"401":{"description":"Não autorizado (token inválido ou expirado)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CancelVanResponse"}}}},"500":{"description":"Erro interno do servidor","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CancelVanResponse"}}}}}}}},"components":{"schemas":{"PaxDto":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"}}},"RequireVanRequest":{"type":"object","properties":{"reservation":{"$ref":"#/components/schemas/Reservation"}},"required":["reservation"]},"Reservation":{"type":"object","properties":{"id":{"type":"string"},"service_id":{"type":"string"},"service_name":{"type":"string"},"service_city":{"type":"string"},"service_country":{"type":"string"},"reservation_date":{"type":"string","format":"date-time"},"check_in_date":{"type":"string","format":"date-time"},"check_out_date":{"type":"string","format":"date-time"},"client_penalty_date":{"type":"string","format":"date-time"},"pax":{"$ref":"#/components/schemas/PaxDto"},"supplier":{"$ref":"#/components/schemas/SupplierDto"},"hotel_id":{"type":"integer","format":"int64"}},"required":["id","service_id","supplier"]},"SupplierDto":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"number","format":"float","minimum":0},"currency":{"type":"string"},"penalty_start_time":{"type":"string","format":"date-time"},"penalty_end_time":{"type":"string","format":"date-time"},"penalty_value":{"type":"number","format":"float"},"penalty_currency":{"type":"string"}},"required":["currency","id","value"]},"RequireVanResponse":{"type":"object","properties":{"errorCode":{"type":"integer","format":"int32"},"errorMessage":{"type":"string"},"isSuccessful":{"type":"boolean"},"responseTime":{"type":"integer","format":"int64"},"van":{"$ref":"#/components/schemas/VirtualCardDTO"}}},"VirtualCardDTO":{"type":"object","properties":{"accountNumber":{"type":"string"},"cvv":{"type":"string"},"cardHolderName":{"type":"string"},"expiryDate":{"type":"string"},"uniqueCode":{"type":"string"},"brand":{"type":"string"},"brandCode":{"type":"string"}}},"CancelVanRequest":{"type":"object","properties":{"reservationID":{"type":"string"},"supplierID":{"type":"string"},"serviceID":{"type":"string"},"reservationDate":{"type":"string","format":"date-time"}},"required":["reservationID","serviceID"]},"CancelVanResponse":{"type":"object","properties":{"errorCode":{"type":"integer","format":"int32"},"errorMessage":{"type":"string"},"isSuccessful":{"type":"boolean"},"responseTime":{"type":"integer","format":"int64"}}}},"securitySchemes":{"bearerAuth":{"type":"http","description":"Obtenha o token no servidor de autenticação (https://auth.iterpec.com) e cole aqui.","name":"bearerAuth","scheme":"bearer","bearerFormat":"JWT"}}}}