Diplomatic relations between the member states of the German Customs Union and the Kingdom of Siam were established in 1862 with the signing of the Treaty of Amity, Commerce and Navigation. This followed on from the trade treaty between the Hanseatic cities of Hamburg, Lübeck and Bremen and the Kingdom of Siam of 1858.
More information: Germany and Thailand: Bilateral relations - Federal Foreign Office
Source: German Federal Foreign Office