Getting Started
Authentication and Credentials
Payyd enterprise calls use both request signing and bearer token authentication.
Credential Types
| Credential | Used For | Where Used |
|---|---|---|
| Public key (apiKey) | HMAC request signing identity | Client constructor |
| Private key (secretKey) | Generate x-sign signature | Client constructor |
| Username + Password | Get bearer access token | auth_get_token |
| Bearer token | Operation authorization | set_bearer_token |
Signing Headers
When using PayydEnterpriseClient, signing is mandatory and these headers are added:
- payyd-requestid unique UUID per call
- x-nonce timestamp-based nonce
- x-api-key your public API key
- x-sign SHA-256 HMAC signature using secret key
PHP Authentication Flow
$client = new PayydEnterpriseClient(
apiKey: getenv('PAYYD_API_KEY'),
secretKey: getenv('PAYYD_SECRET_KEY'),
endpoint: PayydEnterpriseClient::PREPROD_ENDPOINT,
);
$auth = $client->auth_get_token(
getenv('PAYYD_USERNAME'),
getenv('PAYYD_PASSWORD')
);
$client->set_bearer_token($auth->token->accessToken ?? null);
Recommended Environment Variables
PAYYD_API_KEY
PAYYD_SECRET_KEY
PAYYD_USERNAME
PAYYD_PASSWORD
PAYYD_ENDPOINT # optional override
For multi-environment setups, keep suffix-based keys (for example _PREPROD, _PROD).