How to identify the environment of a StoreKit2 JWS transaction on server side?

Any way to find out the StoreKit2 transaction is a production or sandbox on server side? After validate and decode a transaction, none of the keys can indicate the environment.

{
  "transactionId": "...........",
  "originalTransactionId": "...........",
  "bundleId": "...........",
  "productId": "...........",
  "purchaseDate": 1634207858866,
  "originalPurchaseDate": 1634207858866,
  "quantity": 1,
  "type": "Consumable",
  "deviceVerification": "...........",
  "deviceVerificationNonce": "...........",
  "appAccountToken": "...........",
  "inAppOwnershipType": "PURCHASED",
  "signedDate": 1634207859014
}

I have encountered the same problem recently and haven't found a good solution yet, wait online!

I have encountered the same problem recently and haven't found a good solution yet, wait online! 

Which Api did you try to find out? If it is get transactions history you can find a key called "environment" https://developer.apple.com/documentation/appstoreserverapi/historyresponse

If it is look up orderid or refund API I think you can find out user for your system.

https://developer.apple.com/documentation/appstoreserverapi/jwstransactiondecodedpayload?changes=latest_minor

About the lastest update, After validate and decode a jws transaction, already have a filed about environment

How to identify the environment of a StoreKit2 JWS transaction on server side?
 
 
Q