Skip to main content

Welcome to Ortto SDK

The Ortto SDK is a modern, type-safe PHP package for Laravel that provides seamless integration with Ortto’s Customer Data Platform. Built on top of Saloon v3, this SDK offers a fluent, developer-friendly interface to interact with Ortto’s REST API.

Quick Start

Get up and running in under 5 minutes.

Key Features

Type-Safe

100% type coverage with PHPStan max level. Built with PHP 8.4+ features including typed properties and enums.

Laravel Integration

First-class Laravel support with service providers, facades, and configuration publishing.

Modern HTTP Client

Built on Saloon v3 for powerful HTTP abstractions, middleware support, and excellent testing capabilities.

Comprehensive Coverage

Support for people, audiences, activities, and more. Constantly updated with new endpoints.

Well Tested

100% code coverage with extensive integration tests and mocked responses.

Developer Experience

Fluent API, auto-completion, factories for testing, and detailed error messages.

Core Capabilities

People Management

Create, update, retrieve, archive, and delete contacts in your Ortto CDP.
use PhpDevKits\Ortto\Facades\Ortto;

// Create or update a contact
$response = Ortto::people()->merge([
    'people' => [
        ['fields' => [
            'str::email' => '[email protected]',
            'str::first' => 'John',
            'str::last' => 'Doe',
        ]],
    ],
    'mergeBy' => ['str::email'],
]);

Activity Tracking

Retrieve activity feeds for contacts with filtering and pagination.
$response = Ortto::activities()->getPersonActivities(
    personId: '0069061b5bda4060a5765300',
    timeframe: ActivityTimeframe::Last7Days,
    limit: 50
);

Audience Management

Manage audience subscriptions and retrieve audience information.
$audiences = Ortto::audiences()->get(
    searchTerm: 'subscribers',
    limit: 20
);

Requirements

PHP 8.4+

Modern PHP features

Laravel 10.x/11.x

Current LTS versions

Saloon v3

HTTP client foundation

What’s Included

This SDK provides comprehensive support for:
  • People API - Create, update, retrieve, archive, restore, and delete contacts
  • Activities API - Retrieve activity feeds with filtering and pagination
  • Audiences API - List audiences and manage subscriptions
  • Account API - Retrieve instance schema and field definitions
  • Type-Safe Enums - ActivityTimeframe, MergeStrategy, FindStrategy, SortOrder, PersonField
  • Data Classes - Typed DTOs with factory support for testing
  • Laravel Facades - Static access to all resources

Community & Support