initialize()

initialize() the Paze JavaScript SDK and start the merchant session.
This must be called before invoking any other SDK method.
It’s recommended to call this on page load so device-level fraud checks can begin immediately.
Multiple merchant sessions may run in parallel if needed.

Request Parameters

client Object(Client) required

Provides merchant-specific configuration used by the SDK during the session.

Promise – Resolve and Reject

resolve()
This is the JS Promise (fulfilled) call when the request is successfully processed by the Paze SDK.


reject()
This is the JS Promise call when there is an error. The object passed in is an error object as defined in the “Errors” section in this document.


Business Errors

CLIENT_ID_MISSING — The client identifier is missing.
INVALID_CLIENT_ID — The client identifier is invalid.
INVALID_PROFILE_ID — The profile identifier is invalid.

Standard errors are defined in the Errors section.


Code Example

await initialize({
  client: {
    id: "mOYSSfG9VQonnTRZ8Zct5h2GnAeNj38lGHQy0xIeCWsrmE1LY", // string (required)
    name: "Orchid Bonanza", // string (optional)
    profileId: "orchidBonanzaMain", // string (optional)
    externalSubMerchantId: "019718e7-dbc1-74b5-9019-032260d9f074", // string (optional)
    merchantCategoryCode: "0303", // string (optional)
    brandName: "Orchid West", // string (optional)
    statementDescriptor: "PAZE ORCHID 0303 $13.00", // string (optional)
    url: "https://www.example.com/myapp" // string (optional)
  },
});

// initialize(options: { client: Client }) → Promise<void>