As @liorke said, when i didn't publish the app as production, call the api to production mode returned 401 error.
I want to ask if it is intended.
https://developer.apple.com/documentation/appstoreserverapi
Following the documentation,
For endpoints that take a transactionId as a parameter, be sure to call the endpoint using the same environment that creates the transaction identifier. Environment information is present in the environment property of the JWSTransactionDecodedPayload. If you don’t have environment information, follow these steps:
Call the endpoint using the production URL. If the call succeeds, the transaction identifier belongs to the production environment.
If you receive an error code 4040010 TransactionIdNotFoundError, call the endpoint using the sandbox environment.
If the call succeeds, the transaction identifier belongs to the sandbox environment. If the call fails with the 4040010 error code, the transaction identifier isn’t present in either environment.
Should I change the code right after publishing the app to production mode?