# Delivery

## POST /v1/delivery/gameserver/link

> Update the link information for a Gameserver

```json
{"openapi":"3.1.1","info":{"title":"PayNow Game Server API","version":"v1"},"tags":[{"name":"delivery"}],"paths":{"/v1/delivery/gameserver/link":{"post":{"tags":["delivery"],"summary":"Update the link information for a Gameserver","operationId":"DeliveryGameServer_LinkGameServer","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkGameServerRequestDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/LinkGameServerRequestDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/LinkGameServerRequestDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkGameServerResponseDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}},"components":{"schemas":{"LinkGameServerRequestDto":{"required":["hostname","ip","platform","version"],"type":"object","properties":{"ip":{"type":"string"},"hostname":{"type":"string"},"platform":{"type":"string"},"version":{"type":"string"}},"additionalProperties":false},"LinkGameServerResponseDto":{"required":["gameserver","update_avaliable"],"type":"object","properties":{"update_avaliable":{"type":"boolean"},"latest_version":{"type":["null","string"]},"previously_linked":{"$ref":"#/components/schemas/PreviousGameServerLinkDto"},"gameserver":{"$ref":"#/components/schemas/MinimalGameServerDto"}},"additionalProperties":false},"PreviousGameServerLinkDto":{"required":["host_name","ip","last_linked_at"],"type":"object","properties":{"ip":{"type":"string"},"host_name":{"type":"string"},"last_linked_at":{"type":"string","format":"date-time"}},"additionalProperties":false},"MinimalGameServerDto":{"required":["enabled","id","name","store_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"name":{"type":"string","description":"The display name of the game server."},"enabled":{"type":"boolean","description":"Indicates whether the game server is currently enabled."}},"additionalProperties":false,"description":"A minimal representation of a Game Server"},"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."}}}}
```

## GET /v1/delivery/command-queue

> Retrieve the queue of commands to execute for a Gameserver

```json
{"openapi":"3.1.1","info":{"title":"PayNow Game Server API","version":"v1"},"tags":[{"name":"delivery"}],"paths":{"/v1/delivery/command-queue":{"get":{"tags":["delivery"],"summary":"Retrieve the queue of commands to execute for a Gameserver","operationId":"DeliveryCommandQueue_GetQueuedCommands","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QueuedCommandDto"}}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}},"components":{"schemas":{"QueuedCommandDto":{"required":["attempt_id","command","online_only","queued_at"],"type":"object","properties":{"attempt_id":{"$ref":"#/components/schemas/FlakeId"},"steam_id":{"$ref":"#/components/schemas/SteamId"},"minecraft_uuid":{"type":["null","string"],"description":"The Minecraft UUID of the customer, if applicable."},"customer_name":{"type":["null","string"],"description":"The name of the customer, if applicable."},"command":{"type":"string","description":"The command to be executed."},"online_only":{"type":"boolean","description":"Indicates if the command should be executed only if the customer is online (Connected to the gameserver)"},"queued_at":{"type":"string","description":"Represents when the command was queued.","format":"date-time"}},"additionalProperties":false,"description":"Represents a command to be executed on a Gameserver"},"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"SteamId":{"type":"string","additionalProperties":false,"description":"A 64-bit Steam account identifier. Accepts string or numeric format.","format":"steam-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."}}}}
```

## POST /v1/delivery/command-queue

> Retrieve the queued commands, while supplying the online players for a gameserver

```json
{"openapi":"3.1.1","info":{"title":"PayNow Game Server API","version":"v1"},"tags":[{"name":"delivery"}],"paths":{"/v1/delivery/command-queue":{"post":{"tags":["delivery"],"summary":"Retrieve the queued commands, while supplying the online players for a gameserver","operationId":"DeliveryCommandQueue_GetQueuedCommandsWithOnlinePlayers","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetQueuedCommandsWithOnlinePlayersRequestDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/GetQueuedCommandsWithOnlinePlayersRequestDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/GetQueuedCommandsWithOnlinePlayersRequestDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QueuedCommandDto"}}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}},"components":{"schemas":{"GetQueuedCommandsWithOnlinePlayersRequestDto":{"type":"object","properties":{"steam_ids":{"type":["null","array"],"items":{"$ref":"#/components/schemas/SteamId"}},"minecraft_uuids":{"type":["null","array"],"items":{"type":"string"}},"customer_names":{"type":["null","array"],"items":{"type":"string"}}},"additionalProperties":false},"SteamId":{"type":"string","additionalProperties":false,"description":"A 64-bit Steam account identifier. Accepts string or numeric format.","format":"steam-id"},"QueuedCommandDto":{"required":["attempt_id","command","online_only","queued_at"],"type":"object","properties":{"attempt_id":{"$ref":"#/components/schemas/FlakeId"},"steam_id":{"$ref":"#/components/schemas/SteamId"},"minecraft_uuid":{"type":["null","string"],"description":"The Minecraft UUID of the customer, if applicable."},"customer_name":{"type":["null","string"],"description":"The name of the customer, if applicable."},"command":{"type":"string","description":"The command to be executed."},"online_only":{"type":"boolean","description":"Indicates if the command should be executed only if the customer is online (Connected to the gameserver)"},"queued_at":{"type":"string","description":"Represents when the command was queued.","format":"date-time"}},"additionalProperties":false,"description":"Represents a command to be executed on a Gameserver"},"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."}}}}
```

