Skip to main content
Every Trading, Account, Portfolio, and Balance endpoint requires an authentication token from this group. PHS provides two independent authentication flows:
  • Underlying Account — for stock trading accounts
  • Derivative Account — for derivative trading accounts
These are separated because PHS treats stock and derivative products as independent trading permissions.

B1. Authentication — Underlying

Logs in with a stock (underlying) trading account and returns the credentials required for subsequent authenticated API requests.

Endpoint

POST /auth/gen-secret-key/underlying

Sandbox URL

Parameters

Example Request

Example Response

Response Fields

Note: The access_token and refresh_token should be included according to the authentication requirements of subsequent API endpoints.
Warning: Sandbox behavior — The Sandbox accepts the demo username and password issued during onboarding. If you do not have Sandbox credentials, contact PHS OpenAPI Support.

Sandbox Token Behavior

The Sandbox uses fixed authentication credentials for this login flow. The Sandbox returns the same fixed values for:
  • access_token
  • refresh_token
  • otp_token
These values do not rotate between Sandbox login requests. The fixed Sandbox OTP token for underlying account authentication is:
Use this value as the x-otp-token header when submitting underlying order requests in the Sandbox.
Note: Use the token values exactly as returned by the Sandbox. Do not expect the authentication tokens to change between login requests.