{
 "openapi": "3.0.4",
 "info": {
  "title": "OAuth2 Security Token Service",
  "description": "Get a bearer token. Every other call on this portal needs one first",
  "contact": {
   "name": "DgPays",
   "url": "https://www.dgpays.com"
  },
  "license": {
   "name": "License",
   "url": "https://www.dgpays.com"
  },
  "version": "v8.3.5.22"
 },
 "servers": [
  {
   "url": "https://devcard.sim-ant.com/SandBox/oAuth2",
   "description": "Sandbox — safe to call; nothing settles."
  }
 ],
 "paths": {
  "/sts/api/authorize": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Authorize",
    "description": "Initiates an OAuth/OpenAuth authorization request and returns the data required to continue the authorization flow. This operation validates the incoming authorization context (e.g., client identity, requested grant/response type, redirect URI, and scope) and, when applicable, issues an authorization code tied to the request. It also supports additional flow parameters such as state for CSRF protection and code_challange / PKCE-related inputs to harden public-client scenarios. On success, the response provides the redirect_uri, code, and state values needed by the client to complete the next step of the flow.",
    "operationId": "authorize",
    "requestBody": {
     "description": "Authorize Request",
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AuthorizeRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/AuthorizeResponse"
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ActionNotFound"
     },
     "400": {
      "$ref": "#/components/responses/BusinessFailure"
     },
     "500": {
      "$ref": "#/components/responses/TechnicalFailure"
     }
    }
   }
  },
  "/sts/api/token": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Token",
    "description": "Exchanges valid credentials or artifacts for OAuth tokens according to the requested grant_type. Depending on the flow, the request can include user credentials, an authorization code, a refresh_token, or an assertion, alongside client_id / client_secret (and optionally code_verifier for PKCE). The service validates the client, verifies the grant-specific inputs, and enforces scope rules before issuing tokens. On success, it returns an access_token, token_type, expires_in, and optionally a refresh_token to enable session continuation without re-authentication.\n\n**Part of:**\n\n- <a href=\"https://apiportal.dgpays.com/journeys/launch#s-credit\" target=\"_parent\">Journey 01 · Launching a new card product</a> — step 1, Get an access token\n\n- <a href=\"https://apiportal.dgpays.com/journeys/launch#s-debit\" target=\"_parent\">Journey 01 · Launching a new card product</a> — step 1, Get an access token\n\n- <a href=\"https://apiportal.dgpays.com/journeys/launch#s-prepaid\" target=\"_parent\">Journey 01 · Launching a new card product</a> — step 1, Get an access token",
    "operationId": "token",
    "requestBody": {
     "description": "Token Request",
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TokenRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TokenResponse"
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ActionNotFound"
     },
     "400": {
      "$ref": "#/components/responses/BusinessFailure"
     },
     "500": {
      "$ref": "#/components/responses/TechnicalFailure"
     }
    },
    "x-everest-journeys": [
     {
      "journey": "launch",
      "journeyName": "Launching a new card product",
      "n": "01",
      "section": "credit",
      "step": 1,
      "title": "Get an access token"
     },
     {
      "journey": "launch",
      "journeyName": "Launching a new card product",
      "n": "01",
      "section": "debit",
      "step": 1,
      "title": "Get an access token"
     },
     {
      "journey": "launch",
      "journeyName": "Launching a new card product",
      "n": "01",
      "section": "prepaid",
      "step": 1,
      "title": "Get an access token"
     }
    ]
   }
  },
  "/sts/api/revoke": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "description": "Revoke Token",
    "operationId": "revoke",
    "requestBody": {
     "description": "Revocation Request",
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RevocationRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RevocationResponse"
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ActionNotFound"
     },
     "400": {
      "$ref": "#/components/responses/BusinessFailure"
     },
     "500": {
      "$ref": "#/components/responses/TechnicalFailure"
     }
    }
   }
  },
  "/sts/api/introspect": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "description": "Introspect Token",
    "operationId": "introspect",
    "requestBody": {
     "description": "Introspection Request",
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/IntrospectionRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/IntrospectionResponse"
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ActionNotFound"
     },
     "400": {
      "$ref": "#/components/responses/BusinessFailure"
     },
     "500": {
      "$ref": "#/components/responses/TechnicalFailure"
     }
    }
   }
  },
  "/sts/api/healthCheck": {
   "post": {
    "tags": [
     "Platform operations"
    ],
    "summary": "Health Check",
    "description": "Performs a lightweight health probe to confirm the STS component is running and able to respond to requests. This endpoint is intended for monitoring systems, load balancers, and deployment readiness checks. The response includes a simple result indicator and a server timestamp to help validate connectivity and clock sanity. Use this operation to quickly distinguish platform/network issues from functional authorization/token errors.",
    "operationId": "healthCheck",
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HealthCheckResponse"
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ActionNotFound"
     },
     "400": {
      "$ref": "#/components/responses/BusinessFailure"
     },
     "500": {
      "$ref": "#/components/responses/TechnicalFailure"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "AuthorizeRequest": {
    "type": "object",
    "properties": {
     "response_type": {
      "type": "string",
      "description": "Response Type - [Optional]",
      "nullable": true
     },
     "grant_type": {
      "type": "string",
      "description": "Grant Type - [Optional]",
      "nullable": true
     },
     "client_id": {
      "type": "string",
      "description": "Client Id - [Optional]",
      "nullable": true
     },
     "client_secret": {
      "type": "string",
      "description": "Client Secret - [Optional]",
      "nullable": true
     },
     "redirect_uri": {
      "type": "string",
      "description": "Redirect Uri - [Optional]",
      "nullable": true
     },
     "scope": {
      "type": "string",
      "description": "Scope - [Optional]",
      "nullable": true
     },
     "state": {
      "type": "string",
      "description": "State - [Optional]",
      "nullable": true
     },
     "code_challenge": {
      "type": "string",
      "description": "Code Challenge",
      "nullable": true
     },
     "code_challenge_method": {
      "type": "string",
      "description": "Code Challenge Method",
      "nullable": true
     },
     "action_id": {
      "type": "string",
      "description": "Action Id - [Optional]",
      "nullable": true
     }
    }
   },
   "AuthorizeResponse": {
    "type": "object",
    "properties": {
     "redirect_uri": {
      "type": "string",
      "description": "Redirect Uri - [Optional]",
      "nullable": true
     },
     "code": {
      "type": "string",
      "description": "Code - [Optional]",
      "nullable": true
     },
     "state": {
      "type": "string",
      "description": "State - [Optional]",
      "nullable": true
     }
    }
   },
   "Error": {
    "type": "object",
    "properties": {
     "transactionId": {
      "type": "string",
      "description": "Transaction Id",
      "nullable": true
     },
     "errorCode": {
      "type": "string",
      "description": "Error Code",
      "nullable": true
     },
     "description": {
      "type": "string",
      "description": "Description",
      "nullable": true
     },
     "message": {
      "type": "string",
      "description": "Message",
      "nullable": true
     },
     "messageFormat": {
      "type": "string",
      "description": "Message Format",
      "nullable": true
     },
     "arguments": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Arguments",
      "nullable": true
     },
     "propertyName": {
      "type": "string",
      "description": "Property Name",
      "nullable": true
     },
     "detail": {
      "type": "string",
      "description": "Detail",
      "nullable": true
     },
     "items": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Error"
      },
      "description": "Items",
      "nullable": true
     },
     "isTechnicalError": {
      "type": "boolean",
      "description": "Is Technical Error",
      "nullable": true
     },
     "exceptionType": {
      "type": "string",
      "description": "Exception Type",
      "nullable": true
     }
    }
   },
   "HealthCheckResponse": {
    "required": [
     "date"
    ],
    "type": "object",
    "properties": {
     "result": {
      "type": "string",
      "description": "Result - [Optional]",
      "nullable": true
     },
     "date": {
      "type": "string",
      "description": "Date - [Optional]",
      "format": "date-time"
     }
    }
   },
   "IntrospectionRequest": {
    "type": "object",
    "properties": {
     "token": {
      "type": "string",
      "description": "Token",
      "nullable": true
     },
     "token_type_hint": {
      "type": "string",
      "description": "Token Type Hint",
      "nullable": true
     },
     "client_id": {
      "type": "string",
      "description": "Client Id",
      "nullable": true
     },
     "client_secret": {
      "type": "string",
      "description": "Client Secret",
      "nullable": true
     }
    }
   },
   "IntrospectionResponse": {
    "required": [
     "active"
    ],
    "type": "object",
    "properties": {
     "active": {
      "type": "boolean",
      "description": "Active"
     },
     "scope": {
      "type": "string",
      "description": "Scope",
      "nullable": true
     },
     "client_id": {
      "type": "string",
      "description": "Client Id",
      "nullable": true
     },
     "username": {
      "type": "string",
      "description": "Username",
      "nullable": true
     },
     "token_type": {
      "type": "string",
      "description": "Token Type",
      "nullable": true
     },
     "exp": {
      "type": "integer",
      "description": "Exp",
      "format": "int64",
      "nullable": true
     },
     "iat": {
      "type": "integer",
      "description": "Iat",
      "format": "int64",
      "nullable": true
     },
     "jti": {
      "type": "string",
      "description": "Jti",
      "nullable": true
     },
     "iss": {
      "type": "string",
      "description": "Iss",
      "nullable": true
     }
    }
   },
   "RevocationRequest": {
    "type": "object",
    "properties": {
     "token": {
      "type": "string",
      "description": "Token",
      "nullable": true
     },
     "token_type_hint": {
      "type": "string",
      "description": "Token Type Hint",
      "nullable": true
     },
     "client_id": {
      "type": "string",
      "description": "Client Id",
      "nullable": true
     },
     "client_secret": {
      "type": "string",
      "description": "Client Secret",
      "nullable": true
     }
    }
   },
   "RevocationResponse": {
    "type": "object"
   },
   "SecureString": {
    "type": "object"
   },
   "TokenRequest": {
    "type": "object",
    "properties": {
     "grant_type": {
      "type": "string",
      "description": "Grant Type - [Optional]",
      "nullable": true
     },
     "scope": {
      "type": "string",
      "description": "Scope - [Optional]",
      "nullable": true
     },
     "username": {
      "type": "string",
      "description": "User Id",
      "nullable": true
     },
     "password": {
      "allOf": [
       {
        "$ref": "#/components/schemas/SecureString"
       }
      ],
      "description": "Password - [Optional]",
      "nullable": true
     },
     "code": {
      "type": "string",
      "description": "Code - [Optional]",
      "nullable": true
     },
     "redirect_uri": {
      "type": "string",
      "description": "Redirect Uri - [Optional]",
      "nullable": true
     },
     "refresh_token": {
      "type": "string",
      "description": "Refresh Token - [Optional]",
      "nullable": true
     },
     "assertion": {
      "type": "string",
      "description": "Assertion - [Optional]",
      "nullable": true
     },
     "client_id": {
      "type": "string",
      "description": "Client Id - [Optional]",
      "nullable": true
     },
     "client_secret": {
      "type": "string",
      "description": "Client Secret - [Optional]",
      "nullable": true
     },
     "code_verifier": {
      "type": "string",
      "description": "Code Verifier - [Optional]",
      "nullable": true
     },
     "attestation_token": {
      "type": "string",
      "description": "Attestation Token - [Optional]",
      "nullable": true
     }
    }
   },
   "TokenResponse": {
    "required": [
     "expires_in"
    ],
    "type": "object",
    "properties": {
     "access_token": {
      "type": "string",
      "description": "Access Token - [Optional]",
      "nullable": true
     },
     "token_type": {
      "type": "string",
      "description": "Token Type - [Optional]",
      "nullable": true
     },
     "expires_in": {
      "type": "integer",
      "description": "Expires In - [Optional]",
      "format": "int32"
     },
     "refresh_token": {
      "type": "string",
      "description": "Refresh Token - [Optional]",
      "nullable": true
     },
     "scope": {
      "type": "string",
      "description": "Scope",
      "nullable": true
     }
    }
   }
  },
  "responses": {
   "ActionNotFound": {
    "description": "Action Not Found"
   },
   "BusinessFailure": {
    "description": "Business Failure",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "TechnicalFailure": {
    "description": "Technical Failure"
   }
  }
 },
 "tags": [
  {
   "name": "Authentication",
   "description": "Get a bearer token. Every other call on this portal needs one first."
  },
  {
   "name": "Platform operations",
   "description": "Health checks and cache refresh. Called by your monitoring, not by a cardholder journey."
  }
 ],
 "x-tagGroups": [
  {
   "name": "Platform",
   "tags": [
    "Authentication",
    "Platform operations"
   ]
  }
 ]
}