Return ID - Function

…annnnnd second glance:

$.ajax is asyncronus, so when the return is exectuted, you probably havn’t gotten a response from the api yet. You need to do it with a callback.