1) If my order goes into status "PENDING_APPROVAL", will the subnet
object exist in getSubnets at that point?
That only means that your order has been submitted to softlayer, now if everthing goes fine your order will be approved automatically otherwise a Softlayer's employee will have to approve it manually.
2) Do I need to wait for it to get to "APPROVED" status before the
subnet object is created?
When the status is changed to "APPROVED" the process to provision your network subnet is started, the time that this process takes is variable and sometimes the process could fail in that case a softlayer's employee will review what was wrong and try to fix it if he cannot fix it he will contact you. When your device pass by this status you can start querying for your subnet it should be available soon.
3) Can I guarantee that the subnet object will exist once I am in
"APPROVED" state, or could there be a time delay while it is created?
Nop, it only means that the provisioning process of your fdevice has been started. It is likely that you can query the ID of the device, but that does not mean that the device is ready to use, only when the transaction is completed you will be sure that the device is ready to use (Note: when the provisioning process starts a transaction is created)
4) Also is there a status that represents when an order has been cancelled?
yes there are an status for that it should be "CANCELLED" that status only can be changed by Sofltayer's employees when the status order is "PENDING_APPROVAL", if the status is "APPROVED" the order cannot be canceled.
My concern is being able to differentiate between:
"I can't find a subnet referring to this order ID, because it hasn't
been created yet"
If the order has been APPROVED you should be able to see soon the device, you just need to keep querying, if after a couple of minutes you are not able to see the device is likely due to something went wrong at provisioning time. When the device is in Provisioning process a transaction is created you can see the transaction associated to your device using this method:
http://sldn.softlayer.com/reference/services/SoftLayer_Network_Subnet/getActiveTransaction
The transaction can pass by several status, you could monitor all those status in order to know if everything is fine.
and
"I can't find a subnet referring to this order ID, because the order
has been cancelled and the subnet is now deleted".
If the status is cancelled the subnet has never been created.
Regards