{
  "openapi": "3.0.1",
  "info": {
    "title": "License Management Portal API",
    "description": "Application to manage users and licenses",
    "contact": {
      "name": "Support",
      "email": "support@webcompanion.com"
    },
    "version": "1.0"
  },
  "paths": {
    "/api/v1/account/generatetoken": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Login with user credentials to get an authentication token that will be used for all subsequent calls.\r\nIf you are using the swagger endpoint you must only use the basic auth authorization scheme and logout of any other schemes.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicenseManagementPortal.Areas.Api.V1.ViewModels.TokenViewModel"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/account/refreshaccesstoken": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Given the jwt access token and refresh token generate a new access token.",
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LicenseManagementPortal.Areas.Api.V1.ViewModels.RefreshTokenViewModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LicenseManagementPortal.Models.AccessTokenModel"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/transaction/report": {
      "get": {
        "tags": [
          "Transaction"
        ],
        "summary": "Retrieves the the transactions report of the partner's products.\r\nUse the jwt token created from account/login to authenticate on this endpoint.\r\nIf you are using the swagger endpoint you must logout of the basic auth scheme and login with the jwt using the lavasoft scheme.",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LicenseManagementPortal.ViewModels.Upclick.TransactionReportViewModel"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LicenseManagementPortal.ViewModels.Upclick.TransactionReportViewModel"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LicenseManagementPortal.ViewModels.Upclick.TransactionReportViewModel"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "LicenseManagementPortal.Areas.Api.V1.ViewModels.TokenViewModel": {
        "type": "object",
        "properties": {
          "AccessToken": {
            "type": "string",
            "nullable": true
          },
          "RefreshToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Microsoft.AspNetCore.Mvc.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
          },
          "Extensions": {
            "type": "object",
            "additionalProperties": { },
            "nullable": true,
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "LicenseManagementPortal.Areas.Api.V1.ViewModels.RefreshTokenViewModel": {
        "required": [
          "AccessToken",
          "RefreshToken"
        ],
        "type": "object",
        "properties": {
          "AccessToken": {
            "type": "string"
          },
          "RefreshToken": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "LicenseManagementPortal.Models.AccessTokenModel": {
        "type": "object",
        "properties": {
          "AccessToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LicenseManagementPortal.ViewModels.Upclick.TransactionReportViewModel": {
        "type": "object",
        "properties": {
          "CreatedDate": {
            "type": "string",
            "format": "date-time"
          },
          "OrderCount": {
            "type": "integer",
            "format": "int32"
          },
          "RefundCount": {
            "type": "integer",
            "format": "int32"
          },
          "ChargebackCount": {
            "type": "integer",
            "format": "int32"
          },
          "ChargebackReversalCount": {
            "type": "integer",
            "format": "int32"
          },
          "GrossRevenue": {
            "type": "number",
            "format": "double"
          },
          "NetRevenue": {
            "type": "number",
            "format": "double"
          },
          "TotalRefunds": {
            "type": "number",
            "format": "double"
          },
          "TotalChargebacks": {
            "type": "number",
            "format": "double"
          },
          "TotalChargebacksReversed": {
            "type": "number",
            "format": "double"
          },
          "TotalFees": {
            "type": "number",
            "format": "double"
          },
          "TotalTaxes": {
            "type": "number",
            "format": "double"
          },
          "RevShare": {
            "type": "number",
            "format": "double"
          },
          "ProductCode": {
            "type": "string",
            "nullable": true
          },
          "ProductName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Lavasoft": {
        "type": "apiKey",
        "description": "Bearer JWT token authentication",
        "name": "Authorization",
        "in": "header"
      },
      "BasicLMPScheme": {
        "type": "http",
        "description": "Basic Authorization header",
        "scheme": "basic"
      },
      "JWTLMPScheme": {
        "type": "apiKey",
        "description": "Bearer JWT token authentication",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Lavasoft": [ ]
    },
    {
      "BasicLMPScheme": [ ]
    }
  ]
}