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

# Validate top-up

POST https://v1/api/pos/countries/EC/wallets/topups/validate
Content-Type: application/json

# Validate top-up (FR30)

Does **not** move money. No `Idempotency-Key`. Check `userRef`, amount, currency, and partner prepaid float. Does **not** return player balance.

**Body**

| Field            | Required | Description                                                |
| ---------------- | -------- | ---------------------------------------------------------- |
| userRef          | yes      | Linked portal user (issued id, MSISDN, or email as agreed) |
| amount           | yes      | Major units, pattern `^[0-9]+(\\.[0-9]{1,2})?$`            |
| currency         | yes      | ISO 4217, must match country                               |
| partnerReference | no       | Till/shift reference                                       |

**200:** `payable: true`, echo of userRef/amount/currency, `countryId`, `partnerPrepaidRemaining` (informational).

**Business errors:** `user-not-found`, `user-not-linked`, `amount-out-of-range`, `insufficient-partner-float`, `currency-mismatch`.

## Authentication (AND, not OR)

Required together on this request:

* `X-Lucky-Tom-Partner-Id` = `{{partnerId}}`
* `Authorization: Bearer {{clientSecret}}` (static `client_secret`, not OAuth)
* `X-Lucky-Tom-Timestamp` and `X-Lucky-Tom-Signature` — visible as placeholders; the collection Pre-request Script overwrites them on Send using `hmacSecretKey`

Canonical string: `{METHOD}\n{pathAndQuery}\n{timestamp}\n{sha256HexOfRawBody}`. Empty body hash: `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`. Skew ±5 minutes.

| HTTP | type             | Meaning                            |
| ---- | ---------------- | ---------------------------------- |
| 401  | unauthorized     | Identity failed                    |
| 422  | hmac-invalid     | Missing/wrong signature            |
| 422  | hmac-skew        | Clock off by > 5 minutes           |
| 403  | country-mismatch | `{countryId}` ≠ credential country |

See the **Authentication** folder for the worked HMAC example.

Reference: https://pos-api-docs.lucky-tom.com/lucky-tom-pos-api/wallets/top-ups/validate-top-up

## Request

### Headers

- `X-Lucky-Tom-Partner-Id` (string, optional) — Public partner id. Required (AND). Not a secret.
- `X-Lucky-Tom-Timestamp` (string, optional) — Unix time in milliseconds. Required (AND). Collection Pre-request Script overwrites this on Send.
- `X-Lucky-Tom-Signature` (string, optional) — HMAC-SHA256 hex of METHOD + pathAndQuery + timestamp + sha256(body). Required (AND). Overwritten on Send.

### Body (application/json)

This endpoint expects an object.

- `amount` (string, required)
- `userRef` (string, required)
- `currency` (string, required)

## Response

### 200

OK

- `amount` (string, required)
- `payable` (boolean, required)
- `userRef` (string, required)
- `currency` (string, required)
- `countryId` (string, required)
- `partnerPrepaidRemaining` (string, required)

## Errors

### 401 Unauthorized Error

Unauthorized

- `type` (string, required)
- `title` (string, required)
- `detail` (string, required)
- `status` (integer, required)

### 422 Unprocessable Entity Error

Unprocessable Entity

- `type` (string, required)
- `title` (string, required)
- `detail` (string, required)
- `status` (integer, required)

## Examples

**Request**

```json
{
  "amount": "10.00",
  "userRef": "usr_ec_1842",
  "currency": "USD"
}
```

**Response**

```json
{
  "amount": "10.00",
  "payable": true,
  "userRef": "usr_ec_1842",
  "currency": "USD",
  "countryId": "EC",
  "partnerPrepaidRemaining": "1500.00"
}
```

**SDK Code**

