# Global Commands

## Get global commands

> Retrieves all global commands for the specified store.

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"global-commands"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"GlobalCommandDto":{"required":["content","created_at","created_by","execution_rule","id","online_only","override_execute_on_gameserver_ids","stage","store_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"stage":{"$ref":"#/components/schemas/ProductCommandStage"},"content":{"type":"string","description":"The actual command content to be executed."},"online_only":{"type":"boolean","description":"Indicates whether the command should only be executed when the player is online."},"override_execute_on_gameserver_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"},"description":"List of specific game server IDs where this command should be executed, overriding default behavior."},"execution_rule":{"$ref":"#/components/schemas/ProductCommandExecutionRuleDto"},"created_at":{"type":"string","description":"Timestamp when the command was created.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"Optional timestamp indicating when the command was last updated.\nNull if the command has never been updated.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"}},"additionalProperties":false,"description":"Represents a global command in the system.\nGlobal commands are instructions that can be executed across a store's environment."},"ProductCommandStage":{"enum":["invalid","on_purchase","on_expire","on_refund","on_renew","on_chargeback","on_trial_start","on_trial_expire"],"type":"string","description":"Defines the stages at which product commands can be executed."},"ProductCommandExecutionRuleDto":{"enum":["invalid","once_per_item","once_per_order"],"type":"string"},"ActorDto":{"required":["type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayNowActorType"},"id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"PayNowActorType":{"enum":["anonymous","user","api_key","customer","game_server","internal","admin","platform","global_customer"],"type":"string"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/global-commands":{"get":{"tags":["global-commands"],"summary":"Get global commands","description":"Retrieves all global commands for the specified store.","operationId":"GlobalCommands_GetGlobalCommands","parameters":[{"name":"storeId","in":"path","description":"The ID of the store to retrieve this data for.","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GlobalCommandDto"}}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## Create global command

> Creates a global command for a store.

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"global-commands"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"UpsertGlobalCommandDto":{"required":["content","execution_rule","online_only","stage"],"type":"object","properties":{"stage":{"$ref":"#/components/schemas/ProductCommandStage"},"content":{"type":"string","description":"The command content to be executed."},"online_only":{"type":"boolean","description":"Indicates whether the command should only be executed when the player is online."},"override_execute_on_gameserver_ids":{"type":["null","array"],"items":{"$ref":"#/components/schemas/FlakeId"},"description":"List of specific game server IDs where this command should be executed."},"execution_rule":{"$ref":"#/components/schemas/ProductCommandExecutionRuleDto"}},"additionalProperties":false,"description":"Data transfer object used for creating new global commands or updating existing ones.\nSupports partial updates following PATCH semantics."},"ProductCommandStage":{"enum":["invalid","on_purchase","on_expire","on_refund","on_renew","on_chargeback","on_trial_start","on_trial_expire"],"type":"string","description":"Defines the stages at which product commands can be executed."},"ProductCommandExecutionRuleDto":{"enum":["invalid","once_per_item","once_per_order"],"type":"string"},"GlobalCommandDto":{"required":["content","created_at","created_by","execution_rule","id","online_only","override_execute_on_gameserver_ids","stage","store_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"stage":{"$ref":"#/components/schemas/ProductCommandStage"},"content":{"type":"string","description":"The actual command content to be executed."},"online_only":{"type":"boolean","description":"Indicates whether the command should only be executed when the player is online."},"override_execute_on_gameserver_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"},"description":"List of specific game server IDs where this command should be executed, overriding default behavior."},"execution_rule":{"$ref":"#/components/schemas/ProductCommandExecutionRuleDto"},"created_at":{"type":"string","description":"Timestamp when the command was created.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"Optional timestamp indicating when the command was last updated.\nNull if the command has never been updated.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"}},"additionalProperties":false,"description":"Represents a global command in the system.\nGlobal commands are instructions that can be executed across a store's environment."},"ActorDto":{"required":["type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayNowActorType"},"id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"PayNowActorType":{"enum":["anonymous","user","api_key","customer","game_server","internal","admin","platform","global_customer"],"type":"string"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/global-commands":{"post":{"tags":["global-commands"],"summary":"Create global command","description":"Creates a global command for a store.","operationId":"GlobalCommands_CreateGlobalCommand","parameters":[{"name":"storeId","in":"path","description":"The ID of the store to create this data for.","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertGlobalCommandDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpsertGlobalCommandDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpsertGlobalCommandDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalCommandDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## Delete global command

> Deletes a global command for a store.

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"global-commands"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/global-commands/{globalCommandId}":{"delete":{"tags":["global-commands"],"summary":"Delete global command","description":"Deletes a global command for a store.","operationId":"GlobalCommands_DeleteGlobalCommand","parameters":[{"name":"storeId","in":"path","description":"The ID of the store to delete this data for.","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"globalCommandId","in":"path","description":"The ID of the command to delete.","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## Update global command

> Updates a global command for a store.

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"global-commands"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"UpsertGlobalCommandDto":{"required":["content","execution_rule","online_only","stage"],"type":"object","properties":{"stage":{"$ref":"#/components/schemas/ProductCommandStage"},"content":{"type":"string","description":"The command content to be executed."},"online_only":{"type":"boolean","description":"Indicates whether the command should only be executed when the player is online."},"override_execute_on_gameserver_ids":{"type":["null","array"],"items":{"$ref":"#/components/schemas/FlakeId"},"description":"List of specific game server IDs where this command should be executed."},"execution_rule":{"$ref":"#/components/schemas/ProductCommandExecutionRuleDto"}},"additionalProperties":false,"description":"Data transfer object used for creating new global commands or updating existing ones.\nSupports partial updates following PATCH semantics."},"ProductCommandStage":{"enum":["invalid","on_purchase","on_expire","on_refund","on_renew","on_chargeback","on_trial_start","on_trial_expire"],"type":"string","description":"Defines the stages at which product commands can be executed."},"ProductCommandExecutionRuleDto":{"enum":["invalid","once_per_item","once_per_order"],"type":"string"},"GlobalCommandDto":{"required":["content","created_at","created_by","execution_rule","id","online_only","override_execute_on_gameserver_ids","stage","store_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"stage":{"$ref":"#/components/schemas/ProductCommandStage"},"content":{"type":"string","description":"The actual command content to be executed."},"online_only":{"type":"boolean","description":"Indicates whether the command should only be executed when the player is online."},"override_execute_on_gameserver_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"},"description":"List of specific game server IDs where this command should be executed, overriding default behavior."},"execution_rule":{"$ref":"#/components/schemas/ProductCommandExecutionRuleDto"},"created_at":{"type":"string","description":"Timestamp when the command was created.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"Optional timestamp indicating when the command was last updated.\nNull if the command has never been updated.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"}},"additionalProperties":false,"description":"Represents a global command in the system.\nGlobal commands are instructions that can be executed across a store's environment."},"ActorDto":{"required":["type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayNowActorType"},"id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"PayNowActorType":{"enum":["anonymous","user","api_key","customer","game_server","internal","admin","platform","global_customer"],"type":"string"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/global-commands/{globalCommandId}":{"patch":{"tags":["global-commands"],"summary":"Update global command","description":"Updates a global command for a store.","operationId":"GlobalCommands_UpdateGlobalCommand","parameters":[{"name":"storeId","in":"path","description":"The ID of the store to update this data for.","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"globalCommandId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertGlobalCommandDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpsertGlobalCommandDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpsertGlobalCommandDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalCommandDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paynow.gg/management/management-api/global-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
