> For the complete documentation index, see [llms.txt](https://docs.coda.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coda.co/codashop-and-distribution/integration-guides/test-api-integration.md).

# Test API Integration

## <mark style="color:purple;">Step 1: Click on 'Test' button</mark>

<figure><img src="/files/qkfYBvbKfsqVIKQyXke3" alt=""><figcaption></figcaption></figure>

## <mark style="color:purple;">Step 2: Enter the relevant values in the field fields to begin testing</mark>

<figure><img src="/files/VgAbFl4qqMNDf3FkmQmP" alt=""><figcaption></figcaption></figure>

## <mark style="color:purple;">Step 3: Click on 'Test' and Verify the API test response</mark>

<figure><img src="/files/2hztOiCFpSV23He5Gv7t" alt=""><figcaption></figcaption></figure>

### How to intepret the API Test responses?

#### Positive Test Cases (Expected to Pass)

* **User Validation API Test**
  * Purpose: Validates user authentication and authorization
  * What it tests: Sends a validation request to publisher API to verify user credentials
  * Expected: User is valid and can make purchases
* **User Sync API Test**
  * Purpose: Tests user synchronization between Coda and publisher
  * What it tests: Syncs user data to ensure consistency
  * Expected: User data is properly synchronized
* **First Time Top-Up API Test**
  * Purpose: Tests first-time purchase/top-up flow
  * What it tests: Simulates a new user making their first purchase
  * Expected: First-time purchase is successful
* **Second Time Top-Up API Test**
  * Purpose: Tests subsequent purchase/top-up flow
  * What it tests: Simulates an existing user making additional purchases
  * Expected: Repeat purchase is successful

#### Negative Test Cases (Expected to PASS if the response contain expected result with the correct error info else FAIL)

* **Invalid UserId APITest**
  * Purpose: Tests API behavior with invalid user IDs
  * What it tests: Sends requests with non-existent or malformed user IDs
  * Expected: API should reject the request with appropriate error
* **Invalid User Validation APITest (method : topup on purpose to generate incorrect signature)**
  * Purpose: Tests validation with invalid user credentials
  * What it tests: Sends validation requests with incorrect user data
  * Expected: API should reject invalid user validation
* **Invalid SKU APITest**
  * Purpose: Tests API behavior with invalid SKU codes
  * What it tests: Sends requests with non-existent or invalid SKU identifiers
  * Expected: API should reject invalid SKU requests
* **InvalidTopUpAPITest (method : validate on purpose to generate incorrect signature)**
  * Purpose: Tests top-up flow with invalid parameters
  * What it tests: Sends top-up requests with invalid payment data
  * Expected: API should reject invalid top-up requests

#### Miscellaneous Test Cases

* **Serverlist API Test**
  * Purpose: Tests server list retrieval functionality
  * What it tests: Validates that the correct server list is returned for a given game
  * Expected: Server list contains the expected server IDs and names


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.coda.co/codashop-and-distribution/integration-guides/test-api-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
