{
  "openapi": "3.0.3",
  "tags": [
    {
      "name": "documentation",
      "description": "Documenting the API"
    },
    {
      "name": "api",
      "description": "Interface for functionality"
    },
    {
      "name": "embed",
      "description": "Embeddable interface"
    },
    {
      "name": "constituent",
      "description": "Only applies to Constituent users"
    },
    {
      "name": "tenant",
      "description": "Only applies to Tenant users"
    }
  ],
  "paths": {
    "/swagger.yaml": {
      "get": {
        "tags": ["documentation"],
        "summary": "Get this documentation as the specified type (extension)",
        "responses": {
          "200": {
            "description": "successful retrieval",
            "content": {
              "application/yaml": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/ping": {
      "get": {
        "tags": ["api"],
        "summary": "Ping to check the up-ness of the server",
        "responses": {
          "200": {
            "description": "successful retrieval",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "string",
                      "enum": ["OK"]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/sdk": {
      "get": {
        "tags": ["api"],
        "summary": "Retrieve the bootstrap file for bootstrapping the API embed",
        "responses": {
          "200": {
            "description": "successful retrieval",
            "content": {
              "application/javascript": {}
            }
          }
        }
      }
    },
    "/api/sdk/v1": {
      "get": {
        "tags": ["api"],
        "summary": "Retrieve the SDK file for connecting to the embedded frontend",
        "responses": {
          "200": {
            "description": "successful retrieval",
            "content": {
              "application/javascript": {}
            }
          }
        }
      }
    },
    "/api/convert-guest-social": {
      "post": {
        "tags": ["api", "constituent"],
        "summary": "Convert a guest account to a social account",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          },
          {
            "name": "authorization",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/GuestAuth"
                  },
                  {
                    "$ref": "#/components/schemas/SocialAuth"
                  },
                  {
                    "$ref": "#/components/schemas/AuthenticationBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "agreesToMarketing": {
                        "type": "string"
                      },
                      "soids": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful submission",
            "content": {
              "string": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/authenticate-social": {
      "post": {
        "tags": ["api", "constituent"],
        "summary": "Authenticate with a Social Provider",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SocialAuth"
                  },
                  {
                    "$ref": "#/components/schemas/AuthenticationBase"
                  },
                  {
                    "$ref": "#/components/schemas/GuestAuth"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful submission",
            "content": {
              "string": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/link-social": {
      "post": {
        "tags": ["api", "constituent"],
        "summary": "Retrieve the SDK file for connecting to the embedded frontend",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicAuth"
                  },
                  {
                    "$ref": "#/components/schemas/SocialAuth"
                  },
                  {
                    "$ref": "#/components/schemas/AuthenticationBase"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful submission",
            "content": {
              "string": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/sign-in": {
      "post": {
        "tags": ["api", "constituent"],
        "summary": "Retrieve the SDK file for connecting to the embedded frontend",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AuthenticationBase"
                  },
                  {
                    "$ref": "#/components/schemas/BasicAuth"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful submission",
            "content": {
              "string": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/sign-up": {
      "post": {
        "tags": ["api", "constituent"],
        "summary": "Create an account",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicAuth"
                  },
                  {
                    "$ref": "#/components/schemas/AuthenticationBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "marketingEmailAcceptance": {
                        "type": "string"
                      },
                      "tosAcceptanceDate": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "soids": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful submission",
            "content": {
              "string": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/convert-guest": {
      "post": {
        "tags": ["api", "constituent"],
        "summary": "Convert a guest account",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicAuth"
                  },
                  {
                    "$ref": "#/components/schemas/AuthenticationBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "marketingEmailAcceptance": {
                        "type": "string"
                      },
                      "tosAcceptanceDate": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "soids": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful submission",
            "content": {
              "string": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/register-guest": {
      "post": {
        "tags": ["api", "constituent"],
        "summary": "Create a guest account",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AuthenticationBase"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful submission",
            "content": {
              "string": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/refresh": {
      "post": {
        "tags": ["api", "constituent"],
        "summary": "Refresh a token",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "fingerprint": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful submission",
            "content": {
              "string": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/forgot-password": {
      "post": {
        "tags": ["api", "constituent"],
        "summary": "Submit a forgotten password request",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "appId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "successful submission"
          }
        }
      }
    },
    "/api/accept/marketing/{appId}": {
      "post": {
        "tags": ["api", "constituent"],
        "summary": "Accept marketing email",
        "parameters": [
          {
            "name": "appId",
            "in": "path"
          },
          {
            "name": "authorization",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful submission",
            "content": {
              "string": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/accept/tos/{appId}": {
      "post": {
        "tags": ["api", "constituent"],
        "summary": "Accept Terms of Service",
        "parameters": [
          {
            "name": "appId",
            "in": "path"
          },
          {
            "name": "authorization",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful submission",
            "content": {
              "string": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/token/refresh": {
      "post": {
        "tags": ["api"],
        "summary": "Refresh a token",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "fingerprint": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful submission",
            "content": {
              "string": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/reset-password/customer/account/{accountId}/token/{token}": {
      "get": {
        "tags": ["embed"],
        "summary": "Render a forgot password page",
        "parameters": [
          {
            "name": "accountId",
            "in": "path"
          },
          {
            "name": "token",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "rendered page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/reset-password/tenant/account/{accountId}/token/{token}": {
      "get": {
        "tags": ["embed"],
        "summary": "Render a forgot password page",
        "parameters": [
          {
            "name": "accountId",
            "in": "path"
          },
          {
            "name": "token",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "rendered page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/reset-password": {
      "post": {
        "tags": ["api"],
        "summary": "Submit a reset password request",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "password": {
                    "type": "string"
                  },
                  "accountId": {
                    "type": "string"
                  },
                  "token": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully Reset Password",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/tenant-log-in": {
      "get": {
        "tags": ["embed", "tenant"],
        "summary": "Render the Tenant login pages",
        "responses": {
          "200": {
            "description": "rendered page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/tenant-sign-in": {
      "post": {
        "tags": ["api", "tenant"],
        "summary": "Submit a Tenant sign-in request",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicAuth"
                  },
                  {
                    "properties": {
                      "fingerprint": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully signed in",
            "content": {
              "text": {
                "schema": {
                  "type": "string",
                  "description": "Tenant Token"
                }
              }
            }
          }
        }
      }
    },
    "/api/payit-tenant-sign-in": {
      "post": {
        "tags": ["api", "tenant"],
        "summary": "Submit a PayIt Tenant sign-in request",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicAuth"
                  },
                  {
                    "properties": {
                      "fingerprint": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully signed in",
            "content": {
              "text": {
                "schema": {
                  "type": "string",
                  "description": "Tenant Token"
                }
              }
            }
          }
        }
      }
    },
    "/api/submit-code": {
      "post": {
        "tags": ["api", "tenant"],
        "summary": "Submit a TOTP for an authentication request",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "username": {
                    "type": "string"
                  },
                  "session": {
                    "type": "string"
                  },
                  "totpCode": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully signed in",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Tenant Token object"
                }
              }
            }
          }
        }
      }
    },
    "/api/tenant-forgot-password": {
      "post": {
        "tags": ["api", "tenant"],
        "summary": "Submit a tenant password reset request",
        "parameters": [
          {
            "name": "accept-language",
            "in": "header"
          },
          {
            "name": "x-payit-language",
            "in": "header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "appId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Successfully requested password reset"
          }
        }
      }
    },
    "/": {
      "get": {
        "tags": ["embed", "constituent"],
        "summary": "Render the constituent signin/authentication pages",
        "responses": {
          "200": {
            "description": "rendered page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AuthenticationBase": {
        "type": "object",
        "properties": {
          "fingerprint": {
            "type": "string"
          },
          "appId": {
            "type": "string"
          },
          "appName": {
            "type": "string"
          },
          "appPlatform": {
            "type": "string"
          }
        }
      },
      "BasicAuth": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "SocialAuth": {
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "socialProvider": {
            "type": "string"
          }
        }
      },
      "GuestAuth": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          }
        }
      }
    }
  },
  "info": {
    "title": "Standalone Authentication Service",
    "description": "Authentication gateway and embeddable authentication frame",
    "version": ""
  },
  "servers": [
    {
      "url": "http://localhost:15800",
      "description": "Local"
    },
    {
      "url": "https://auth-dev.payitgov.com",
      "description": "Sandbox"
    }
  ]
}
