> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.wuzzlo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.wuzzlo.com/_mcp/server.

# Get player balance

POST /balance
Content-Type: application/json

Wuzzlo to Operator. Verify the Wuzzlo signature and return the current balance without mutation. Return exactly OP_SUCCESS for a valid user, OP_USER_NOT_FOUND for a missing user, or OP_INVALID_OPERATOR for an invalid operator.

Reference: https://docs.wuzzlo.com/wuzzlo/wuzzlo-to-operator/get-player-balance

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /balance:
    post:
      operationId: getPlayerBalance
      summary: Get player balance
      description: >-
        Wuzzlo to Operator. Verify the Wuzzlo signature and return the current
        balance without mutation. Return exactly OP_SUCCESS for a valid user,
        OP_USER_NOT_FOUND for a missing user, or OP_INVALID_OPERATOR for an
        invalid operator.
      tags:
        - wuzzloToOperator
      parameters:
        - name: Signature
          in: header
          description: >-
            Wuzzlo-to-Operator: Base64 RSA-SHA256 PKCS#1 v1.5 signature of the
            exact UTF-8 JSON body, verified with the Wuzzlo public key.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            HTTP 200 wallet response. The body status MUST match exactly one
            documented scenario requirement; statuses are not interchangeable.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Wuzzlo to
                  Operator_getPlayerBalance_Response_200
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BalanceRequest'
components:
  schemas:
    BalanceRequest:
      type: object
      properties:
        operatorId:
          type: string
        token:
          type: string
          description: Operator session token validated through /auth/login.
        userId:
          type: string
      required:
        - operatorId
        - token
        - userId
      title: BalanceRequest
    BalancePostResponsesContentApplicationJsonSchemaStatus:
      type: string
      enum:
        - OP_SUCCESS
        - OP_USER_NOT_FOUND
        - OP_INVALID_OPERATOR
      description: >-
        Exact business status required by the matched endpoint scenario. A
        different status is a contract failure even when the returned balance is
        correct.
      title: BalancePostResponsesContentApplicationJsonSchemaStatus
    Wuzzlo to Operator_getPlayerBalance_Response_200:
      type: object
      properties:
        balance:
          type: number
          format: double
          description: >-
            Balance returned for this response scenario. Successful mutations
            return the calculated post-transaction balance; duplicate and
            rejected scenarios return the unchanged balance.
        status:
          $ref: >-
            #/components/schemas/BalancePostResponsesContentApplicationJsonSchemaStatus
          description: >-
            Exact business status required by the matched endpoint scenario. A
            different status is a contract failure even when the returned
            balance is correct.
      required:
        - balance
        - status
      title: Wuzzlo to Operator_getPlayerBalance_Response_200
  securitySchemes:
    WuzzloSignature:
      type: apiKey
      in: header
      name: Signature
      description: >-
        Wuzzlo-to-Operator: Base64 RSA-SHA256 PKCS#1 v1.5 signature of the exact
        UTF-8 JSON body, verified with the Wuzzlo public key.

```

## Examples

### Seeded user 1001



**Request**

```json
{
  "operatorId": "string",
  "token": "string",
  "userId": "string"
}
```

**Response**

```json
{
  "balance": 50000,
  "status": "OP_SUCCESS"
}
```

**SDK Code**

```python Seeded user 1001
import requests

url = "https://api.example.com/balance"

payload = {
    "operatorId": "string",
    "token": "string",
    "userId": "string"
}
headers = {
    "Signature": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Seeded user 1001
const url = 'https://api.example.com/balance';
const options = {
  method: 'POST',
  headers: {Signature: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"operatorId":"string","token":"string","userId":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Seeded user 1001
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/balance"

	payload := strings.NewReader("{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Signature", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Seeded user 1001
require 'uri'
require 'net/http'

url = URI("https://api.example.com/balance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Signature"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java Seeded user 1001
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/balance")
  .header("Signature", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}")
  .asString();
```

```php Seeded user 1001
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/balance', [
  'body' => '{
  "operatorId": "string",
  "token": "string",
  "userId": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'Signature' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Seeded user 1001
using RestSharp;

var client = new RestClient("https://api.example.com/balance");
var request = new RestRequest(Method.POST);
request.AddHeader("Signature", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Seeded user 1001
import Foundation

let headers = [
  "Signature": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "operatorId": "string",
  "token": "string",
  "userId": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/balance")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### User missing



**Request**

```json
{
  "operatorId": "string",
  "token": "string",
  "userId": "string"
}
```

**Response**

```json
{
  "balance": 0,
  "status": "OP_USER_NOT_FOUND"
}
```

**SDK Code**

```python User missing
import requests

url = "https://api.example.com/balance"

payload = {
    "operatorId": "string",
    "token": "string",
    "userId": "string"
}
headers = {
    "Signature": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript User missing
const url = 'https://api.example.com/balance';
const options = {
  method: 'POST',
  headers: {Signature: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"operatorId":"string","token":"string","userId":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go User missing
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/balance"

	payload := strings.NewReader("{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Signature", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby User missing
require 'uri'
require 'net/http'

url = URI("https://api.example.com/balance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Signature"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java User missing
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/balance")
  .header("Signature", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}")
  .asString();
```

```php User missing
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/balance', [
  'body' => '{
  "operatorId": "string",
  "token": "string",
  "userId": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'Signature' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp User missing
using RestSharp;

var client = new RestClient("https://api.example.com/balance");
var request = new RestRequest(Method.POST);
request.AddHeader("Signature", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift User missing
import Foundation

let headers = [
  "Signature": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "operatorId": "string",
  "token": "string",
  "userId": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/balance")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Operator mismatch



**Request**

```json
{
  "operatorId": "string",
  "token": "string",
  "userId": "string"
}
```

**Response**

```json
{
  "balance": 0,
  "status": "OP_INVALID_OPERATOR"
}
```

**SDK Code**

```python Operator mismatch
import requests

url = "https://api.example.com/balance"

payload = {
    "operatorId": "string",
    "token": "string",
    "userId": "string"
}
headers = {
    "Signature": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Operator mismatch
const url = 'https://api.example.com/balance';
const options = {
  method: 'POST',
  headers: {Signature: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"operatorId":"string","token":"string","userId":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Operator mismatch
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/balance"

	payload := strings.NewReader("{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Signature", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Operator mismatch
require 'uri'
require 'net/http'

url = URI("https://api.example.com/balance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Signature"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java Operator mismatch
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/balance")
  .header("Signature", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}")
  .asString();
```

```php Operator mismatch
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/balance', [
  'body' => '{
  "operatorId": "string",
  "token": "string",
  "userId": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'Signature' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Operator mismatch
using RestSharp;

var client = new RestClient("https://api.example.com/balance");
var request = new RestRequest(Method.POST);
request.AddHeader("Signature", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"operatorId\": \"string\",\n  \"token\": \"string\",\n  \"userId\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Operator mismatch
import Foundation

let headers = [
  "Signature": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "operatorId": "string",
  "token": "string",
  "userId": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/balance")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```