{
  "openapi": "3.0.4",
  "info": {
    "title": "Ecrypt.Reporting.UI.Api",
    "description": "Ecrypt API",
    "contact": {
      "name": "Ecrypt",
      "url": "https://www.ecrypt.com/",
      "email": "Engineering@Ecrypt.com"
    },
    "version": "1.0.0.0"
  },
  "servers": [
    {
      "url": "https://reporting.ecrypt.com/",
      "description": "Ecrypt Reporting Api."
    }
  ],
  "paths": {
    "/api/Batch": {
      "post": {
        "tags": [
          "Batch"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/BatchDetail": {
      "post": {
        "tags": [
          "BatchDetail"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchDetailRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchDetailResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Transactions/{TransactionID}": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "parameters": [
          {
            "name": "TransactionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetail"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetail"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Transactions": {
      "post": {
        "tags": [
          "Transactions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Batch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "closed": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/SETTLEMENT_BATCH_STATUSCODE"
          },
          "sales": {
            "type": "integer",
            "format": "int32"
          },
          "refunds": {
            "type": "integer",
            "format": "int32"
          },
          "voids": {
            "type": "integer",
            "format": "int32"
          },
          "grossRevenue": {
            "type": "number",
            "format": "decimal"
          },
          "refundTotal": {
            "type": "number",
            "format": "decimal"
          },
          "netIncome": {
            "type": "number",
            "format": "decimal"
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "BatchDetailRequest": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Batch Identifier",
            "format": "uint64"
          },
          "sortColumn": {
            "maxLength": 100,
            "minLength": 0,
            "pattern": "^[A-Za-z0-9]*$",
            "type": "string",
            "description": "Sort column, the column being used for sorting. The default is transaction `Id`.\r\n\r\nValid Options:\r\n- `Id`\r\n- `Type`\r\n- `Tender`\r\n- `Amount`\r\n- `AuthorizedAmount`\r\n- `CapturedAmount`\r\n- `GratuityAmount`\r\n- `SurchargeAmount`\r\n- `SettlementAmount`\r\n- `AvsCode`\r\n- `CvvCode`\r\n- `Created`",
            "default": "Id",
            "nullable": true
          },
          "page": {
            "maximum": 2147483647,
            "minimum": 1,
            "type": "integer",
            "description": "Page, the of results being requested.",
            "format": "int32",
            "default": 1,
            "nullable": true
          },
          "pageSize": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer",
            "description": "Page size, the number of items being requested for the page.",
            "format": "int32",
            "default": 20,
            "nullable": true
          },
          "sortOrder": {
            "maxLength": 20,
            "minLength": 0,
            "pattern": "^[A-Za-z]*$",
            "type": "string",
            "description": "Sort order, the sort columns desired sort direction. The default is `DESC`.\r\n\r\nExamples:\r\n- `ASC`\r\n- `DESC`",
            "default": "DESC",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "BatchDetailResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "uint64"
          },
          "transactions": {
            "$ref": "#/components/schemas/TransactionDetailPagedList"
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "BatchPagedList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Batch"
            },
            "nullable": true
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "BatchRequest": {
        "required": [
          "endDate",
          "startDate"
        ],
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "description": "Start date, all date times are in UTC.\r\n\r\nFormat:\r\n- yyyy-MM-dd\r\n- yyyy-MM-ddTHH:mm\r\n- yyyy-MM-ddTHH:mm:ss\r\n- yyyy-MM-ddTHH:mm:ss.fff",
            "format": "date-time",
            "default": "2025-01-01"
          },
          "endDate": {
            "type": "string",
            "description": "End date, all date times are in UTC.\r\n\r\nFormat:\r\n- yyyy-MM-dd\r\n- yyyy-MM-ddTHH:mm\r\n- yyyy-MM-ddTHH:mm:ss\r\n- yyyy-MM-ddTHH:mm:ss.fff",
            "format": "date-time",
            "default": "2025-02-01"
          },
          "sortColumn": {
            "maxLength": 100,
            "minLength": 0,
            "pattern": "^[A-Za-z0-9]*$",
            "type": "string",
            "description": "Sort column, the column being used for sorting. The default is batch `Id`.\r\n\r\nValid Options:\r\n- `Id`\r\n- `Closed`\r\n- `Sales`\r\n- `Refunds`\r\n- `Voids`\r\n- `GrossRevenue`\r\n- `RefundTotal`\r\n- `NetIncome`\r\n- `Status`",
            "default": "Id",
            "nullable": true
          },
          "page": {
            "maximum": 2147483647,
            "minimum": 1,
            "type": "integer",
            "description": "Page, the of results being requested.",
            "format": "int32",
            "default": 1,
            "nullable": true
          },
          "pageSize": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer",
            "description": "Page size, the number of items being requested for the page.",
            "format": "int32",
            "default": 20,
            "nullable": true
          },
          "sortOrder": {
            "maxLength": 20,
            "minLength": 0,
            "pattern": "^[A-Za-z]*$",
            "type": "string",
            "description": "Sort order, the sort columns desired sort direction. The default is `DESC`.\r\n\r\nExamples:\r\n- `ASC`\r\n- `DESC`",
            "default": "DESC",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "BatchResponse": {
        "type": "object",
        "properties": {
          "batches": {
            "$ref": "#/components/schemas/BatchPagedList"
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "Order": {
        "type": "object",
        "properties": {
          "discount": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "surcharge": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "shipping": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "tip": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "tax": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "total": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "billingAddress": {
            "$ref": "#/components/schemas/OrderAddress"
          },
          "shippingAddress": {
            "$ref": "#/components/schemas/OrderAddress"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLine"
            },
            "nullable": true
          },
          "metadata": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StringStringKeyValuePair"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "OrderAddress": {
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "line1": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "line2": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "city": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "state": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "postalCode": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "country": {
            "maxLength": 2,
            "minLength": 0,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "OrderLine": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": "integer",
            "format": "int64"
          },
          "productCode": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "commodityCode": {
            "maxLength": 50,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "unitOfMeasure": {
            "maxLength": 50,
            "minLength": 0,
            "type": "string"
          },
          "unitCost": {
            "type": "number",
            "format": "decimal"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "discount": {
            "type": "number",
            "format": "decimal"
          },
          "taxableAmount": {
            "type": "number",
            "format": "decimal"
          },
          "alternateTaxId": {
            "maxLength": 50,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "tax": {
            "type": "number",
            "format": "decimal"
          },
          "total": {
            "type": "number",
            "format": "decimal"
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "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": {},
        "nullable": true
      },
      "SETTLEMENT_BATCH_STATUSCODE": {
        "enum": [
          "INITIALIZING",
          "ACTIVE",
          "DISABLED",
          "ERROR",
          "DELETED",
          "INPROGRESS",
          "COMPLETED"
        ],
        "type": "string",
        "x-enumNames": [
          "INITIALIZING",
          "ACTIVE",
          "DISABLED",
          "ERROR",
          "DELETED",
          "INPROGRESS",
          "COMPLETED"
        ],
        "x-enumDescriptions": [
          "settlement batch is initializing",
          "settlement batch is active",
          "settlement batch is disabled",
          "settlement batch is error",
          "settlement batch is deleted",
          "settlement batch is inprogress",
          "settlement batch is completed"
        ]
      },
      "StringStringKeyValuePair": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "TransactionDetail": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "integer",
            "format": "uint64"
          },
          "type": {
            "type": "string"
          },
          "tender": {
            "type": "string"
          },
          "paymentName": {
            "type": "string",
            "nullable": true
          },
          "paymentNetwork": {
            "type": "string",
            "nullable": true
          },
          "paymentAccount": {
            "type": "string",
            "nullable": true
          },
          "paymentAccountExpiry": {
            "type": "string",
            "nullable": true
          },
          "payamentAccountRouting": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "format": "decimal"
          },
          "authorizationAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "capturedAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "gratuityAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "surchargeAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "settlementAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "voidedAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true
          },
          "referenceTransactionId": {
            "type": "integer",
            "format": "uint64",
            "nullable": true
          },
          "approvalCode": {
            "type": "string",
            "nullable": true
          },
          "avsCode": {
            "type": "string",
            "nullable": true
          },
          "cvvCode": {
            "type": "string",
            "nullable": true
          },
          "enhanced": {
            "type": "boolean",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "created": {
            "type": "string",
            "description": "Create date time represented in UTC.",
            "format": "date-time"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionEventDetail"
            },
            "nullable": true
          },
          "order": {
            "$ref": "#/components/schemas/Order"
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "TransactionDetailPagedList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionDetail"
            },
            "nullable": true
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "TransactionEventDetail": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "TransactionsRequest": {
        "required": [
          "endDate",
          "startDate"
        ],
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "description": "Start date, all date times are in UTC.\r\n\r\nFormat:\r\n- yyyy-MM-dd\r\n- yyyy-MM-ddTHH:mm\r\n- yyyy-MM-ddTHH:mm:ss\r\n- yyyy-MM-ddTHH:mm:ss.fff",
            "format": "date-time",
            "default": "2025-01-01"
          },
          "endDate": {
            "type": "string",
            "description": "End date, all date times are in UTC.\r\n\r\nFormat:\r\n- yyyy-MM-dd\r\n- yyyy-MM-ddTHH:mm\r\n- yyyy-MM-ddTHH:mm:ss\r\n- yyyy-MM-ddTHH:mm:ss.fff",
            "format": "date-time",
            "default": "2025-02-01"
          },
          "sortColumn": {
            "maxLength": 100,
            "minLength": 0,
            "pattern": "^[A-Za-z0-9]*$",
            "type": "string",
            "description": "Sort column, the column being used for sorting. The default is `TransactionId`.\r\n\r\nValid Options:\r\n- `Id`\r\n- `Type`\r\n- `Tender`\r\n- `Amount`\r\n- `AuthorizedAmount`\r\n- `CapturedAmount`\r\n- `GratuityAmount`\r\n- `SurchargeAmount`\r\n- `SettlementAmount`\r\n- `AvsCode`\r\n- `CvvCode`\r\n- `Created`",
            "default": "Id",
            "nullable": true
          },
          "page": {
            "maximum": 2147483647,
            "minimum": 1,
            "type": "integer",
            "description": "Page, the of results being requested.",
            "format": "int32",
            "default": 1,
            "nullable": true
          },
          "pageSize": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer",
            "description": "Page size, the number of items being requested for the page.",
            "format": "int32",
            "default": 20,
            "nullable": true
          },
          "sortOrder": {
            "maxLength": 20,
            "minLength": 0,
            "pattern": "^[A-Za-z]*$",
            "type": "string",
            "description": "Sort order, the sort columns desired sort direction. The default is `DESC`.\r\n\r\nExamples:\r\n- `ASC`\r\n- `DESC`",
            "default": "DESC",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "TransactionsResponse": {
        "type": "object",
        "properties": {
          "transactions": {
            "$ref": "#/components/schemas/TransactionDetailPagedList"
          }
        },
        "additionalProperties": false,
        "nullable": true
      }
    },
    "securitySchemes": {
      "X-Api-Key": {
        "type": "apiKey",
        "description": "Enter your API key",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "X-Api-Key": []
    }
  ]
}