## DELETE /v1/delivery/command-queue

> Mark commands as executed in bulk

```json
{"openapi":"3.1.1","info":{"title":"PayNow Game Server API","version":"v1"},"tags":[{"name":"delivery"}],"paths":{"/v1/delivery/command-queue":{"delete":{"tags":["delivery"],"summary":"Mark commands as executed in bulk","operationId":"DeliveryCommandQueue_MarkQueuedCommandExecutedBulk","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarkQueuedCommandAsExecutedDto"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarkQueuedCommandAsExecutedDto"}}},"application/*+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarkQueuedCommandAsExecutedDto"}}}}},"responses":{"204":{"description":"No Content"},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}},"components":{"schemas":{"MarkQueuedCommandAsExecutedDto":{"required":["attempt_id"],"type":"object","properties":{"attempt_id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"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."}}}}
```

## DELETE /v1/delivery/command-queue/{attemptId}

> Mark a queued command as executed

```json
{"openapi":"3.1.1","info":{"title":"PayNow Game Server API","version":"v1"},"tags":[{"name":"delivery"}],"paths":{"/v1/delivery/command-queue/{attemptId}":{"delete":{"tags":["delivery"],"summary":"Mark a queued command as executed","operationId":"DeliveryCommandQueue_MarkQueuedCommandExecuted","parameters":[{"name":"attemptId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}},"components":{"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."}}}}
```

## Mark commands as executed in bulk via a POST request

> Mark commands as executed in bulk via a POST request.\
> Some HTTP clients don't support bodies in DELETE requests, so for compatibility we have a POST route.\
> Please use the DELETE route if your HTTP client supports it.

```json
{"openapi":"3.1.1","info":{"title":"PayNow Game Server API","version":"v1"},"tags":[{"name":"delivery"}],"paths":{"/v1/delivery/command-queue/acknowledge":{"post":{"tags":["delivery"],"summary":"Mark commands as executed in bulk via a POST request","description":"Mark commands as executed in bulk via a POST request.\nSome HTTP clients don't support bodies in DELETE requests, so for compatibility we have a POST route.\nPlease use the DELETE route if your HTTP client supports it.","operationId":"DeliveryCommandQueue_MarkQueuedCommandExecutedBulkViaPost","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarkQueuedCommandAsExecutedDto"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarkQueuedCommandAsExecutedDto"}}},"application/*+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarkQueuedCommandAsExecutedDto"}}}}},"responses":{"204":{"description":"No Content"},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}},"components":{"schemas":{"MarkQueuedCommandAsExecutedDto":{"required":["attempt_id"],"type":"object","properties":{"attempt_id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"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."}}}}
```

## POST /v1/delivery/events

>

```json
{"openapi":"3.1.1","info":{"title":"PayNow Game Server API","version":"v1"},"tags":[{"name":"delivery"}],"paths":{"/v1/delivery/events":{"post":{"tags":["delivery"],"operationId":"DeliveryEvents_ReportGameServerEvents","requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportGameServerEventsEntryDto"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportGameServerEventsEntryDto"}}},"application/*+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportGameServerEventsEntryDto"}}}}},"responses":{"204":{"description":"No Content"},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}},"components":{"schemas":{"ReportGameServerEventsEntryDto":{"required":["event","timestamp"],"type":"object","properties":{"event":{"$ref":"#/components/schemas/GameServerEventDto"},"player_join":{"$ref":"#/components/schemas/ReportGameServerEventsEntryPlayerJoinDto"},"timestamp":{"type":"string","description":"When did this event occur.","format":"date-time"}},"additionalProperties":false,"description":"Represents a single game server event entry in a report."},"GameServerEventDto":{"enum":["invalid","player_join"],"type":"string","description":"Represents the types of events that can occur on a game server."},"ReportGameServerEventsEntryPlayerJoinDto":{"required":["ip_address"],"type":"object","properties":{"ip_address":{"$ref":"#/components/schemas/IPAddress"},"steam_id":{"$ref":"#/components/schemas/SteamId"},"minecraft_uuid":{"type":["null","string"],"description":"The Minecraft UUID of the player."},"minecraft_name":{"maxLength":128,"type":["null","string"],"description":"The Minecraft username of the player."}},"additionalProperties":false,"description":"Contains detailed information about a player joining a game server."},"IPAddress":{"type":"string","additionalProperties":false,"format":"ip-address"},"SteamId":{"type":"string","additionalProperties":false,"description":"A 64-bit Steam account identifier. Accepts string or numeric format.","format":"steam-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."}}}}
```
