Custom Variables
Get custom variables
Retrieves all custom variables for the specified store.
Authorization: APIKey TOKEN.Show fieldsHide fields
created_byActorDtoRequired
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
optionsCustomVariableOptionDto[]RequiredAvailable options for dropdown type custom variables.
Empty for text and number types.
fixedFixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.
percentagePercentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).
dropdownDropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.
textFree-form text input. Customers can enter any text value (subject to validation).
numberNumeric input. Customers can enter numeric values (subject to validation).
updated_byActorDtoOptional
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/custom-variables" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.customVariables.getCustomVariablesForStore();import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/custom-variables", headers=headers)[
{
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"description": "string",
"id": "411486491630370816",
"identifier": "string",
"name": "string",
"options": [
{
"custom_variable_id": "411486491630370816",
"id": "411486491630370816",
"is_default": true,
"name": "string",
"price": 0,
"price_type": "fixed",
"sort_order": 0,
"store_id": "411486491630370816",
"value": "string"
}
],
"store_id": "411486491630370816",
"type": "dropdown",
"value_regex": "string",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z"
}
]Create custom variable
Creates a new custom variable for the specified store. Custom variables allow customers to provide additional input when purchasing products.
Authorization: APIKey TOKEN.optionsCustomVariableOptionRequestDto[]RequiredPredefined options for dropdown-type custom variables.
Required for dropdown types, ignored for text and number types.
When updating, this completely replaces all existing options.
fixedFixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.
percentagePercentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).
dropdownDropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.
textFree-form text input. Customers can enter any text value (subject to validation).
numberNumeric input. Customers can enter numeric values (subject to validation).
Show fieldsHide fields
created_byActorDtoRequired
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
optionsCustomVariableOptionDto[]RequiredAvailable options for dropdown type custom variables.
Empty for text and number types.
fixedFixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.
percentagePercentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).
dropdownDropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.
textFree-form text input. Customers can enter any text value (subject to validation).
numberNumeric input. Customers can enter numeric values (subject to validation).
updated_byActorDtoOptional
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
Failed requests return a PayNowError body. See the error response guide.
curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/custom-variables" \
-H "Authorization: APIKey TOKEN" \
-H "Content-Type: application/json" \
-d '{
"identifier": "string",
"name": "string",
"options": [
{
"is_default": true,
"name": "string",
"price": 0,
"price_type": "fixed",
"value": "string",
"id": "411486491630370816"
}
],
"type": "dropdown",
"description": "string",
"value_regex": "string"
}'import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.customVariables.createCustomVariableForStore({
identifier: "string",
name: "string",
options: [
{
is_default: true,
name: "string",
price: 0,
price_type: "fixed",
value: "string",
id: "411486491630370816",
},
],
type: "dropdown",
description: "string",
value_regex: "string",
});import requests
headers = {"Authorization": "APIKey TOKEN"}
payload = {
"identifier": "string",
"name": "string",
"options": [
{
"is_default": True,
"name": "string",
"price": 0,
"price_type": "fixed",
"value": "string",
"id": "411486491630370816",
},
],
"type": "dropdown",
"description": "string",
"value_regex": "string",
}
response = requests.post("https://api.paynow.gg/v1/stores/{storeId}/custom-variables", headers=headers, json=payload){
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"description": "string",
"id": "411486491630370816",
"identifier": "string",
"name": "string",
"options": [
{
"custom_variable_id": "411486491630370816",
"id": "411486491630370816",
"is_default": true,
"name": "string",
"price": 0,
"price_type": "fixed",
"sort_order": 0,
"store_id": "411486491630370816",
"value": "string"
}
],
"store_id": "411486491630370816",
"type": "dropdown",
"value_regex": "string",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z"
}Get custom variable
Retrieves a specific custom variable by ID from the specified store.
Authorization: APIKey TOKEN.Show fieldsHide fields
created_byActorDtoRequired
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
optionsCustomVariableOptionDto[]RequiredAvailable options for dropdown type custom variables.
Empty for text and number types.
fixedFixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.
percentagePercentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).
dropdownDropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.
textFree-form text input. Customers can enter any text value (subject to validation).
numberNumeric input. Customers can enter numeric values (subject to validation).
updated_byActorDtoOptional
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/custom-variables/{customVariableId}" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.customVariables.getCustomVariableByIdForStore("411486491630370816");import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/custom-variables/{customVariableId}", headers=headers){
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"description": "string",
"id": "411486491630370816",
"identifier": "string",
"name": "string",
"options": [
{
"custom_variable_id": "411486491630370816",
"id": "411486491630370816",
"is_default": true,
"name": "string",
"price": 0,
"price_type": "fixed",
"sort_order": 0,
"store_id": "411486491630370816",
"value": "string"
}
],
"store_id": "411486491630370816",
"type": "dropdown",
"value_regex": "string",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z"
}Update custom variable
Performs a partial update of a custom variable using field mask. Only the fields specified in the request will be updated.
Authorization: APIKey TOKEN.optionsCustomVariableOptionRequestDto[]RequiredPredefined options for dropdown-type custom variables.
Required for dropdown types, ignored for text and number types.
When updating, this completely replaces all existing options.
fixedFixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.
percentagePercentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).
dropdownDropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.
textFree-form text input. Customers can enter any text value (subject to validation).
numberNumeric input. Customers can enter numeric values (subject to validation).
Show fieldsHide fields
created_byActorDtoRequired
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
optionsCustomVariableOptionDto[]RequiredAvailable options for dropdown type custom variables.
Empty for text and number types.
fixedFixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.
percentagePercentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).
dropdownDropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.
textFree-form text input. Customers can enter any text value (subject to validation).
numberNumeric input. Customers can enter numeric values (subject to validation).
updated_byActorDtoOptional
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
Failed requests return a PayNowError body. See the error response guide.
curl -X PATCH "https://api.paynow.gg/v1/stores/{storeId}/custom-variables/{customVariableId}" \
-H "Authorization: APIKey TOKEN" \
-H "Content-Type: application/json" \
-d '{
"identifier": "string",
"name": "string",
"options": [
{
"is_default": true,
"name": "string",
"price": 0,
"price_type": "fixed",
"value": "string",
"id": "411486491630370816"
}
],
"type": "dropdown",
"description": "string",
"value_regex": "string"
}'import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.customVariables.updateCustomVariableForStore("411486491630370816", {
identifier: "string",
name: "string",
options: [
{
is_default: true,
name: "string",
price: 0,
price_type: "fixed",
value: "string",
id: "411486491630370816",
},
],
type: "dropdown",
description: "string",
value_regex: "string",
});import requests
headers = {"Authorization": "APIKey TOKEN"}
payload = {
"identifier": "string",
"name": "string",
"options": [
{
"is_default": True,
"name": "string",
"price": 0,
"price_type": "fixed",
"value": "string",
"id": "411486491630370816",
},
],
"type": "dropdown",
"description": "string",
"value_regex": "string",
}
response = requests.patch("https://api.paynow.gg/v1/stores/{storeId}/custom-variables/{customVariableId}", headers=headers, json=payload){
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"description": "string",
"id": "411486491630370816",
"identifier": "string",
"name": "string",
"options": [
{
"custom_variable_id": "411486491630370816",
"id": "411486491630370816",
"is_default": true,
"name": "string",
"price": 0,
"price_type": "fixed",
"sort_order": 0,
"store_id": "411486491630370816",
"value": "string"
}
],
"store_id": "411486491630370816",
"type": "dropdown",
"value_regex": "string",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z"
}Delete custom variable
Deletes a custom variable from the specified store. This will also delete all associated options and cannot be undone.
Authorization: APIKey TOKEN.curl -X DELETE "https://api.paynow.gg/v1/stores/{storeId}/custom-variables/{customVariableId}" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
await paynow.customVariables.deleteCustomVariableForStore("411486491630370816");import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.delete("https://api.paynow.gg/v1/stores/{storeId}/custom-variables/{customVariableId}", headers=headers)