Requirements
- PHP 7.4 or later
- Composer (recommended installer)
- A Tilta account with API credentials – contact support@tilta.io to request sandbox access
Installation
Install the SDK using Composer:composer.json and downloads it into your vendor/ directory. Make sure you require Composer’s autoloader in your application if you have not already done so:
Always pin your dependencies to a specific version range in production to avoid unexpected breaking changes. Run
composer update tilta-io/tilta-php-sdk to pull in the latest compatible release.Configuration
Before making any API calls, initialise the SDK client with your API key and target environment:Creating a buyer
The example below shows how to create a new buyer – the first step in most Tilta integrations. A buyer is a business that will receive a credit facility and place orders on your platform.execute method returns a typed response model. You can call getter methods on the returned object to access fields such as getId(), getStatus(), and getLegalName().
Common operations
Requesting a credit facility
Requesting a credit facility
After a buyer is onboarded, request a credit facility to open their credit line. Tilta’s underwriting engine evaluates the request automatically.
Creating an order
Creating an order
Create an order when a buyer is ready to make a purchase. The order records the purchase intent and must be authorised before an invoice can be captured.
Capturing an invoice
Capturing an invoice
Capture an invoice once goods or services have been delivered. This is the legally effective financing step – it triggers merchant payout and starts the buyer’s repayment clock.
Error handling
The SDK throws typed exceptions for API errors. Wrap your calls in a try-catch block and handle exceptions according to your application’s needs:Further resources
GitHub repository
Browse the full source code, open issues, and read the repository README for advanced configuration options and changelog details.
Packagist package
View all published versions, download statistics, and dependency information on Packagist.
API reference
Explore the full REST API documentation that underpins the PHP SDK.
Integration guides
Step-by-step guides for buyer onboarding, credit facility setup, and the order-to-invoice flow.