PayNow

Custom Variables

Get custom variables

GEThttps://api.paynow.gg/v1/stores/{storeId}/custom-variables

Retrieves all custom variables for the specified store.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store to retrieve custom variables for.
Response
200OKCustomVariableDto[]
Show fields
created_atstringRequired
When this custom variable was created.
created_byActorDtoRequired
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer
idFlakeIdOptional
descriptionstringRequired
Description explaining what this custom variable is for. Can be shown to customers.
idFlakeIdRequired
identifierstringRequired
Unique identifier string used to reference this custom variable programmatically. Must contain only letters, numbers, underscores, and hyphens.
namestringRequired
Display name for the custom variable shown to customers.
optionsCustomVariableOptionDto[]Required
Available options for dropdown type custom variables. Empty for text and number types.
custom_variable_idFlakeIdRequired
idFlakeIdRequired
is_defaultbooleanRequired
Whether this option is selected by default when the custom variable is presented. Only one option per custom variable should be marked as default.
namestringRequired
Display name shown to customers for this option.
priceintegerRequired
Price modification when this option is selected. Interpretation depends on PriceType (fixed amount or percentage).
price_typeenumRequired
Defines how option pricing should be applied to the base product price.
Possible enum values
  • fixed

    Fixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.

  • percentage

    Percentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).

sort_orderintegerRequired
Sort order for displaying options to customers. Lower numbers appear first.
store_idFlakeIdRequired
valuestringRequired
Internal value used for product command variable replacement, without brackets.
store_idFlakeIdRequired
typeenumRequired
Defines the type of input method for a custom variable.
Possible enum values
  • dropdown

    Dropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.

  • text

    Free-form text input. Customers can enter any text value (subject to validation).

  • number

    Numeric input. Customers can enter numeric values (subject to validation).

updated_atstringOptional
When this custom variable was last updated. Null if never updated.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer
idFlakeIdOptional
value_regexstringOptional
Optional regex pattern to validate text/number input values. Only applies to text and number types. Uses RE2 syntax - does not support negative lookarounds, backreferences, or other advanced regex features.

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"
Response200
[
  {
    "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

POSThttps://api.paynow.gg/v1/stores/{storeId}/custom-variables

Creates a new custom variable for the specified store. Custom variables allow customers to provide additional input when purchasing products.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store to create the custom variable in.
Request body
identifierstringRequired
Unique identifier string for programmatic reference. Must contain only letters, numbers, underscores, and hyphens.
namestringRequired
Display name shown to customers.
optionsCustomVariableOptionRequestDto[]Required
Predefined options for dropdown-type custom variables. Required for dropdown types, ignored for text and number types. When updating, this completely replaces all existing options.
is_defaultbooleanRequired
Whether this option is selected by default. Only one option per custom variable should be marked as default.
namestringRequired
Display name shown to customers for this option.
priceintegerRequired
Price modification when this option is selected. Interpretation depends on PriceType (fixed amount or percentage). If fixed, the value is in cents, if a percentage, in permille.
price_typeenumRequired
Defines how option pricing should be applied to the base product price.
Possible enum values
  • fixed

    Fixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.

  • percentage

    Percentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).

valuestringRequired
The value the command variable will be replaced with.
idFlakeIdOptional
typeenumRequired
Defines the type of input method for a custom variable.
Possible enum values
  • dropdown

    Dropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.

  • text

    Free-form text input. Customers can enter any text value (subject to validation).

  • number

    Numeric input. Customers can enter numeric values (subject to validation).

descriptionstringOptional
Description explaining the purpose of this custom variable.
value_regexstringOptional
Optional regex pattern for validating customer input. Only applies to text and number types. Ignored for dropdown types.
Response
200OKCustomVariableDto
Show fields
created_atstringRequired
When this custom variable was created.
created_byActorDtoRequired
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer
idFlakeIdOptional
descriptionstringRequired
Description explaining what this custom variable is for. Can be shown to customers.
idFlakeIdRequired
identifierstringRequired
Unique identifier string used to reference this custom variable programmatically. Must contain only letters, numbers, underscores, and hyphens.
namestringRequired
Display name for the custom variable shown to customers.
optionsCustomVariableOptionDto[]Required
Available options for dropdown type custom variables. Empty for text and number types.
custom_variable_idFlakeIdRequired
idFlakeIdRequired
is_defaultbooleanRequired
Whether this option is selected by default when the custom variable is presented. Only one option per custom variable should be marked as default.
namestringRequired
Display name shown to customers for this option.
priceintegerRequired
Price modification when this option is selected. Interpretation depends on PriceType (fixed amount or percentage).
price_typeenumRequired
Defines how option pricing should be applied to the base product price.
Possible enum values
  • fixed

    Fixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.

  • percentage

    Percentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).

