{
  "openapi": "3.1.1",
  "info": {
    "title": "FastWoWGold.Web | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://fastwowgold.com/"
    }
  ],
  "paths": {
    "/api/v1/catalog": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "List games, currencies and the payment methods available for each currency.",
        "operationId": "GetCatalog",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/games/{gameId}": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Servers (optionally filtered by name with q) and delivery methods for one game.",
        "operationId": "GetGame",
        "parameters": [
          {
            "name": "gameId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/quote": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Price an order. Nothing is created.",
        "operationId": "CreateQuote",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/orders": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Create an unpaid order and get a payment link for the buyer. Send an Idempotency-Key header (UUID) so retries don't create duplicates.",
        "operationId": "CreateOrder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/orders/{orderCode}": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Status of an order: Created (unpaid), PaymentClaimed, Verifying, Delivering, Completed, Cancelled, ...",
        "operationId": "GetOrderStatus",
        "parameters": [
          {
            "name": "orderCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiOrderRequest": {
        "required": [
          "gameId",
          "serverId",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "gameId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "serverId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "currency": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentMethodId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "deliveryMethodId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "character": {
            "type": [
              "null",
              "string"
            ]
          },
          "itemName": {
            "type": [
              "null",
              "string"
            ]
          },
          "guild": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Orders"
    }
  ]
}