{
  "openapi": "3.0.1",
  "info": {
    "title": "Promotion API",
    "description": "A simple and easy-to-use Promotional API for the ‘Dragon Game System’. Create ‘Free Game’ or ‘Feature Trigger’ offers for your players. Once you have been onboarded you will recieve API keys to use the features at your casino. All operations on the API is tied to only your IntegrationId through the API Key",
    "version": "v1"
  },
  "paths": {
    "/api/v1/featuretriggeroffer": {
      "post": {
        "tags": [
          "FeatureTriggerOffer"
        ],
        "summary": "Create a Feature Trigger Offer to a player.",
        "description": "A post request to create a Feature trigger game offer to a player.\r\nIf more than one is created for the same game the first one will be consumed first.\r\nDenomination, Lines and Coins will be validated, if you provide an invalid combination for a game it will respond with a 400.",
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFeatureTriggerRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFeatureTriggerRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFeatureTriggerRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFeatureTriggerRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateFeatureTriggerResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateFeatureTriggerResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateFeatureTriggerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/featuretriggeroffer/{externalOfferId}": {
      "delete": {
        "tags": [
          "FeatureTriggerOffer"
        ],
        "summary": "Delete all Feature Trigger Offers on an externalOfferId",
        "description": "Uses externalId, note this requires that an external id was provided in the create request.\r\n\r\nThis will delete ALL offers created using that external id so if you reused it for mulitple offers (even for different players) it will delete all.\r\n\r\nIt will not delete other promotion types using the same externalOfferId\r\n\r\nNOTE! It will not delete any offers that has been consumed/started by the player already.",
        "parameters": [
          {
            "name": "externalOfferId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "204": {
            "description": "Success"
          }
        }
      },
      "get": {
        "tags": [
          "FeatureTriggerOffer"
        ],
        "summary": "List Feature Trigger Offers externalOfferId",
        "description": "Use the externalOfferId to list all offers on that id. For all players that might have it.\r\n\r\nSkip defaults to 0 and take to 1000",
        "parameters": [
          {
            "name": "externalOfferId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "take",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/featuretriggeroffer/{externalOfferId}/{externalPlayerid}": {
      "delete": {
        "tags": [
          "FeatureTriggerOffer"
        ],
        "summary": "Delete all Feature Trigger Offers on an externalOfferId for a specific player.",
        "description": "Uses externalId, note this requires that an external id was provided in the create request.\r\n\r\nThis will delete ALL offers created using that externalOfferid for the specific player so if you reused it for mulitple offers (even for different players) it will delete all.\r\n\r\nIt will not delete other promotion types using the same externalOfferId\r\n\r\nNOTE! It will not delete any offers that has been consumed/started by the player already.",
        "parameters": [
          {
            "name": "externalPlayerid",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "externalOfferId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "204": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/featuretriggeroffer/player/{externalPlayerid}": {
      "get": {
        "tags": [
          "FeatureTriggerOffer"
        ],
        "summary": "List Feature Trigger Offers externalPlayerid",
        "description": "Use the externalPlayerid to list all offers for that player.\r\n\r\nSkip defaults to 0 and take to 1000",
        "parameters": [
          {
            "name": "externalPlayerid",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "take",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/freegameoffer": {
      "post": {
        "tags": [
          "FreeGameOffer"
        ],
        "summary": "Create a free game offer to a player.",
        "description": "A post request to crete a free game offer to a player.\r\nIf more than one is created for the same game the first one will be consumed first.\r\nDenomination, Lines and Coins will be validated, if you provide an invalid combination for a game it will respond with a 400.",
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFreeGameOfferRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFreeGameOfferRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFreeGameOfferRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFreeGameOfferRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateFreeGameOfferResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateFreeGameOfferResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateFreeGameOfferResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/freegameoffer/{externalOfferId}": {
      "delete": {
        "tags": [
          "FreeGameOffer"
        ],
        "summary": "Delete all Free Game offers on an externalOfferId",
        "description": "Uses externalId, note this requires that an external id was provided in the create request.\r\n\r\nThis will delete ALL offers created using that external id so if you reused it for mulitple offers (even for different players) it will delete all.\r\n\r\nIt will not delete Feature Triggers or other promotion types using the same externalOfferId\r\n\r\nNOTE! It will not delete any offers that has been consumed/started by the player already.",
        "parameters": [
          {
            "name": "externalOfferId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "204": {
            "description": "Success"
          }
        }
      },
      "get": {
        "tags": [
          "FreeGameOffer"
        ],
        "summary": "List free game offers externalOfferId",
        "description": "Use the externalOfferId to list all offers on that id. For all players that might have it.\r\n\r\nSkip defaults to 0 and take to 1000",
        "parameters": [
          {
            "name": "externalOfferId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "take",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/freegameoffer/{externalOfferId}/{externalPlayerid}": {
      "delete": {
        "tags": [
          "FreeGameOffer"
        ],
        "summary": "Delete all Free Game offers on an externalOfferId for a specific player.",
        "description": "Uses externalId, note this requires that an external id was provided in the create request.\r\n\r\nThis will delete ALL offers created using that externalOfferid for the specific player so if you reused it for mulitple offers (even for different players) it will delete all.\r\n\r\nIt will not delete Feature Triggers or other promotion types using the same externalOfferId\r\n\r\nNOTE! It will not delete any offers that has been consumed/started by the player already.",
        "parameters": [
          {
            "name": "externalPlayerid",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "externalOfferId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "204": {
            "description": "Success"
          }
        }
      }
    },
    "/api/v1/freegameoffer/player/{externalPlayerid}": {
      "get": {
        "tags": [
          "FreeGameOffer"
        ],
        "summary": "List free game offers externalPlayerid",
        "description": "Use the externalPlayerid to list all offers for that player.\r\n\r\nSkip defaults to 0 and take to 1000",
        "parameters": [
          {
            "name": "externalPlayerid",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "take",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionOffer"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Channel": {
        "enum": [
          0,
          1,
          2,
          3
        ],
        "type": "integer",
        "format": "int32"
      },
      "CreateFeatureTriggerRequest": {
        "required": [
          "externalPlayerId",
          "gameId",
          "rounds"
        ],
        "type": "object",
        "properties": {
          "externalPlayerId": {
            "type": "string"
          },
          "gameId": {
            "type": "string"
          },
          "channel": {
            "$ref": "#/components/schemas/Channel"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expires": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lines": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "coins": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "denomination": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "betValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "externalOfferId": {
            "type": "string",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "rounds": {
            "maximum": 10,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          },
          "featureIndex": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateFeatureTriggerResponse": {
        "type": "object",
        "properties": {
          "offerId": {
            "type": "string",
            "nullable": true
          },
          "betValue": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "CreateFreeGameOfferRequest": {
        "required": [
          "externalPlayerId",
          "gameId",
          "rounds"
        ],
        "type": "object",
        "properties": {
          "externalPlayerId": {
            "type": "string"
          },
          "gameId": {
            "type": "string"
          },
          "channel": {
            "$ref": "#/components/schemas/Channel"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expires": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lines": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "coins": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "denomination": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "betValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "externalOfferId": {
            "type": "string",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "rounds": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "CreateFreeGameOfferResponse": {
        "type": "object",
        "properties": {
          "freeGameOfferId": {
            "type": "string",
            "nullable": true,
            "deprecated": true
          },
          "offerId": {
            "type": "string",
            "nullable": true
          },
          "betValue": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "PromotionOffer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "integrationId": {
            "type": "integer",
            "format": "int32"
          },
          "externalPlayerId": {
            "maxLength": 128,
            "type": "string",
            "nullable": true
          },
          "state": {
            "$ref": "#/components/schemas/PromotionOfferState"
          },
          "type": {
            "$ref": "#/components/schemas/PromotionType"
          },
          "starts": {
            "type": "string",
            "format": "date-time"
          },
          "expires": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "denomination": {
            "type": "number",
            "format": "double"
          },
          "featureSet": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lines": {
            "type": "integer",
            "format": "int32"
          },
          "coins": {
            "type": "integer",
            "format": "int32"
          },
          "rounds": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "gameId": {
            "maxLength": 32,
            "type": "string",
            "nullable": true
          },
          "channel": {
            "$ref": "#/components/schemas/Channel"
          },
          "duration": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "minRoundDuration": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "externalOfferId": {
            "maxLength": 256,
            "type": "string",
            "nullable": true
          },
          "templateId": {
            "maxLength": 256,
            "type": "string",
            "nullable": true
          },
          "currency": {
            "maxLength": 3,
            "type": "string",
            "nullable": true
          },
          "featureTriggerId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PromotionOfferState": {
        "enum": [
          0,
          1,
          2
        ],
        "type": "integer",
        "format": "int32"
      },
      "PromotionType": {
        "enum": [
          0,
          1,
          2
        ],
        "type": "integer",
        "format": "int32"
      }
    },
    "securitySchemes": {
      "API Key": {
        "type": "apiKey",
        "description": "Authenticate with Apikey provided in header.",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  }
}