sort_orderintegerRequired
Sort order for displaying options to customers. Lower numbers appear first.
store_idFlakeIdRequired
valuestringRequired
Internal value used for product command variable replacement, without brackets.
store_idFlakeIdRequired
typeenumRequired
Defines the type of input method for a custom variable.
Possible enum values
  • dropdown

    Dropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.

  • text

    Free-form text input. Customers can enter any text value (subject to validation).

  • number

    Numeric input. Customers can enter numeric values (subject to validation).

updated_atstringOptional
When this custom variable was last updated. Null if never updated.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer
idFlakeIdOptional
value_regexstringOptional
Optional regex pattern to validate text/number input values. Only applies to text and number types. Uses RE2 syntax - does not support negative lookarounds, backreferences, or other advanced regex features.

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"
}'
Response200
{
  "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

GEThttps://api.paynow.gg/v1/stores/{storeId}/custom-variables/{customVariableId}

Retrieves a specific custom variable by ID from the specified store.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the custom variable belongs to.
customVariableIdFlakeIdRequired
The ID of the custom variable to retrieve.
Response
200OKCustomVariableDto
Show fields
created_atstringRequired
When this custom variable was created.
created_byActorDtoRequired
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer
idFlakeIdOptional
descriptionstringRequired
Description explaining what this custom variable is for. Can be shown to customers.
idFlakeIdRequired
identifierstringRequired
Unique identifier string used to reference this custom variable programmatically. Must contain only letters, numbers, underscores, and hyphens.
namestringRequired
Display name for the custom variable shown to customers.
optionsCustomVariableOptionDto[]Required
Available options for dropdown type custom variables. Empty for text and number types.
custom_variable_idFlakeIdRequired
idFlakeIdRequired
is_defaultbooleanRequired
Whether this option is selected by default when the custom variable is presented. Only one option per custom variable should be marked as default.
namestringRequired
Display name shown to customers for this option.
priceintegerRequired
Price modification when this option is selected. Interpretation depends on PriceType (fixed amount or percentage).
price_typeenumRequired
Defines how option pricing should be applied to the base product price.
Possible enum values
  • fixed

    Fixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.

  • percentage

    Percentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).

sort_orderintegerRequired
Sort order for displaying options to customers. Lower numbers appear first.
store_idFlakeIdRequired
valuestringRequired
Internal value used for product command variable replacement, without brackets.
store_idFlakeIdRequired
typeenumRequired
Defines the type of input method for a custom variable.
Possible enum values
  • dropdown

    Dropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.

  • text

    Free-form text input. Customers can enter any text value (subject to validation).

  • number

    Numeric input. Customers can enter numeric values (subject to validation).