```python Wallets_Top ups_Validate top-up_example
import requests

url = "https://https/v1/api/pos/countries/EC/wallets/topups/validate"

payload = {
    "amount": "10.00",
    "userRef": "usr_ec_1842",
    "currency": "USD"
}
headers = {
    "X-Lucky-Tom-Partner-Id": "{{partnerId}}",
    "X-Lucky-Tom-Signature": "set-by-pre-request",
    "X-Lucky-Tom-Timestamp": "set-by-pre-request",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Wallets_Top ups_Validate top-up_example
const url = 'https://https/v1/api/pos/countries/EC/wallets/topups/validate';
const options = {
  method: 'POST',
  headers: {
    'X-Lucky-Tom-Partner-Id': '{{partnerId}}',
    'X-Lucky-Tom-Signature': 'set-by-pre-request',
    'X-Lucky-Tom-Timestamp': 'set-by-pre-request',
    'Content-Type': 'application/json'
  },
  body: '{"amount":"10.00","userRef":"usr_ec_1842","currency":"USD"}'
};

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

```go Wallets_Top ups_Validate top-up_example
package main

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

func main() {

	url := "https://https/v1/api/pos/countries/EC/wallets/topups/validate"

	payload := strings.NewReader("{\n  \"amount\": \"10.00\",\n  \"userRef\": \"usr_ec_1842\",\n  \"currency\": \"USD\"\n}")

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

	req.Header.Add("X-Lucky-Tom-Partner-Id", "{{partnerId}}")
	req.Header.Add("X-Lucky-Tom-Signature", "set-by-pre-request")
	req.Header.Add("X-Lucky-Tom-Timestamp", "set-by-pre-request")
	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 Wallets_Top ups_Validate top-up_example
require 'uri'
require 'net/http'

url = URI("https://https/v1/api/pos/countries/EC/wallets/topups/validate")

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

request = Net::HTTP::Post.new(url)
request["X-Lucky-Tom-Partner-Id"] = '{{partnerId}}'
request["X-Lucky-Tom-Signature"] = 'set-by-pre-request'
request["X-Lucky-Tom-Timestamp"] = 'set-by-pre-request'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"amount\": \"10.00\",\n  \"userRef\": \"usr_ec_1842\",\n  \"currency\": \"USD\"\n}"

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

```java Wallets_Top ups_Validate top-up_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/v1/api/pos/countries/EC/wallets/topups/validate")
  .header("X-Lucky-Tom-Partner-Id", "{{partnerId}}")
  .header("X-Lucky-Tom-Signature", "set-by-pre-request")
  .header("X-Lucky-Tom-Timestamp", "set-by-pre-request")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": \"10.00\",\n  \"userRef\": \"usr_ec_1842\",\n  \"currency\": \"USD\"\n}")
  .asString();
```

```php Wallets_Top ups_Validate top-up_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/v1/api/pos/countries/EC/wallets/topups/validate', [
  'body' => '{
  "amount": "10.00",
  "userRef": "usr_ec_1842",
  "currency": "USD"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Lucky-Tom-Partner-Id' => '{{partnerId}}',
    'X-Lucky-Tom-Signature' => 'set-by-pre-request',
    'X-Lucky-Tom-Timestamp' => 'set-by-pre-request',
  ],
]);

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

```csharp Wallets_Top ups_Validate top-up_example
using RestSharp;

var client = new RestClient("https://https/v1/api/pos/countries/EC/wallets/topups/validate");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Lucky-Tom-Partner-Id", "{{partnerId}}");
request.AddHeader("X-Lucky-Tom-Signature", "set-by-pre-request");
request.AddHeader("X-Lucky-Tom-Timestamp", "set-by-pre-request");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": \"10.00\",\n  \"userRef\": \"usr_ec_1842\",\n  \"currency\": \"USD\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Wallets_Top ups_Validate top-up_example
import Foundation

let headers = [
  "X-Lucky-Tom-Partner-Id": "{{partnerId}}",
  "X-Lucky-Tom-Signature": "set-by-pre-request",
  "X-Lucky-Tom-Timestamp": "set-by-pre-request",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": "10.00",
  "userRef": "usr_ec_1842",
  "currency": "USD"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://https/v1/api/pos/countries/EC/wallets/topups/validate")! 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()
```