Portugal passport holders need a visa to enter San Marino. You must apply at the San Marino embassy or consulate before traveling. Processing times vary but typically range from 5-15 business days.
A confirmed flight reservation is usually required as part of your visa application documents. Rather than purchasing a non-refundable ticket, you can generate a free dummy ticket from MyJet24 to include with your San Marino visa application.