Download the PHP package siren/sdk without Composer
On this page you can find all versions of the php package siren/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package sdk
Short Description Official Siren SDK for PHP — affiliate and incentive tracking for any commerce stack.
License MIT
Homepage https://sirenaffiliates.com
Informations about the package sdk
Siren SDK for PHP
Affiliate and incentive tracking for any commerce stack — record sales, verify signed webhooks, and reconcile your ledger in a few lines of PHP.
What is Siren?
Siren is an affiliate, referral, and incentive platform. You track the events that matter — sales, refunds, referred visits — and Siren attributes them to collaborators, calculates rewards, and manages payouts.
This SDK is the official PHP client for the Siren API. It lets you:
- Record commerce and tracking events (
sale,refund,siteVisited, and custom event types) - Verify signed webhooks in a single, constant-time call
- Manage API keys and webhook subscriptions
- Reconcile Siren's ledger (conversions, transactions, obligations, payouts) against your own
The full API surface is described in the OpenAPI spec.
Requirements
- PHP 8.1+
ext-json
Install
Quickstart
Record a sale
Mint an API key in the Siren dashboard (Settings → API Keys), then:
Refunds reverse a sale by (externalId, source):
Verify a webhook
Siren signs every delivery with X-Siren-Signature: sha256=<hex hmac> — an
HMAC-SHA256 of the raw request body keyed by your subscription's signing
secret.
⚠️ Pass the raw body bytes. The HMAC is computed over the exact bytes Siren sent. Read
php://inputdirectly — if youjson_decodeand re-encode the payload, verification will fail.
Create a subscription (the signingSecret is returned once — store it):
Features
- Event ingestion —
sale,refund,siteVisited, and custom event types viaingest. - Webhook verification — one-call
constructEvent, plus a lower-level constant-timeverifySignatureboolean check. - Subscription management — create, list, and delete webhook subscriptions.
- API key management — create, list, and revoke keys.
- Reconciliation readers — paginated iterators over conversions, transactions, obligations, and payouts.
- Automatic retries — network errors, 429s, and 5xx are retried with exponential backoff on idempotent operations; management writes are never auto-retried.
- Typed exceptions — every error extends
Siren\Sdk\Exception\SirenExceptionand carries the status code, error code, and error data.
Configuration
Errors
Every exception extends Siren\Sdk\Exception\SirenException and carries
getStatusCode(), getErrorCode(), and getErrorData().
| Status | Exception |
|---|---|
| 400 | BadRequestException |
| 401 | AuthenticationException |
| 403 | PermissionException |
| 404 | NotFoundException |
| 409 | ConflictException |
| 422 | ValidationException — getFieldErrors() |
| 429 | RateLimitException — getRetryAfter() |
| 5xx / other | ApiException |
| network/timeout | ConnectionException |
Webhook verification failures throw SignatureVerificationException.
Other SDKs
Siren also ships official clients for other stacks:
- Node.js — Novatorius/siren-node
- Python — Novatorius/siren-python
Links
- Website: sirenaffiliates.com
- API reference: openapi.yaml
Contributing
Contributions are welcome. See CONTRIBUTING.md for how to set up the project, run the tests, and open a pull request. By participating you agree to the Code of Conduct.
Tests mock the HTTP layer — no live network calls.
License
Released under the MIT License. Copyright © 2026 Novatorius LLC.