> 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). Agents can also search and read this documentation through its [MCP server](https://docs.coda.co/~gitbook/mcp).

# Test API Integration

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

<figure><img src="https://611292228-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl56STCN5yoV1K1MhVEvU%2Fuploads%2F9lDZvrplIpk7AGZKkieN%2FScreenshot%202025-11-09%20at%2010.06.21%E2%80%AFPM.png?alt=media&amp;token=c384051c-fa74-4198-b560-4a1c31472fde" 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="https://611292228-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl56STCN5yoV1K1MhVEvU%2Fuploads%2FZOFQPAlWg4ze9nW8vVFd%2FScreenshot%202025-11-09%20at%2010.09.28%E2%80%AFPM.png?alt=media&amp;token=8450c7cb-a9ae-4922-bacb-a7342156b6a1" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://611292228-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl56STCN5yoV1K1MhVEvU%2Fuploads%2FQ6ymvCrkZO3UhTRDbt5E%2Fe73777f-API_Sample_response%20(1).png?alt=media&amp;token=3e19a2bf-b1c4-4c78-8726-a0e7a8a24dd3" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
