Skip to main content

Overview

The SDK Init API initializes a PFM SDK session for a specific user and returns a session token that can be used to launch the PFM interface. This API must be called from your backend server before launching the PFM SDK on the client side.

Example Request

Authentication

This API requires authentication through the following headers that must be included in every request:

Request Body

The request body must be a JSON object containing the following parameters:

Response

Success Response (200 OK)

When the SDK initialization is successful, the API returns a session token:

Error Responses (400 Bad Request)

When the request contains invalid data or missing required fields, the API returns specific error responses:

Error Handling

Next Steps

After successfully obtaining the session token from this API:
  1. Store the Token: Keep the session token secure and use it immediately as it has a limited validity period
  2. Launch SDK: Use the session token to initialize and launch the PFM SDK in your client application
  3. Handle Expiry: If the token expires, call this API again to get a new session token

Security Considerations

  • Client Credentials: Never expose your client ID and secret in client-side code
  • Token Storage: Handle session tokens securely and avoid logging them
  • HTTPS Only: Always use HTTPS when calling this API
  • Token Expiry: Implement proper token refresh logic for long-running sessions
  • Encryption Support: This API supports encryption. When encryption is enabled for your integration, both request and response payloads will be encrypted. See API Encryption Guide for details.