How to unlock a Nexus unit?

Posting this on behalf of a partner:

Kindly provide assistance on how to generate an unlock code using the nexus api. We are able to generate for a specific number of days but not one to fully unlock a device.

To do this you need to issue a PUT request to the unit_credit endpoint. Specify "UNLOCKED" as the credit_until_dt. When you GET an unlocked unit it will report None/null as the credit_until_dt. The keycode will be available at the keycodes endpoint.