Flex Licensing is supported in MX routers starting from version 22.2R1
When trying to install license S-PAR-MX-4C-P1C1-3 in MX204 running Junos OS 20.4R2 we were seeing the following error.
> request system license add terminal
terminal:1 warning: JUNOS0396xxxxx: Ignoring unknown feature
terminal:1 error: JUNOS0396xxxxx: License contains only unknown features
terminal:1 error: JUNOS0396xxxxx: license not valid for this product
add license failed (2 errors)
• Juniper Agile Licensing (MX204, MX240, MX480, MX960, MX2008, MX2010, MX2020, MX10008, and MX10016)—Starting in Junos OS Release 22.2R1, the listed MX Series devices support Juniper Agile Licensing.
• Juniper Agile Licensing provides simplified and centralized license administration and deployment. You can use Juniper Agile Licensing to install and manage licenses for hardware and software features.
• [ SeeFlex Software License for MX and Managing Licenses..]
Reference
Licensing
https://www.juniper.net/documentation/us/en/software/junos/release-notes/22.2/junos-release-notes-22.2r1/topics/new-features/feature-descriptions/licensing.html
After an upgrade to a version that supports Juniper Agile Licensing the issue was fixed.