updated_atstringOptional
When this custom variable was last updated. Null if never updated.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer
idFlakeIdOptional
value_regexstringOptional
Optional regex pattern to validate text/number input values. Only applies to text and number types. Uses RE2 syntax - does not support negative lookarounds, backreferences, or other advanced regex features.

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"
Response200
{
  "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

PATCHhttps://api.paynow.gg/v1/stores/{storeId}/custom-variables/{customVariableId}

Performs a partial update of a custom variable using field mask. Only the fields specified in the request will be updated.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the custom variable belongs to.
customVariableIdFlakeIdRequired
The ID of the custom variable to update.
Request body
identifierstringRequired
Unique identifier string for programmatic reference. Must contain only letters, numbers, underscores, and hyphens.
namestringRequired
Display name shown to customers.
optionsCustomVariableOptionRequestDto[]Required
Predefined options for dropdown-type custom variables. Required for dropdown types, ignored for text and number types. When updating, this completely replaces all existing options.
is_defaultbooleanRequired
Whether this option is selected by default. Only one option per custom variable should be marked as default.
namestringRequired
Display name shown to customers for this option.
priceintegerRequired
Price modification when this option is selected. Interpretation depends on PriceType (fixed amount or percentage). If fixed, the value is in cents, if a percentage, in permille.
price_typeenumRequired
Defines how option pricing should be applied to the base product price.
Possible enum values
  • fixed

    Fixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.

  • percentage

    Percentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).

valuestringRequired
The value the command variable will be replaced with.
idFlakeIdOptional
typeenumRequired
Defines the type of input method for a custom variable.
Possible enum values
  • dropdown

    Dropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.

  • text

    Free-form text input. Customers can enter any text value (subject to validation).

  • number

    Numeric input. Customers can enter numeric values (subject to validation).

descriptionstringOptional
Description explaining the purpose of this custom variable.
value_regexstringOptional
Optional regex pattern for validating customer input. Only applies to text and number types. Ignored for dropdown types.
Response
200OKCustomVariableDto
Show fields
created_atstringRequired
When this custom variable was created.
created_byActorDtoRequired
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer
idFlakeIdOptional
descriptionstringRequired
Description explaining what this custom variable is for. Can be shown to customers.
idFlakeIdRequired
identifierstringRequired
Unique identifier string used to reference this custom variable programmatically. Must contain only letters, numbers, underscores, and hyphens.
namestringRequired
Display name for the custom variable shown to customers.
optionsCustomVariableOptionDto[]Required
Available options for dropdown type custom variables. Empty for text and number types.
custom_variable_idFlakeIdRequired
idFlakeIdRequired
is_defaultbooleanRequired
Whether this option is selected by default when the custom variable is presented. Only one option per custom variable should be marked as default.
namestringRequired
Display name shown to customers for this option.
priceintegerRequired
Price modification when this option is selected. Interpretation depends on PriceType (fixed amount or percentage).
price_typeenumRequired
Defines how option pricing should be applied to the base product price.
Possible enum values
  • fixed

    Fixed amount added to or subtracted from the base price. Price value represents the exact amount in the smallest currency unit.

  • percentage

    Percentage modification of the base price. Price value represents the percentage (e.g., 150 = 1.5% increase).

sort_orderintegerRequired
Sort order for displaying options to customers. Lower numbers appear first.
store_idFlakeIdRequired
valuestringRequired
Internal value used for product command variable replacement, without brackets.
store_idFlakeIdRequired
typeenumRequired
Defines the type of input method for a custom variable.
Possible enum values
  • dropdown

    Dropdown selection with predefined options. Customers choose from a list of available options. Allows for additional pricing based on the selected entry.

  • text

    Free-form text input. Customers can enter any text value (subject to validation).

  • number

    Numeric input. Customers can enter numeric values (subject to validation).

updated_atstringOptional
When this custom variable was last updated. Null if never updated.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer
idFlakeIdOptional
value_regexstringOptional
Optional regex pattern to validate text/number input values. Only applies to text and number types. Uses RE2 syntax - does not support negative lookarounds, backreferences, or other advanced regex features.

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"
}'
Response200
{
  "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

DELETEhttps://api.paynow.gg/v1/stores/{storeId}/custom-variables/{customVariableId}

Deletes a custom variable from the specified store. This will also delete all associated options and cannot be undone.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store the custom variable belongs to.
customVariableIdFlakeIdRequired
The ID of the custom variable to delete.
Response
204No Content

Failed requests return a PayNowError body. See the error response guide.

curl -X DELETE "https://api.paynow.gg/v1/stores/{storeId}/custom-variables/{customVariableId}" \
  -H "Authorization: APIKey TOKEN"