PayNow

Global Commands

Get global commands

GEThttps://api.paynow.gg/v1/stores/{storeId}/global-commands

Retrieves all global commands 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 this data for.
Response
200OKGlobalCommandDto[]
Represents a global command in the system. Global commands are instructions that can be executed across a store's environment.
Show fields
idFlakeIdRequired
contentstringRequired
The actual command content to be executed.
created_atstringRequired
Timestamp when the command was created.
created_byActorDtoRequired
Represents the actor that performed an action, such as the user, API key or game server that created or changed a record.
idFlakeIdOptional
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer
execution_ruleenumRequired
Possible enum values
  • invalid
  • once_per_item

    Executes commands regularly, once per item (number of products * quantity times)

  • once_per_order

    Executes command only once per entire order

online_onlybooleanRequired
Indicates whether the command should only be executed when the player is online.
override_execute_on_gameserver_idsFlakeId[]Required
List of specific game server IDs where this command should be executed, overriding default behavior.
stageenumRequired
Defines the stages at which product commands can be executed.
Possible enum values
  • invalid

    Represents an invalid or unspecified command stage.

  • on_purchase

    Commands that should be executed when a product is purchased.

  • on_expire

    Commands that should be executed when a product expires.

  • on_refund

    Commands that should be executed when a product is refunded.

  • on_renew

    Commands that should be executed when a subscription is renewed.

  • on_chargeback

    Commands that should be executed when an order is charged back.

  • on_trial_start

    Commands that should be executed when a trial is started.

  • on_trial_expire

    Commands that should be executed when a trial expires.

store_idFlakeIdRequired
updated_atstringOptional
Optional timestamp indicating when the command was last updated. Null if the command has never been updated.
updated_byActorDtoOptional
Represents the actor that performed an action, such as the user, API key or game server that created or changed a record.
idFlakeIdOptional
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer

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

curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/global-commands" \
  -H "Authorization: APIKey TOKEN"
Response200
[
  {
    "id": "411486491630370816",
    "content": "string",
    "created_at": "2024-01-01T00:00:00Z",
    "created_by": {
      "id": "411486491630370816",
      "type": "anonymous"
    },
    "execution_rule": "invalid",
    "online_only": true,
    "override_execute_on_gameserver_ids": [
      "411486491630370816"
    ],
    "stage": "invalid",
    "store_id": "411486491630370816",
    "updated_at": "2024-01-01T00:00:00Z",
    "updated_by": {
      "id": "411486491630370816",
      "type": "anonymous"
    }
  }
]

Create global command

POSThttps://api.paynow.gg/v1/stores/{storeId}/global-commands

Creates a global command for a store.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store to create this data for.
Request body
contentstringRequired
The command content to be executed.
execution_ruleenumRequired
Possible enum values
  • invalid
  • once_per_item

    Executes commands regularly, once per item (number of products * quantity times)

  • once_per_order

    Executes command only once per entire order

online_onlybooleanRequired
Indicates whether the command should only be executed when the player is online.
stageenumRequired
Defines the stages at which product commands can be executed.
Possible enum values
  • invalid

    Represents an invalid or unspecified command stage.

  • on_purchase

    Commands that should be executed when a product is purchased.

  • on_expire

    Commands that should be executed when a product expires.

  • on_refund

    Commands that should be executed when a product is refunded.

  • on_renew

    Commands that should be executed when a subscription is renewed.

  • on_chargeback

    Commands that should be executed when an order is charged back.

  • on_trial_start

    Commands that should be executed when a trial is started.

  • on_trial_expire

    Commands that should be executed when a trial expires.

override_execute_on_gameserver_idsFlakeId[]Optional
List of specific game server IDs where this command should be executed.
Response
200OKGlobalCommandDto
Represents a global command in the system. Global commands are instructions that can be executed across a store's environment.
Show fields
idFlakeIdRequired
contentstringRequired
The actual command content to be executed.
created_atstringRequired
Timestamp when the command was created.
created_byActorDtoRequired
Represents the actor that performed an action, such as the user, API key or game server that created or changed a record.
idFlakeIdOptional
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer
execution_ruleenumRequired
Possible enum values
  • invalid
  • once_per_item

    Executes commands regularly, once per item (number of products * quantity times)

  • once_per_order

    Executes command only once per entire order

online_onlybooleanRequired
Indicates whether the command should only be executed when the player is online.
override_execute_on_gameserver_idsFlakeId[]Required
List of specific game server IDs where this command should be executed, overriding default behavior.
stageenumRequired
Defines the stages at which product commands can be executed.
Possible enum values
  • invalid

    Represents an invalid or unspecified command stage.

  • on_purchase

    Commands that should be executed when a product is purchased.

  • on_expire

    Commands that should be executed when a product expires.

  • on_refund

    Commands that should be executed when a product is refunded.

  • on_renew

    Commands that should be executed when a subscription is renewed.

  • on_chargeback

    Commands that should be executed when an order is charged back.

  • on_trial_start

    Commands that should be executed when a trial is started.

  • on_trial_expire

    Commands that should be executed when a trial expires.

store_idFlakeIdRequired
updated_atstringOptional
Optional timestamp indicating when the command was last updated. Null if the command has never been updated.
updated_byActorDtoOptional
Represents the actor that performed an action, such as the user, API key or game server that created or changed a record.
idFlakeIdOptional
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer

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

curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/global-commands" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "content": "string",
  "execution_rule": "invalid",
  "online_only": true,
  "stage": "invalid",
  "override_execute_on_gameserver_ids": [
    "411486491630370816"
  ]
}'
Response200
{
  "id": "411486491630370816",
  "content": "string",
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": {
    "id": "411486491630370816",
    "type": "anonymous"
  },
  "execution_rule": "invalid",
  "online_only": true,
  "override_execute_on_gameserver_ids": [
    "411486491630370816"
  ],
  "stage": "invalid",
  "store_id": "411486491630370816",
  "updated_at": "2024-01-01T00:00:00Z",
  "updated_by": {
    "id": "411486491630370816",
    "type": "anonymous"
  }
}

Update global command

PATCHhttps://api.paynow.gg/v1/stores/{storeId}/global-commands/{globalCommandId}

Updates a global command for a store.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store to update this data for.
globalCommandIdFlakeIdRequired
The ID of the global command.
Request body
contentstringRequired
The command content to be executed.
execution_ruleenumRequired
Possible enum values
  • invalid
  • once_per_item

    Executes commands regularly, once per item (number of products * quantity times)

  • once_per_order

    Executes command only once per entire order

online_onlybooleanRequired
Indicates whether the command should only be executed when the player is online.
stageenumRequired
Defines the stages at which product commands can be executed.
Possible enum values
  • invalid

    Represents an invalid or unspecified command stage.

  • on_purchase

    Commands that should be executed when a product is purchased.

  • on_expire

    Commands that should be executed when a product expires.

  • on_refund

    Commands that should be executed when a product is refunded.

  • on_renew

    Commands that should be executed when a subscription is renewed.

  • on_chargeback

    Commands that should be executed when an order is charged back.

  • on_trial_start

    Commands that should be executed when a trial is started.

  • on_trial_expire

    Commands that should be executed when a trial expires.

override_execute_on_gameserver_idsFlakeId[]Optional
List of specific game server IDs where this command should be executed.
Response
200OKGlobalCommandDto
Represents a global command in the system. Global commands are instructions that can be executed across a store's environment.
Show fields
idFlakeIdRequired
contentstringRequired
The actual command content to be executed.
created_atstringRequired
Timestamp when the command was created.
created_byActorDtoRequired
Represents the actor that performed an action, such as the user, API key or game server that created or changed a record.
idFlakeIdOptional
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer
execution_ruleenumRequired
Possible enum values
  • invalid
  • once_per_item

    Executes commands regularly, once per item (number of products * quantity times)

  • once_per_order

    Executes command only once per entire order

online_onlybooleanRequired
Indicates whether the command should only be executed when the player is online.
override_execute_on_gameserver_idsFlakeId[]Required
List of specific game server IDs where this command should be executed, overriding default behavior.
stageenumRequired
Defines the stages at which product commands can be executed.
Possible enum values
  • invalid

    Represents an invalid or unspecified command stage.

  • on_purchase

    Commands that should be executed when a product is purchased.

  • on_expire

    Commands that should be executed when a product expires.

  • on_refund

    Commands that should be executed when a product is refunded.

  • on_renew

    Commands that should be executed when a subscription is renewed.

  • on_chargeback

    Commands that should be executed when an order is charged back.

  • on_trial_start

    Commands that should be executed when a trial is started.

  • on_trial_expire

    Commands that should be executed when a trial expires.

store_idFlakeIdRequired
updated_atstringOptional
Optional timestamp indicating when the command was last updated. Null if the command has never been updated.
updated_byActorDtoOptional
Represents the actor that performed an action, such as the user, API key or game server that created or changed a record.
idFlakeIdOptional
typeenumRequired
Possible enum values
  • anonymous
  • user
  • api_key
  • customer
  • game_server
  • internal
  • admin
  • platform
  • global_customer

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

curl -X PATCH "https://api.paynow.gg/v1/stores/{storeId}/global-commands/{globalCommandId}" \
  -H "Authorization: APIKey TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "content": "string",
  "execution_rule": "invalid",
  "online_only": true,
  "stage": "invalid",
  "override_execute_on_gameserver_ids": [
    "411486491630370816"
  ]
}'
Response200
{
  "id": "411486491630370816",
  "content": "string",
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": {
    "id": "411486491630370816",
    "type": "anonymous"
  },
  "execution_rule": "invalid",
  "online_only": true,
  "override_execute_on_gameserver_ids": [
    "411486491630370816"
  ],
  "stage": "invalid",
  "store_id": "411486491630370816",
  "updated_at": "2024-01-01T00:00:00Z",
  "updated_by": {
    "id": "411486491630370816",
    "type": "anonymous"
  }
}

Delete global command

DELETEhttps://api.paynow.gg/v1/stores/{storeId}/global-commands/{globalCommandId}

Deletes a global command for a store.

Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as Authorization: APIKey TOKEN.
Path parameters
storeIdFlakeIdRequired
The ID of the store to delete this data for.
globalCommandIdFlakeIdRequired
The ID of the command 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}/global-commands/{globalCommandId}" \
  -H "Authorization: APIKey TOKEN"