How to hold temporary data between API calls/endpoints?

There is an API which for its authentication to get an auth token requires creating a unique random and temporary id which you add to the first request.

It then redirects to the redirect_uri you predefined with 2 query parameters, one of which is the id provided before, and that call needs to verify that it is the same id. 

So i created one call that sets everything up and uses a uuid to create the verification code, then created another endpoint which is the redirect uri where i want to verify that it is the same code i created in the last call being passed back.

So i need to pass the uuid i made to this call which means saving it somewhere. Is there a best practice for saving or passing temporary data? 

I thought to save it to a user table but i won't know the user id until the end of the second call. Should I create a temporary id, or use the uuid as the user id, and at the end change it to the actual username? How would I even pull up the correct user record on the second call?  
Working with APIs
3 replies