curl --request POST \
--url https://test-api.stash.gg/sdk/server/catalog/force-refresh \
--header 'Content-Type: application/json' \
--header 'x-stash-hmac-signature: <api-key>' \
--data '
{
"playerId": "<string>",
"playerIds": [
"<string>"
]
}
'import requests
url = "https://test-api.stash.gg/sdk/server/catalog/force-refresh"
payload = {
"playerId": "<string>",
"playerIds": ["<string>"]
}
headers = {
"x-stash-hmac-signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-stash-hmac-signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({playerId: '<string>', playerIds: ['<string>']})
};
fetch('https://test-api.stash.gg/sdk/server/catalog/force-refresh', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-api.stash.gg/sdk/server/catalog/force-refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'playerId' => '<string>',
'playerIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-stash-hmac-signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://test-api.stash.gg/sdk/server/catalog/force-refresh"
payload := strings.NewReader("{\n \"playerId\": \"<string>\",\n \"playerIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-stash-hmac-signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://test-api.stash.gg/sdk/server/catalog/force-refresh")
.header("x-stash-hmac-signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"playerId\": \"<string>\",\n \"playerIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.stash.gg/sdk/server/catalog/force-refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-stash-hmac-signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"playerId\": \"<string>\",\n \"playerIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"refreshed": true
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Force refresh catalog
Refreshes a web shop’s cached catalog so the next time a player opens the shop it reflects the latest catalog from your game backend. Applies only to shops with a real-time catalog integration; for any other integration it is a no-op that still returns success. You rarely need to call it: the catalog already refreshes automatically after web shop purchases and free-gift redemptions, and checkout always revalidates against the server. It is most useful after an in-game purchase (outside the web shop) when you want the catalog view in the Web Shop to update right away. Name the players to refresh in player_ids; when several players need a refresh at the same time, send them in one request rather than one request per player.
curl --request POST \
--url https://test-api.stash.gg/sdk/server/catalog/force-refresh \
--header 'Content-Type: application/json' \
--header 'x-stash-hmac-signature: <api-key>' \
--data '
{
"playerId": "<string>",
"playerIds": [
"<string>"
]
}
'import requests
url = "https://test-api.stash.gg/sdk/server/catalog/force-refresh"
payload = {
"playerId": "<string>",
"playerIds": ["<string>"]
}
headers = {
"x-stash-hmac-signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-stash-hmac-signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({playerId: '<string>', playerIds: ['<string>']})
};
fetch('https://test-api.stash.gg/sdk/server/catalog/force-refresh', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-api.stash.gg/sdk/server/catalog/force-refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'playerId' => '<string>',
'playerIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-stash-hmac-signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://test-api.stash.gg/sdk/server/catalog/force-refresh"
payload := strings.NewReader("{\n \"playerId\": \"<string>\",\n \"playerIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-stash-hmac-signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://test-api.stash.gg/sdk/server/catalog/force-refresh")
.header("x-stash-hmac-signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"playerId\": \"<string>\",\n \"playerIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.stash.gg/sdk/server/catalog/force-refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-stash-hmac-signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"playerId\": \"<string>\",\n \"playerIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"refreshed": true
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
Versioned HMAC-SHA256 signature authenticating server-to-server SDK requests (your backend calling Stash), as opposed to client-side SDK operations. Recommended over the deprecated X-Stash-Api-Key for the best security. Header format: v1;{appId};{unixMillisTimestamp};{base64Signature} (semicolon-delimited). {base64Signature} is the base64-encoded HMAC-SHA256 of the string {unixMillisTimestamp}.{requestBody} using your app ingress secret (the ingress secret is shown base64-encoded in Studio; base64-decode it to the raw bytes used as the HMAC key), where {requestBody} is the request body exactly as you send it for POST and PUT requests (the compact canonical request JSON is also accepted) and empty for GET requests. A signature over the exact bytes verifies for bodies of up to 18 KiB (18,432 bytes); a larger body may be refused with 401 even when correctly signed. The timestamp must be within 5 minutes of Stash server time. Your appId is your immutable app identifier, shown in Stash Studio under Project Settings > App details; your ingress secret is under Project Settings > API Secrets.
Body
Deprecated: use player_ids. Refreshes the catalog of this one player; it still works, and a player_id sent alongside player_ids is refreshed too. Never leave out both player_id and player_ids unless you know exactly what you are doing: a request that names no player forces a catalog refresh for every single player of your shop, which can make the Web Shop much slower for all players across the board and cause a spike of API calls to your external catalog API server.
The players whose catalogs to refresh, at most 100 ids of 1 to 128 characters each, using printable ASCII other than spaces, double quotes and backslashes. Send every player you want refreshed in one request instead of one request per player. Each player is refreshed once however often the id repeats, and an id with no cached catalog is accepted and changes nothing. Send at least one id: a request signed with HMAC that sends an empty list is refused, and a request that leaves out both player_ids and player_id refreshes every player of your shop. A player_id sent alongside the list is refreshed too.