Sales
Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as
Authorization: APIKey TOKEN.Path parameters
storeIdFlakeIdRequired
Response
200OKSaleDto[]
Represents a detailed view of a Sale, including configuration and audit information.
Show fieldsHide fields
apply_to_product_idsFlakeId[]Required
A list of product IDs the sale applies to.
apply_to_tag_idsFlakeId[]Required
A list of tag IDs the sale applies to.
begins_atstringRequired
The date and time when the sale begins.
created_atstringRequired
The date and time when the sale was created.
created_byActorDtoRequired
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
discount_amountintegerRequired
The discount value. For percent discounts, this represents the percentage
multiplied by 10 (e.g., 250 = 25%). For amount discounts, this represents
the value in the smallest currency unit (e.g., cents).
discount_typeenumRequired
Possible enum values
percentamount
durationenumRequired
Possible enum values
unspecifiedonceforeverrepeating
duration_in_intervalsintegerRequired
The number of subscription intervals the coupon is valid for, used if the duration is repeating.
enabledbooleanRequired
Indicates whether the sale is enabled.
idFlakeIdRequired
minimum_order_valueintegerRequired
The minimum order value required to apply the sale, in the smallest currency unit (e.g., cents).
namestringRequired
The name of the sale.
store_idFlakeIdRequired
version_idFlakeIdRequired
ends_atstringOptional
The date and time when the sale ends.
updated_atstringOptional
The date and time when the sale was last updated.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/sales" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.sales.getSales();import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/sales", headers=headers)Response200
[
{
"apply_to_product_ids": [
"411486491630370816"
],
"apply_to_tag_ids": [
"411486491630370816"
],
"begins_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"discount_amount": 0,
"discount_type": "percent",
"duration": "unspecified",
"duration_in_intervals": 0,
"enabled": true,
"id": "411486491630370816",
"minimum_order_value": 0,
"name": "string",
"store_id": "411486491630370816",
"version_id": "411486491630370816",
"ends_at": "2024-01-01T00:00:00Z",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z"
}
]Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as
Authorization: APIKey TOKEN.Path parameters
storeIdFlakeIdRequired
Request body
apply_to_product_idsFlakeId[]Required
apply_to_tag_idsFlakeId[]Required
begins_atstringRequired
discount_amountintegerRequired
discount_typeenumRequired
Possible enum values
percentamount
durationenumRequired
Possible enum values
unspecifiedonceforeverrepeating
duration_in_intervalsintegerRequired
enabledbooleanRequired
minimum_order_valueintegerRequired
namestringRequired
ends_atstringOptional
Response
200OKSaleDto
Represents a detailed view of a Sale, including configuration and audit information.
Show fieldsHide fields
apply_to_product_idsFlakeId[]Required
A list of product IDs the sale applies to.
apply_to_tag_idsFlakeId[]Required
A list of tag IDs the sale applies to.
begins_atstringRequired
The date and time when the sale begins.
created_atstringRequired
The date and time when the sale was created.
created_byActorDtoRequired
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
discount_amountintegerRequired
The discount value. For percent discounts, this represents the percentage
multiplied by 10 (e.g., 250 = 25%). For amount discounts, this represents
the value in the smallest currency unit (e.g., cents).
discount_typeenumRequired
Possible enum values
percentamount
durationenumRequired
Possible enum values
unspecifiedonceforeverrepeating
duration_in_intervalsintegerRequired
The number of subscription intervals the coupon is valid for, used if the duration is repeating.
enabledbooleanRequired
Indicates whether the sale is enabled.
idFlakeIdRequired
minimum_order_valueintegerRequired
The minimum order value required to apply the sale, in the smallest currency unit (e.g., cents).
namestringRequired
The name of the sale.
store_idFlakeIdRequired
version_idFlakeIdRequired
ends_atstringOptional
The date and time when the sale ends.
updated_atstringOptional
The date and time when the sale was last updated.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
Failed requests return a PayNowError body. See the error response guide.
curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/sales" \
-H "Authorization: APIKey TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"name": "string",
"discount_type": "percent",
"discount_amount": 0,
"duration": "unspecified",
"duration_in_intervals": 0,
"apply_to_product_ids": [
"411486491630370816"
],
"apply_to_tag_ids": [
"411486491630370816"
],
"minimum_order_value": 0,
"begins_at": "2024-01-01T00:00:00Z",
"ends_at": "2024-01-01T00:00:00Z"
}'import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.sales.createSale({
enabled: true,
name: "string",
discount_type: "percent",
discount_amount: 0,
duration: "unspecified",
duration_in_intervals: 0,
apply_to_product_ids: [
"411486491630370816",
],
apply_to_tag_ids: [
"411486491630370816",
],
minimum_order_value: 0,
begins_at: "2024-01-01T00:00:00Z",
ends_at: "2024-01-01T00:00:00Z",
});import requests
headers = {"Authorization": "APIKey TOKEN"}
payload = {
"enabled": True,
"name": "string",
"discount_type": "percent",
"discount_amount": 0,
"duration": "unspecified",
"duration_in_intervals": 0,
"apply_to_product_ids": [
"411486491630370816",
],
"apply_to_tag_ids": [
"411486491630370816",
],
"minimum_order_value": 0,
"begins_at": "2024-01-01T00:00:00Z",
"ends_at": "2024-01-01T00:00:00Z",
}
response = requests.post("https://api.paynow.gg/v1/stores/{storeId}/sales", headers=headers, json=payload)Response200
{
"apply_to_product_ids": [
"411486491630370816"
],
"apply_to_tag_ids": [
"411486491630370816"
],
"begins_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"discount_amount": 0,
"discount_type": "percent",
"duration": "unspecified",
"duration_in_intervals": 0,
"enabled": true,
"id": "411486491630370816",
"minimum_order_value": 0,
"name": "string",
"store_id": "411486491630370816",
"version_id": "411486491630370816",
"ends_at": "2024-01-01T00:00:00Z",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z"
}Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as
Authorization: APIKey TOKEN.Path parameters
storeIdFlakeIdRequired
saleIdFlakeIdRequired
Response
200OKSaleDto
Represents a detailed view of a Sale, including configuration and audit information.
Show fieldsHide fields
apply_to_product_idsFlakeId[]Required
A list of product IDs the sale applies to.
apply_to_tag_idsFlakeId[]Required
A list of tag IDs the sale applies to.
begins_atstringRequired
The date and time when the sale begins.
created_atstringRequired
The date and time when the sale was created.
created_byActorDtoRequired
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
discount_amountintegerRequired
The discount value. For percent discounts, this represents the percentage
multiplied by 10 (e.g., 250 = 25%). For amount discounts, this represents
the value in the smallest currency unit (e.g., cents).
discount_typeenumRequired
Possible enum values
percentamount
durationenumRequired
Possible enum values
unspecifiedonceforeverrepeating
duration_in_intervalsintegerRequired
The number of subscription intervals the coupon is valid for, used if the duration is repeating.
enabledbooleanRequired
Indicates whether the sale is enabled.
idFlakeIdRequired
minimum_order_valueintegerRequired
The minimum order value required to apply the sale, in the smallest currency unit (e.g., cents).
namestringRequired
The name of the sale.
store_idFlakeIdRequired
version_idFlakeIdRequired
ends_atstringOptional
The date and time when the sale ends.
updated_atstringOptional
The date and time when the sale was last updated.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/sales/{saleId}" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.sales.getSale("411486491630370816");import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/sales/{saleId}", headers=headers)Response200
{
"apply_to_product_ids": [
"411486491630370816"
],
"apply_to_tag_ids": [
"411486491630370816"
],
"begins_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"discount_amount": 0,
"discount_type": "percent",
"duration": "unspecified",
"duration_in_intervals": 0,
"enabled": true,
"id": "411486491630370816",
"minimum_order_value": 0,
"name": "string",
"store_id": "411486491630370816",
"version_id": "411486491630370816",
"ends_at": "2024-01-01T00:00:00Z",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z"
}Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as
Authorization: APIKey TOKEN.Path parameters
storeIdFlakeIdRequired
saleIdFlakeIdRequired
Request body
apply_to_product_idsFlakeId[]Optional
apply_to_tag_idsFlakeId[]Optional
begins_atstringOptional
discount_amountintegerOptional
discount_typeenumOptional
Possible enum values
percentamount
durationenumOptional
Possible enum values
unspecifiedonceforeverrepeating
duration_in_intervalsintegerOptional
enabledbooleanOptional
ends_atstringOptional
minimum_order_valueintegerOptional
namestringOptional
Response
200OKSaleDto
Represents a detailed view of a Sale, including configuration and audit information.
Show fieldsHide fields
apply_to_product_idsFlakeId[]Required
A list of product IDs the sale applies to.
apply_to_tag_idsFlakeId[]Required
A list of tag IDs the sale applies to.
begins_atstringRequired
The date and time when the sale begins.
created_atstringRequired
The date and time when the sale was created.
created_byActorDtoRequired
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
discount_amountintegerRequired
The discount value. For percent discounts, this represents the percentage
multiplied by 10 (e.g., 250 = 25%). For amount discounts, this represents
the value in the smallest currency unit (e.g., cents).
discount_typeenumRequired
Possible enum values
percentamount
durationenumRequired
Possible enum values
unspecifiedonceforeverrepeating
duration_in_intervalsintegerRequired
The number of subscription intervals the coupon is valid for, used if the duration is repeating.
enabledbooleanRequired
Indicates whether the sale is enabled.
idFlakeIdRequired
minimum_order_valueintegerRequired
The minimum order value required to apply the sale, in the smallest currency unit (e.g., cents).
namestringRequired
The name of the sale.
store_idFlakeIdRequired
version_idFlakeIdRequired
ends_atstringOptional
The date and time when the sale ends.
updated_atstringOptional
The date and time when the sale was last updated.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
Failed requests return a PayNowError body. See the error response guide.
curl -X PATCH "https://api.paynow.gg/v1/stores/{storeId}/sales/{saleId}" \
-H "Authorization: APIKey TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"name": "string",
"discount_type": "percent",
"discount_amount": 0,
"duration": "unspecified",
"duration_in_intervals": 0,
"apply_to_product_ids": [
"411486491630370816"
],
"apply_to_tag_ids": [
"411486491630370816"
],
"minimum_order_value": 0,
"begins_at": "2024-01-01T00:00:00Z",
"ends_at": "2024-01-01T00:00:00Z"
}'import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.sales.updateSale("411486491630370816", {
enabled: true,
name: "string",
discount_type: "percent",
discount_amount: 0,
duration: "unspecified",
duration_in_intervals: 0,
apply_to_product_ids: [
"411486491630370816",
],
apply_to_tag_ids: [
"411486491630370816",
],
minimum_order_value: 0,
begins_at: "2024-01-01T00:00:00Z",
ends_at: "2024-01-01T00:00:00Z",
});import requests
headers = {"Authorization": "APIKey TOKEN"}
payload = {
"enabled": True,
"name": "string",
"discount_type": "percent",
"discount_amount": 0,
"duration": "unspecified",
"duration_in_intervals": 0,
"apply_to_product_ids": [
"411486491630370816",
],
"apply_to_tag_ids": [
"411486491630370816",
],
"minimum_order_value": 0,
"begins_at": "2024-01-01T00:00:00Z",
"ends_at": "2024-01-01T00:00:00Z",
}
response = requests.patch("https://api.paynow.gg/v1/stores/{storeId}/sales/{saleId}", headers=headers, json=payload)Response200
{
"apply_to_product_ids": [
"411486491630370816"
],
"apply_to_tag_ids": [
"411486491630370816"
],
"begins_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"discount_amount": 0,
"discount_type": "percent",
"duration": "unspecified",
"duration_in_intervals": 0,
"enabled": true,
"id": "411486491630370816",
"minimum_order_value": 0,
"name": "string",
"store_id": "411486491630370816",
"version_id": "411486491630370816",
"ends_at": "2024-01-01T00:00:00Z",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z"
}Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as
Authorization: APIKey TOKEN.Path parameters
storeIdFlakeIdRequired
saleIdFlakeIdRequired
curl -X DELETE "https://api.paynow.gg/v1/stores/{storeId}/sales/{saleId}" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
await paynow.sales.deleteSaleById("411486491630370816");import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.delete("https://api.paynow.gg/v1/stores/{storeId}/sales/{saleId}", headers=headers)