Zamoyski Code (Polish: Kodeks Zamoyskiego or Zbiór praw sądowych na mocy konstytucji roku 1776 przez J.W. Andrzeja Zamoyskiego ekskanclerza koronnego ułożony... [Collection of court laws requested by constitution of 1776 designed by former chancellor Andrzej Zamoyski]) was a major, progressive legislation, proposed by Andrzej Zamoyski, Grand Chancellor of the Crown of the Polish–Lithuanian Commonwealth, in 1776. This legislation was an attempt of codification of the previously uncodified law of the Commonwealth. It was opposed by several conservative and foreign factions and eventually rejected by the sejm of 1780.
In 1776, the Sejm of the Polish–Lithuanian Commonwealth, on the initiative of the Polish king Stanisław August Poniatowski, commissioned former Grand Chancellor of the Crown, Andrzej Zamoyski, to draft a new legal code. A commission, headed by Zamoyski, and including other notable members, such as Józef Wybicki and Joachim Chreptowicz, was created. By 1778, under Zamoyski's direction, a code (Zbiór praw sądowych, also known from his name as Zamoyski's Code[x]) had been produced and published in print.
The code would have strengthened royal power, made all officials answerable to the Sejm, placed the clergy and their finances under state supervision, gave more privileges to the townsfolk, reduced serfdom, and deprived landless szlachta of many of their legal immunities.
Zamoyski Code was opposed by several factions. Internally, conservative szlachta were afraid that the Code would strengthen the power of the Polish king and the government and replace the anarchy-like Golden Freedoms with absolutist rule. Representatives of the Grand Duchy of Lithuania were afraid that it would weaken the Duchy's autonomy, part of which was entailed a semi-separate legal system (the code would replace the Third Lithuanian Statue). These sentiments were used by two foreign powers, which did not want to see the Code passed for their own separate reasons: the Vatican (Holy See) opposed the Code, as it limited ecclesiastical law throughout the Commonwealth, replacing it with secular law; Russian Empire saw the Code as going too far in reforming and strengthening the inefficient and Russia-dependent Polish governance. Working together, in an unlikely alliance between the Roman Catholic Church and Orthodox Russia, papal nuncio Giovanni Andrea Archetti and Russian ambassador Otto Magnus von Stackelberg jointly bribed deputies to the Polish Sejm in exchange for their opposition to the Code.