Skip to main content
Taliup\Sdk\Client is the main entry point for the Taliup PHP SDK. You instantiate it once with your merchant credentials and use it to access all available payment resources.
Get your credentials from Taliup → Settings → Payments → Credentials. Never commit your merchant_secret_key to source control — store it in an environment variable or secrets manager.

Constructor

Creates a new Client instance. Throws an ApiException immediately if either merchant_site_id or merchant_secret_key is empty.

Config parameters

string
required
Your Merchant Site ID, available from Taliup → Settings → Payments → Credentials.
string
required
Your Merchant Secret Key. Used to authenticate every API request and to verify webhook signatures.
string
The base URL of the Taliup API. Defaults to https://taliuphq.com/api/v1. You do not need to set this unless you have been given a custom endpoint.
int
HTTP request timeout in seconds. Defaults to 10.

Methods

Example

Error handling

The constructor throws ApiException (status code 0) in two cases:
  • Either merchant_site_id or merchant_secret_key is missing or empty — message: "Missing merchant credentials."
  • base_url is explicitly set to an empty string — message: "Missing base_url."
All subsequent API calls made through the client also throw ApiException on failure — see the ApiException reference for details.