Test Setup
Every integration partner must sign up for a developer account on the Amazon developer portal. After providing information such as web service URL for Link and Purchase calls, the developer portal requires the vendor to run the integration suite of tests before moving on to production. These tests can be run for either Subscriptions or One-Time Purchases, depending on the type of product to be sold. Running the tests from the developer portal ensures the system will be tested with properly formatted messages and will help resolve any networking and security issues. The developer cannot continue to production without first passing all tests.
- Navigate to https://developer.amazon.com/welcome.html and create a new developer account.
- Click the Apps & Services tab and click the “PC/Mac Instant Access” sub tab.
- Enter your endpoint information and you are ready to test the Link and Purchase API calls
Test Cases
The following test scenarios will be run to verify that the integration has been completed appropriately:
Test Case | Description | Expected behavior |
---|---|---|
Link | Link request with a valid user identifier(s). | Positive test. The “response” should be OK and a valid user identifier returned. |
Link Duplicate | Link request with the same valid user identifier(s). | Your system should return exactly the same “userId” as the previous test for the same user identifier |
Link bad | Enter an invalid user identifier | The “response” field is “FAIL_ACCOUNT_INVALID”. The “userId” field can be left out or be populated with an empty value. |
Fulfill | Valid userId and productID are sent | The item is fulfilled and an ‘OK’ is sent in the response. |
Fulfill - Duplicate | An identical fulfill message is sent as in the previous example | The “purchaseToken” is recognized and item is not fulfilled a second time since it was fulfilled previously. Response should still be ‘OK’ and NOT an error code. |
Fulfill - Invalid user | An invalid userId is passed in the fulfill message | Return a FAIL_INVALID_USER (error code) or FAIL_OTHER |
Fulfill – Invalid ProductId | An invalid productId is passed in the fulfill message | Return a FAIL_OTHER in the response code. |
Revoke | A revoke for a previously fulfilled message is sent | The item is revoked and an ‘OK’ is sent in the response. |
Revoke Duplicate | A duplicate revoke message is sent | Don’t revoke the item again and send a ‘OK’ in the response code. |
Subscription Creation | Valid Create SubscriptionAction | The subscription is fulfilled and ‘OK’ is sent in the response |
Subscription Deactivation | Valid Deactivate SubscriptionAction | Access to the subscription is revoked and ‘OK’ is sent in the response |
Subscription - duplicate | Duplicate message for action that already happened | No action necessary. ‘OK’ is sent in the response |
Subscription – invalid user | An invalid userId is passed in the SubscriptionAction message | Return ‘FAIL_INVALID_USER’ |
Subscription – invalid productId | An invalid productId is passed in the SubscriptionAction message | Return ‘FAIL_OTHER’ |
Additional Testing Note
Amazon does not provide a testing stage outside of the tools provided in the developer portal and our live production stage. Amazon can still index suppress and remove buyability from any products that a developer wishes to test, but there is no strict development environment to test products in.