Download the PHP package elvesora/allocora-php without Composer

On this page you can find all versions of the php package elvesora/allocora-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package allocora-php

Allocora PHP

elvesora/allocora-php is the framework-independent PHP client for Allocora's public v1 API. It provides explicit resource methods for payees, products, immutable revenue records, and allocation rules without requiring a framework integration.

Requirements

Installation

Composer resolves stable releases through Packagist. Pin the compatible ^0.1 series as shown above and review the changelog before upgrading.

Quick start

Store the key outside source control, for example as ALLOCORA_API_KEY, and pass it directly to the client:

The default base URL is https://www.allocora.com/api/v1. A custom URL must use HTTPS, end in /api/v1, contain no credentials/query/fragment, and have no trailing slash:

Authentication and scopes

Every request uses Authorization: Bearer <key>. Create keys in Allocora with only the scopes your integration needs:

Resource Read scope Write scope
Payees read:payees write:payees
Products read:products write:products
Revenues read:revenues write:revenues
Rules read:rules write:rules

Missing or invalid keys produce AuthenticationException (401). Insufficient scope produces AuthorizationException (403).

Resource methods

All methods return Elvesora\Allocora\Response\ApiResponse. The public API reference documents the complete request and response shapes for every resource.

Payees

Products

Products support the payee method set plus soft archival. Archiving changes product status; it does not hard-delete financial history.

Revenue records

Revenue records are append-only financial facts. The SDK intentionally has no revenue update or delete methods. Correct an error by recording the appropriate refund or adjustment through Allocora's documented revenue workflow.

Revenue listing is paginated and filterable. Query values are encoded by Guzzle:

Rules

Rule updates and status changes create new immutable rule versions.

Batch operations and partial failures

Batch methods accept a list of 1 to 100 non-empty JSON objects and send the API's required { "records": [...] } envelope. Update and archive records must contain an id UUID.

Allocora processes each record independently. A successful HTTP response can therefore contain both successes and failures:

Do not treat HTTP 200 alone as proof that every batch record succeeded.

Responses

ApiResponse is immutable and exposes the decoded JSON object and response metadata:

Successful responses must be JSON objects with a JSON content type. Malformed JSON, JSON lists/scalars, unreadable streams, bodies above 10 MiB, and unsafe or oversized response-header sets throw InvalidResponseException. Retained response headers are limited to 100 names, 200 values, 128 bytes per name, 8 KiB per value, and 32 KiB in aggregate.

Response bodies and header values are omitted from print_r() and var_export() output, and native serialize() is rejected. Access through the methods above or json_encode() is deliberate and returns the real response data, so do not send that output to logs or telemetry unless it is appropriate for the destination. Non-success response bodies are treated as untrusted and discarded after bounded parsing; the HTTP status remains the authoritative exception classification.

Errors and retry policy

API exceptions expose only SDK-defined metadata through statusCode(), errorType(), retryable(), and retryAfter(). Raw upstream error bodies, validation messages, error codes, traces, and server details are never retained. Consequently, responseBody() and ValidationException::errors() return empty arrays; validate submitted data locally and use the fixed exception type and status to choose the user-facing recovery path.

Constructor and request-input validation throws PHP's InvalidArgumentException for invalid configuration, UUIDs, queries, payloads, or batch records. These failures occur before a request is sent and are not retryable.

retryAfter() accepts only bounded numeric seconds or a bounded HTTP date and caps the result at seven days. Oversized or malformed retry metadata is discarded and returns null.

Typed status mapping:

Failure Exception Retryable metadata
401 AuthenticationException No
403 AuthorizationException No
404 NotFoundException No
422 ValidationException No
429 RateLimitException Yes; inspect retryAfter()
5xx ServerException Yes
Other non-2xx ApiException 408 only
Network/transport TransportException Yes
Invalid response InvalidResponseException Depends on status

The SDK never retries automatically. Writes can represent financial facts and are not assumed idempotent. Before retrying any create, upsert, update, batch, archive, or rule-status request, reconcile the result with Allocora and use stable external identifiers where the API supports them. Respect retryAfter() for 429 responses.

Transport and secret safety

You remain responsible for keeping the key out of source control, logs, traces, analytics, job payloads, caches, browser output, and user-visible error messages. Rotate a key immediately if it is disclosed.

Optional custom headers are accepted in the constructor. Security-controlled and hop-by-hop headers cannot be overridden, including Authorization, Host, Cookie, Content-Type, User-Agent, Connection, Keep-Alive, Proxy-Authenticate, Proxy-Authorization, Proxy-Connection, TE, Trailer, Transfer-Encoding, and Upgrade.

Supported API boundary

This package exposes exactly the 32 bearer-authenticated operations recorded in resources/public-api-manifest.json. The manifest and the four resource classes are the complete public API surface; the client has no generic request escape hatch.

Development

See CHANGELOG.md.

License

MIT. See LICENSE.


All versions of allocora-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package elvesora/allocora-php contains the following files

Loading the files please wait ...