Android SDK 2.9.1 > Error : 400 Bad Request > setVariationId()
A
Axita Savani
Hi, Team
We are facing the below issues when trying to set up an event after purchase.
Request is unsuccessful. https://api.adapty.io/api/v1/sdk/in-apps/transaction-variation-id/ Code: 400, Response: {"errors":[{"detail":"Transaction with this id does not exist","status":"400","source":{"pointer":"/data"},"code":"TRANSACTION_NOT_FOUND"}]}
Java
Adapty.setVariationId(purchase.getOrderId(), paywall.getVariationId(), new ErrorCallback() {
@Override
public void onResult(@Nullable AdaptyError error) {
if (error == null) {
ObLogger.i(TAG, "setVariationId onResult: EventSent --> ");
} else {
ObLogger.i(TAG, "setVariationId onResult: error --> " + error.toString());
}
}
});
Note:
Paywall: Comes from "Adapty.getPaywall()" function
Purchase: Comes from GooglePlayBilling "onPurchasesUpdated()" method.
SDK : implementation 'io.adapty:android-sdk:2.9.1'
A
Axita Savani
Okay, Can you please share what is the sequence of Action? Also, How do Validate Purchases in your terms?
A
Amina M, Adapty
Hello! Thank you for getting in touch.
Upon checking our backend system, it appears that the transaction with the provided vendor_transaction_id was not located. It's possible that there may be an issue with the sequence of actions taken.
Typically, it's necessary to validate the purchase first before assigning the variation_id.
If you require further assistance, please feel free to let us know. We're here to help!