Product
Products are what your customers see when they visit your store. They have a name, price, thumbnail, and many other properties you can use to enhance your store's display.
Any time you edit a product's name, price, or other settings, it assigns the product a new version_id
.
This is used to preserve the historical configurations of the product when used in command delivery and subscription renewals.
To access product information using a customer token, use the Storefront Product API.
The Product object
Fields
- Name
id
- Type
- flake
- Tags
- Description
id of the product
- Name
store_id
- Type
- flake
- Tags
- Description
id of the store the product belongs to
- Name
version_id
- Type
- flake
- Tags
- Description
id for the version of the product
- Name
image_url
- Type
- string
- Tags
- NULLABLE
- Description
the url for the product image
- Name
slug
- Type
- string
- Tags
- Description
the url-safe identifier for the product, unique to the store
- Name
name
- Type
- string
- Tags
- Description
the name of the product
- Name
description
- Type
- string
- Tags
- Description
the full-length description of the product. This can be in any format the store prefers.
- Name
price
- Type
- integer
- Tags
- Description
the price of this product in zero-decimal format (where "$10.00" is
1000
)
- Name
allow_one_time_purchase
- Type
- boolean
- Tags
- Description
whether this product can be purchased one time (without subscribing)
- Name
allow_subscription
- Type
- boolean
- Tags
- Description
whether this product can be subscribed to
- Name
subscription_interval_value
- Type
- integer
- Tags
- Description
the interval value at which this product will renew when subscribed
- Name
subscription_interval_scale
- Type
- enum
- Tags
- Description
the interval scale at which this product will renew when subscribed.
Allowed enum valuesday
week
month
year
- Name
remove_after_enabled
- Type
- boolean
- Tags
- Description
whether this product should be auto-removed from the customer's inventory after the configured time.
- Name
remove_after_time_value
- Type
- integer
- Tags
- Description
the time value at which this product will be removed
- Name
remove_after_time_scale
- Type
- enum
- Tags
- Description
the time scale at which this product will be automatically removed.
Allowed enum valuesday
week
month
year
- Name
store_stock_limit
- Type
- stock limit
- Tags
- Description
the stock configuration for this product. The configured limits are applied across the entire store.
- Name
customer_stock_limit
- Type
- stock limit
- Tags
- Description
the stock configuration for this product. The configured limits are applied to one customer.
- Name
stock_limit_do_not_include_removed
- Type
- boolean
- Tags
- Description
whether the stock limiter should not include items that have been removed from a customer's inventory. If this is
false
, then the stock limiter will increase the available stock when an item expires.
- Name
tags
- Type
- []partial tag
- Tags
- Description
an array of tags used to describe this product
- Name
gameservers
- Type
- []partial game server
- Tags
- Description
an array of game servers that this product's commands should run on
- Name
commands
- Type
- []product command
- Tags
- Description
an array of game servers that this product's commands should run on
- Name
created_by
- Type
- user
- Tags
- Description
the user that created this product.
- Name
created_at
- Type
- timestamp
- Tags
- Description
timestamp of when the product was created
- Name
updated_by
- Type
- user
- Tags
- NULLABLE
- Description
the user that most recently updated this product.
- Name
updated_at
- Type
- timestamp
- Tags
- NULLABLE
- Description
timestamp of when the product was last updated
Stock Limit Structure
Stock Limits can apply at the store and customer level. When applied at the store level, the limit is enforced for all customers. At the customer level, it is applied to just one customer.
The values can be understood in the following sentence:
"Limit the store's stock to 500 units every 2 weeks"
[enabled: true] [quantity: 500] [time_value: 2] [time_scale: weeks]
Fields
- Name
enabled
- Type
- boolean
- Tags
- Description
whether the limit is enabled
- Name
quantity
- Type
- integer
- Tags
- Description
the number of units to be made available
- Name
time_value
- Type
- integer
- Tags
- Description
the time value used for the stock limit
- Name
time_scale
- Type
- enum
- Tags
- Description
the time scale at which this product will be limited.
Allowed enum valuesday
week
month
year
Partial Tag Structure
Contains a partial set fields that refer to a tag
Fields
- Name
id
- Type
- flake
- Tags
- Description
id of the tag
- Name
slug
- Type
- string
- Tags
- Description
the url-safe identifier for the tag, unique to the store
- Name
name
- Type
- string
- Tags
- Description
the name the tag
Partial Game Server Structure
Contains a partial set fields that refer to a game server
Fields
- Name
id
- Type
- flake
- Tags
- Description
id of the game server
- Name
name
- Type
- string
- Tags
- Description
the name the game server
Product Command Structure
Contains information about a command. Commands are executed at different stages of the product's lifecycle.
Fields
- Name
stage
- Type
- enum
- Tags
- Description
the stage when this command should run.
Allowed enum valuesruns when the product gets added to the customer's inventoryon_purchase
runs when the product is removed from the customer's inventoryon_expire
runs when a subscription to this product renewson_renew
runs when this product is refundedon_refund
runs when the customer initiates a chargeback on the original purchaseon_chargeback
- Name
content
- Type
- string
- Tags
- Description
the content of the command. Can be replaced with variable templating.
- Name
online_only
- Type
- boolean
- Tags
- Description
indicates whether the command should be only executed if the customer is online
The Product object
{
"id": "150519474611560448",
"store_id": "94688451781206016",
"version_id": "150519521570988032",
"image_url": "https://example.paynow.gg/product-image.webp",
"slug": "blender",
"name": "Blender",
"description": "A blender. It blends stuff.",
"price": 23499,
"allow_one_time_purchase": true,
"allow_subscription": true,
"subscription_interval_value": 1,
"subscription_interval_scale": "month",
"remove_after_enabled": true,
"remove_after_time_value": 1,
"remove_after_time_scale": "month",
"store_stock_limit": {
"enabled": true,
"quantity": 500,
"time_value": 1,
"time_scale": "month"
},
"customer_stock_limit": {
"enabled": true,
"quantity": 1,
"time_value": 1,
"time_scale": "day"
},
"stock_limit_do_not_include_removed": true,
"tags": [
{
"id": "124248382326706176",
"slug": "food",
"name": "Food"
}
],
"gameservers": [
{
"id": "108003582208380928",
"name": "test"
}
],
"commands": [
{
"stage": "on_purchase",
"content": "give {customer.steam.id} 1 blender",
"online_only": true
},
{
"stage": "on_expire",
"content": "give {customer.steam.id} 1 blender",
"online_only": false
}
],
"created_by": {
"id": "11084680073842688",
"first_name": "Example",
"last_name": "Exampleson"
},
"created_at": "2023-04-14T06:53:01.265316Z",
"updated_by": {
"id": "11084680073842688",
"first_name": "Example",
"last_name": "Exampleson"
},
"updated_at": "2023-04-14T06:53:12.460717Z"
}
Create Product
Creates a new product.
Parameters
- Name
slug
- Type
- string?
- Tags
- OPTIONAL
- Description
the url-safe slug used to identify this product (3 - 36 characters). Must be unique to the store. Spaces will be converted to dashes, and all disallowed characters will be stripped. If left null, this will be auto generated from
name
.
- Name
name
- Type
- string
- Tags
- REQUIRED
- Description
the name of the product (1 - 42 characters)
- Name
description
- Type
- string
- Tags
- REQUIRED
- Description
the description of the product (1 - 50,000 characters) This can be in any format your store prefers, such as
text
,html
, etc.
- Name
price
- Type
- integer
- Tags
- REQUIRED
- Description
the price for this product. Prices are in zero-decimal format (where $10.00 is
1000
).Price must be exactly
0
(free), or between50
($0.50) and500000
($5,000.00)
- Name
allow_one_time_purchase
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether this product can be purchased one time (without subscribing)
- Name
allow_subscription
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether this product can be subscribed to
- Name
subscription_interval_value
- Type
- integer?
- Tags
- OPTIONAL
- Description
the interval value at which this product will renew when subscribed
- Name
subscription_interval_scale
- Type
- enum?
- Tags
- OPTIONAL
- Description
the interval scale at which this product will renew when subscribed.
Allowed enum valuesday
week
month
year
- Name
remove_after_enabled
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether this product should be auto-removed from the customer's inventory after the configured time.
- Name
remove_after_time_value
- Type
- integer?
- Tags
- OPTIONAL
- Description
the time value at which this product will be removed
- Name
remove_after_time_scale
- Type
- enum?
- Tags
- OPTIONAL
- Description
the time scale at which this product will be automatically removed.
Allowed enum valuesday
week
month
year
- Name
store_stock_limit.enabled
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether the stock should be limited across the entire store
- Name
store_stock_limit.quantity
- Type
- integer?
- Tags
- OPTIONAL
- Description
the number of units to limit the store's stock
- Name
store_stock_limit.time_value
- Type
- integer?
- Tags
- OPTIONAL
- Description
the time value to limit this store's stock
- Name
store_stock_limit.time_scale
- Type
- enum?
- Tags
- OPTIONAL
- Description
the time scale to limit this store's stock.
Allowed enum valuesday
week
month
year
- Name
customer_stock_limit.enabled
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether the stock should be limited for each individual customer customer
- Name
customer_stock_limit.quantity
- Type
- integer?
- Tags
- OPTIONAL
- Description
the number of units to limit the customer's stock
- Name
customer_stock_limit.time_value
- Type
- integer?
- Tags
- OPTIONAL
- Description
the time value to limit this customer's stock
- Name
customer_stock_limit.time_scale
- Type
- enum?
- Tags
- OPTIONAL
- Description
the time scale to limit this customer's stock.
Allowed enum valuesday
week
month
year
- Name
stock_limit_do_not_include_removed
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether the stock limiter should not include items that have been removed from a customer's inventory. If this is
false
, then the stock limiter will increase the available stock when an item expires.
- Name
tags
- Type
- []flake?
- Tags
- OPTIONAL
- Description
an array of IDs specifying which tags to apply to this product
- Name
gameservers
- Type
- []flake?
- Tags
- OPTIONAL
- Description
an array of IDs specifying which game servers this product's commands should run on
- Name
commands
- Type
- []product command?
- Tags
- OPTIONAL
- Description
an array of product commands that will be executed at different stages of this product's lifecycle.
Returns
Returns the newly created product.
Request
Response
{
"id": "150519474611560448",
"store_id": "94688451781206016",
"version_id": "150519521570988032",
"image_url": "https://example.paynow.gg/product-image.webp",
"slug": "blender",
"name": "Blender",
"description": "A blender. It blends stuff.",
"price": 23499,
"allow_one_time_purchase": true,
"allow_subscription": true,
"subscription_interval_value": 1,
"subscription_interval_scale": "month",
"remove_after_enabled": true,
"remove_after_time_value": 1,
"remove_after_time_scale": "month",
"store_stock_limit": {
"enabled": true,
"quantity": 500,
"time_value": 1,
"time_scale": "month"
},
"customer_stock_limit": {
"enabled": true,
"quantity": 1,
"time_value": 1,
"time_scale": "day"
},
"stock_limit_do_not_include_removed": true,
"tags": [
{
"id": "124248382326706176",
"slug": "food",
"name": "Food"
}
],
"gameservers": [
{
"id": "108003582208380928",
"name": "test"
}
],
"commands": [
{
"stage": "on_purchase",
"content": "give {customer.steam.id} 1 blender"
},
{
"stage": "on_expire",
"content": "give {customer.steam.id} 1 blender"
}
],
"created_by": {
"id": "11084680073842688",
"first_name": "Example",
"last_name": "Exampleson"
},
"created_at": "2023-04-14T06:53:01.265316Z",
"updated_by": null,
"updated_at": null
}
Get Products
Request
Response
[
{
"id": "150519474611560448",
"store_id": "94688451781206016",
"version_id": "150519521570988032",
"image_url": "https://example.paynow.gg/product-image.webp",
"slug": "blender",
"name": "Blender",
"description": "A blender. It blends stuff.",
"price": 23499,
"allow_one_time_purchase": true,
"allow_subscription": true,
"subscription_interval_value": 1,
"subscription_interval_scale": "month",
"remove_after_enabled": true,
"remove_after_time_value": 1,
"remove_after_time_scale": "month",
"store_stock_limit": {
"enabled": true,
"quantity": 500,
"time_value": 1,
"time_scale": "month"
},
"customer_stock_limit": {
"enabled": true,
"quantity": 1,
"time_value": 1,
"time_scale": "day"
},
"stock_limit_do_not_include_removed": true,
"tags": [
{
"id": "124248382326706176",
"slug": "food",
"name": "Food"
}
],
"gameservers": [
{
"id": "108003582208380928",
"name": "test"
}
],
"commands": [
{
"stage": "on_purchase",
"content": "give {customer.steam.id} 1 blender"
}
],
"created_by": {
"id": "11084680073842688",
"first_name": "Example",
"last_name": "Exampleson"
},
"created_at": "2023-04-14T06:53:01.265316Z",
"updated_by": {
"id": "11084680073842688",
"first_name": "Example",
"last_name": "Exampleson"
},
"updated_at": "2023-04-14T06:53:12.460717Z"
},
{...},
{...}
]
Get Product
Request
Response
{
"id": "150519474611560448",
"store_id": "94688451781206016",
"version_id": "150519521570988032",
"image_url": "https://example.paynow.gg/product-image.webp",
"slug": "blender",
"name": "Blender",
"description": "A blender. It blends stuff.",
"price": 23499,
"allow_one_time_purchase": true,
"allow_subscription": true,
"subscription_interval_value": 1,
"subscription_interval_scale": "month",
"remove_after_enabled": true,
"remove_after_time_value": 1,
"remove_after_time_scale": "month",
"store_stock_limit": {
"enabled": true,
"quantity": 500,
"time_value": 1,
"time_scale": "month"
},
"customer_stock_limit": {
"enabled": true,
"quantity": 1,
"time_value": 1,
"time_scale": "day"
},
"stock_limit_do_not_include_removed": true,
"tags": [
{
"id": "124248382326706176",
"slug": "food",
"name": "Food"
}
],
"gameservers": [
{
"id": "108003582208380928",
"name": "test"
}
],
"commands": [
{
"stage": "on_purchase",
"content": "give {customer.steam.id} 1 blender"
},
{
"stage": "on_expire",
"content": "give {customer.steam.id} 1 blender"
}
],
"created_by": {
"id": "11084680073842688",
"first_name": "Example",
"last_name": "Exampleson"
},
"created_at": "2023-04-14T06:53:01.265316Z",
"updated_by": {
"id": "11084680073842688",
"first_name": "Example",
"last_name": "Exampleson"
},
"updated_at": "2023-04-14T06:53:12.460717Z"
}
Update Product
Updates a product.
Parameters
- Name
slug
- Type
- string?
- Tags
- OPTIONAL
- Description
the url-safe slug used to identify this product (3 - 36 characters). Must be unique to the store. Spaces will be converted to dashes, and all disallowed characters will be stripped. If left null, this will be auto generated from
name
.
- Name
name
- Type
- string?
- Tags
- OPTIONAL
- Description
the name of the product (1 - 42 characters)
- Name
description
- Type
- string?
- Tags
- OPTIONAL
- Description
the description of the product (1 - 50,000 characters) This can be in any format your store prefers, such as
text
,html
, etc.
- Name
price
- Type
- integer?
- Tags
- OPTIONAL
- Description
the price for this product. Prices are in zero-decimal format (where $10.00 is
1000
).Price must be exactly
0
(free), or between50
($0.50) and500000
($5,000.00)
- Name
allow_one_time_purchase
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether this product can be purchased one time (without subscribing)
- Name
allow_subscription
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether this product can be subscribed to
- Name
subscription_interval_value
- Type
- integer?
- Tags
- OPTIONAL
- Description
the interval value at which this product will renew when subscribed
- Name
subscription_interval_scale
- Type
- enum?
- Tags
- OPTIONAL
- Description
the interval scale at which this product will renew when subscribed.
Allowed enum valuesday
week
month
year
- Name
remove_after_enabled
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether this product should be auto-removed from the customer's inventory after the configured time.
- Name
remove_after_time_value
- Type
- integer?
- Tags
- OPTIONAL
- Description
the time value at which this product will be removed
- Name
remove_after_time_scale
- Type
- enum?
- Tags
- OPTIONAL
- Description
the time scale at which this product will be automatically removed.
Allowed enum valuesday
week
month
year
- Name
store_stock_limit.enabled
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether the stock should be limited across the entire store
- Name
store_stock_limit.quantity
- Type
- integer?
- Tags
- OPTIONAL
- Description
the number of units to limit the store's stock
- Name
store_stock_limit.time_value
- Type
- integer?
- Tags
- OPTIONAL
- Description
the time value to limit this store's stock
- Name
store_stock_limit.time_scale
- Type
- enum?
- Tags
- OPTIONAL
- Description
the time scale to limit this store's stock.
Allowed enum valuesday
week
month
year
- Name
customer_stock_limit.enabled
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether the stock should be limited for each individual customer customer
- Name
customer_stock_limit.quantity
- Type
- integer?
- Tags
- OPTIONAL
- Description
the number of units to limit the customer's stock
- Name
customer_stock_limit.time_value
- Type
- integer?
- Tags
- OPTIONAL
- Description
the time value to limit this customer's stock
- Name
customer_stock_limit.time_scale
- Type
- enum?
- Tags
- OPTIONAL
- Description
the time scale to limit this customer's stock.
Allowed enum valuesday
week
month
year
- Name
stock_limit_do_not_include_removed
- Type
- boolean?
- Tags
- OPTIONAL
- Description
whether the stock limiter should not include items that have been removed from a customer's inventory. If this is
false
, then the stock limiter will increase the available stock when an item expires.
- Name
tags
- Type
- []flake?
- Tags
- OPTIONAL
- Description
an array of IDs specifying which tags to apply to this product
- Name
gameservers
- Type
- []flake?
- Tags
- OPTIONAL
- Description
an array of IDs specifying which game servers this product's commands should run on
- Name
commands
- Type
- []product command?
- Tags
- OPTIONAL
- Description
an array of product commands that will be executed at different stages of this product's lifecycle.
Returns
Returns the updated product.
Request
Response
{
"id": "150519474611560448",
"store_id": "94688451781206016",
"version_id": "150519521570988032",
"image_url": "https://example.paynow.gg/product-image.webp",
"slug": "blender",
"name": "Blender",
"description": "A blender. It blends stuff.",
"price": 23499,
"allow_one_time_purchase": true,
"allow_subscription": true,
"subscription_interval_value": 1,
"subscription_interval_scale": "month",
"remove_after_enabled": true,
"remove_after_time_value": 1,
"remove_after_time_scale": "month",
"store_stock_limit": {
"enabled": true,
"quantity": 500,
"time_value": 1,
"time_scale": "month"
},
"customer_stock_limit": {
"enabled": true,
"quantity": 1,
"time_value": 1,
"time_scale": "day"
},
"stock_limit_do_not_include_removed": true,
"tags": [
{
"id": "124248382326706176",
"slug": "food",
"name": "Food"
}
],
"gameservers": [
{
"id": "108003582208380928",
"name": "test"
}
],
"commands": [
{
"stage": "on_purchase",
"content": "give {customer.steam.id} 1 blender"
},
{
"stage": "on_expire",
"content": "give {customer.steam.id} 1 blender"
}
],
"created_by": {
"id": "11084680073842688",
"first_name": "Example",
"last_name": "Exampleson"
},
"created_at": "2023-04-14T06:53:01.265316Z",
"updated_by": {
"id": "11084680073842688",
"first_name": "Example",
"last_name": "Exampleson"
},
"updated_at": "2023-04-14T06:53:12.460717Z"
}
Delete Product
Deletes a product by ID.
All subscriptions to this product will automatically be cancelled, so be cautious.
Returns
Returns HTTP 204
if the specified product was deleted.
Request
Response
HTTP 204