Use this library to generate passes, coupons, event tickets, store cards and generic passes:
(if you have an Apple phone your wallet will automatically open the .pkPass file; if you don't install an app that is able to read .pkPass files, such as "Pass2U Wallet", the app will automatically open these files for you)
All fields are documented and you can read additional documentation on the fields and the generated .pkpass package here.
There are specific rules and renderings for each pass type. To understand how the fields will be rendered according to your passType, read the documentation here.
Code improvement.
Updated the description related to the barcode.
Used the API dotnet-passbook that is distributed under the MIT license: https://tomasmcguinness.mit-license.org/