You gave yourself the answer to your question:
- Both versions are grammatically correct.
- They mean different things.
And you also said this, which is correct too:
- »in« + accusative case = direction
in die Türkei = into turkey
Ich gehe in die Küche = I go into the kitchen.
- »in« + dative case = place
in der Türkei = in turkey
Ich bin in der Küche = I am in the kitchen.
Now for interchangeability:
You already are aware of the fact, that both sentences mean different things. Lets have a closer look to the differences:
But the vast majority of business cases are of the 3rd type. It is hard to tell in which country the deal is done, when both partners reside in different countries and don't move. What moves is the goods in one direction and the (virtual) money in the opposite direction.
So, »in der Türkey« (a place) will not fit. But »in die Türkey« (a direction) fits perfect.
an die Türkei
In a comment you also asked:
If the "direction is more reasonable", would it not have been better to write "Im Jahr 2017 sind deutsche Waren im Wert von mehr als 21,4 Milliarden Euro AN die Türkei verkauft worden."
This is grammatically correct too, and it has a third meaning.
Hans verkauft Wasser an Martha.
This means, that Martha is buying the water. After the deal she is the owner of the sold good. In this sentence we don't talk about directions or places. We talk about ownership.
If we talk this way about a country, the meaning of what a country is, changes:
When we talk about directions and places we think of a country as a geographic region on the surface of planet earth. But when I say:
Ich verkaufe mein altes Fahrrad an die Türkei.
I sell my old bicycle to turkey.
then I'm thinking of Turkey as a nation, consisting of people living in a certain region. But I do not mean, that this nation is becoming the now owner of by old bike. I mean that one of the citizens of Turkey will be the new owner.
Im Jahr 2017 sind deutsche Waren im Wert von mehr als 21,4 Milliarden Euro in die Türkei verkauft worden.
Goods have been sold, and at the end they land in a certain geographic region.
Im Jahr 2017 sind deutsche Waren im Wert von mehr als 21,4 Milliarden Euro in der Türkei verkauft worden.
People made deals while they were in a certain geographic region.
Im Jahr 2017 sind deutsche Waren im Wert von mehr als 21,4 Milliarden Euro an die Türkei verkauft worden.
Goods have been sold to some people who are citizens of a certain nation that occupies a certain geographic region.