Yes, the claim a device API can be used instead of the claim code, as long as you know the device ID of the P1 you are claiming.
The reason for the claim code is an order of operations problem, especially on iOS. The mobile apps and device SDK don’t know the device ID of the device until it connects to the Photon/P1 private Wi-Fi configuration network. However, once you’ve connected to the Photon/P1 Wi-Fi network, you won’t have access to the Internet anymore, so you can’t make the claim a device API call from the mobile device.
The claim code allows you to make the API call before knowing the device ID and before connecting to the Photon/P1 Wi-Fi. The claim code is passed to the device, which then connects to Wi-Fi and passes the information to the cloud, which associates the device and the account that created the claim code.