Skip to main content

Testing your in-app purchases (Sandbox environment)

To distribute apps with in-app purchases (IAPs) on Aptoide Connect, your app needs to have our billing solution implemented, the Android Billing SDK

After implementing it, you'll need to test your app's IAPs and see if the integration is working correctly. For this reason, we have developed a Sandbox environment for you to test IAPs.

To test your app's IAPs, you'll need to:

  1. Download the Aptoide Wallet app.
  2. (Optional) Create a new Wallet address used exclusively for testing.
  3. Add your testing Wallet address to the Sandbox menu on the Developer Console.
  4. Use that testing Wallet address to make purchases on your app.
⚠️
It is mandatory to have ownership of the app to be able to use the Sandbox environment

To be able to see the Sandbox environment on the Aptoide Wallet and test your app's in-app purchases, it is mandatory that you have ownership of your app on Aptoide Connect.

Only after you add your app to the account and successfully prove ownership of your app you'll be able to see the Sandbox environment (displayed as a payment method on the Aptoide Wallet). To see how to do this, click here.

(Optional) Creating a testing Wallet address

After downloading the Aptoide Wallet app, you will already have a default main Wallet address attributed to you. However, If you want to, it is possible to have a Wallet address specifically dedicated to testing.

To create a new Wallet address:

  • Access the Aptoide Wallet;
  • Go to the Wallet's Settings menu by clicking on the dented wheel on the top right side of the screen;
  • Click on "Manage Wallet";
  • On the right side, next to "Manage Wallet", click on the 3 dots > "New Wallet";
  • Give a name to the new Wallet > click on "Submit".

Using the Sandbox environment

To access the Sandbox menu, go to your Aptoide Connect Developer Console and click on Apps > Sandbox.

Sandbox menu in Aptoide Connect Developer Console

In this menu, you will be able to add your Wallet address dedicated to testing, see all Wallet addresses added to the account, and manage them.

To add a new Wallet address for testing, click on "Add", paste the Wallet address dedicated to testing in the Sandbox environment, and click on "Add".

The "Added" column in the Sandbox menu refers to when the Wallet address was added to the Aptoide Connect account. The "Expiration" column says when the Wallet address will automatically be set as inactive. Finally, the "Active" column is where you can toggle and change if a specific Wallet address can use the Sandbox environment or not.

Sandbox wallet addresses list with status and expiration columns
📘
30 days after being added to the Sandbox menu, the Wallet address is automatically set as "Inactive"

When the Wallet address is added on the Sandbox menu, it will be set as "Active" on the toggle so it can be used on the Sandbox environment. After 30 days, this toggle will automatically change and the testing Wallet address will be set as "Inactive".

When it is inactive, the Wallet address becomes a regular Wallet and it is not possible to use it on the Sandbox environment. To be able to use it again for testing, you need to change the toggle again to "Active".

It is possible to see when the Wallet address will be automatically set as inactive by looking at the date on the "Expiration" column.

Alternatively, you can access the Sandbox menu while on the app submission form.

Sandbox menu accessible from the app submission form
❗️
Login Confirmation needs to be configurated to use the Sandbox environment

Please note that in order to use the Sandbox environment to test your app's in-app purchases, the Login Confirmation needs to be configurated and active. To see how to do this, click here.

Testing in-app purchases

After adding the Wallet address on Aptoide Connect, you can test the in-app purchases inside the app by following these steps:

  • Choose the item you want to buy on your app;
  • Scroll down and choose Sandbox option to proceed with the purchase.
Sandbox payment option during in-app purchase on mobile

Once the purchase is completed, a pop-up message saying the purchase is done will be displayed on your screen. To confirm that your in-app purchases went through successfully, access the Wallet on the top menu bar on your Aptoide Connect Console and tick the "Only display sandbox transactions" option:

Wallet page with sandbox transactions filter enabled

There, you will be able to see the list of transactions made in the Sandbox environment and see the purchase you just made. Also, check on your app if the item was received.

If you can make the purchase, receive the item correctly, and no error occurs, you have successfully integrated our billing solution!

Sandbox-specific behaviors

The Sandbox environment mirrors the live payment system, with a few deliberate differences that let you test faster.

Purchase acknowledgment and consumption time limit

In the Sandbox environment, the time limit to acknowledge or consume a purchase is 5 minutes, instead of the 2 days used in the live payment system.

If a purchase is not acknowledged or consumed within this window, it is automatically refunded. This shortened limit lets you test failure scenarios (for example, an unacknowledged purchase being reverted) quickly, before publishing your app.

To learn how to acknowledge and consume purchases, see the Android Billing SDK integration guide.

Sandbox subscription renewal periods

🚧
Feature under development

In-App Subscriptions are currently under development and will be released soon. The information below describes the upcoming Sandbox experience and may change before launch.

When testing subscriptions in the Sandbox environment, renewal periods are shortened so you don't have to wait a full billing cycle to see a renewal. We follow the same values as Google Play Billing – Test renewals:

Production subscription periodSandbox renewal period
1 week5 minutes
1 month5 minutes
3 months10 minutes
6 months15 minutes
1 year30 minutes
📘

In the Sandbox environment, a subscription renews a maximum of 6 times and is then automatically cancelled. Renewal times are approximate, so small variations are expected.

Frequently Asked Questions

Do I need to prepare anything before testing in Sandbox?

Short answer: Yes. Add your in-app products and a testing wallet first.

Details: Before testing on Android, add your in-app products in the Aptoide Connect console and add a testing Wallet address to the Sandbox environment, as described above. Only then can you complete Sandbox purchases from your app.

Why was my Sandbox purchase refunded?

Short answer: Because it wasn't acknowledged or consumed within 5 minutes.

Details: See Purchase acknowledgment and consumption time limit. In the Sandbox environment you have 5 minutes (instead of 2 days) to acknowledge or consume a purchase; otherwise it is automatically refunded. This is expected behavior and lets you test unacknowledged-purchase scenarios quickly.