Verification failed with status INVALID_APP_IDENTIFIER using Sandbox

I get this error: Verification failed with status INVALID_APP_IDENTIFIER

we use this method:

payload = signed_data_verifier.verify_and_decode_notification(notification_data)

I use Production environment (this is automatically set in our server) and use my device (connected to Mac) to test the purchase. When trying to purchase I get the Sandbox environment in the Widget.

This works when manually setting the environment to Sandbox before calling the function. The time it works because it does not check the apple app id (because of the environment).

Now my question is: Which is the apple app id? Is it the App Id "Apple-ID" in the app store connect? Or is it the TeamId+BundleId?

Could it be that my function doesnt work because the Payment was done in Sandbox and the environment is Production?

Verification failed with status INVALID_APP_IDENTIFIER using Sandbox
 
 
Q