The Merchant API Test Accounts feature provides a safe and isolated space to thoroughly test integrations before deploying them in a live environment. By using sandboxed test accounts, you can experiment with API calls, validate code, and identify potential issues early in the development cycle, without impacting production data, disrupting real-time operations, or inadvertently violating Merchant Center policies.
Prerequisites
Before you can create and use test accounts, ensure you meet the following requirements:
- Merchant Center Account: You must have a Merchant Center account.
- Merchant API Access: You must be a registered user of the Merchant API.
Benefits of Test Accounts
Using test accounts offers several key advantages:
- Simple Setup: The test account setup is a low-complexity process that lets you quickly begin testing your features and integrations.
- Data Integrity and Safety: Production data remains protected, and the risk of policy violations in production accounts is eliminated.
- Testing Efficiency: You can test a wide range of diverse scenarios and edge cases without the burden of maintaining a parallel production account for testing purposes.
- Immediate Offer Validation: Take advantage of the automatic exemption from homepage claiming and verification for test accounts to quickly test offer insertions. The offers are approved by default for test accounts.
- Realistic Simulation: The environment mirrors production behavior for critical functionalities like product uploads and inventory management, ensuring that test results are reliable.
- Smoother API Migrations: Test accounts facilitate a confident and seamless transition for those moving from Content API to Merchant API or from one API version to another by allowing side-by-side validation.
How to Create Test Accounts
Test accounts are created using a specific custom method in the Merchant API.
Use the accounts.createTestAccount method:
POST https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}:createTestAccount
Content-Type: application/json
Authorization: Bearer {ACCESS_TOKEN}"
{
"account_name": "{TEST_ACCOUNT_NAME}",
"time_zone": {
"id": "America/Los_Angeles"
},
"language_code": "en-US"
}
Replace the following:
ACCOUNT_ID: your Merchant Center ID.ACCESS_TOKEN: the authorization token to make the API CallTEST_ACCOUNT_NAME: the name of the test account. We recommend using meaningful names that suggest they are used for testing. For example, have the wordtestinside the test account name.
The following fields are required when creating a test account:
time_zone: The reporting and display time zone for the account.language_code: The BCP-47 language code for the account, such asen-US.
A successful call returns an
Account
resource that includes the new test account's unique accountId and resource
name:
{
"name": "accounts/{TEST_ACCOUNT_ID}",
"accountId": "{TEST_ACCOUNT_ID}",
"accountName": "{TEST_ACCOUNT_NAME}",
"adultContent": false,
"testAccount": true,
"timeZone": {
"id": "America/Los_Angeles"
},
"languageCode": "en-US"
}
Limitations
Test accounts are designed for functional validation and have specific restrictions:
- Test accounts number: You can create a maximum of 5 test accounts per Google Account. Test accounts count towards your default limit of Merchant Center accounts per Google Account.
- Integration with Merchant API quotas: From an API quota perspective, Merchant API treats test accounts as production accounts. Test accounts are subject to the same quotas as production accounts. Quota increases for test accounts are not possible.
- Advanced accounts: You can't create advanced test accounts or convert an advanced account to a test account.
- No public serving: Data submitted to a test account will never be published on any Google platform, such as Search or Shopping ads.
- Restricted endpoints: You can't use test accounts when using certain features such as:
- Linking Restrictions: You can't link test accounts to other Google Ads or Google Business Profile accounts.
- No registration for test accounts: You can't perform registration for test accounts.
Best Practices
We recommend following some best practices when using test accounts:
- Sandbox-First Development: Always validate new integration features in a test account before applying them to your production environment.
- Automated Integration Testing: Use test accounts as stable environments for running automated regression tests.
- Test account naming: Use the
account_nameto hint to the purpose of each test account, such as "Migration Testing" or "Integration test account".