Welcome to iMore? Give us a bit more info. Are you locked out of your phone? Can you open your phone but just want to change or add a pin code? This link should explain how to set up a pin. You can use simple 4 digit number or any other password. Note: A 4 digit code is easier to remember. If you use the pin to lock your phone and forget the pin, you're out of luck and locked out. If that happened, you would have to restore your phone and would lose your content. So use a pin you will remember. Write it down and stick it in a safe place. Here's the instructions: http://m.wikihow.com/Set-a-Passcode-on-an-iPhone
I'm testing software and it requires a 4 digit pin to load. Not my apple id is it because I dont remember setting up a pin. I tried several of my usual but no luck.