1. Go to this page and download the library: Download yay-photobooks/partner-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yay-photobooks / partner-sdk example snippets
AY\PartnerSDK\Client;
use YAY\PartnerSDK\Dto\V1\CreateProjectRequest;
use YAY\PartnerSDK\Dto\V1\Customer;
use YAY\PartnerSDK\Dto\V1\Address;
use YAY\PartnerSDK\Dto\V1\Upload;
$client = new Client();
$project = new CreateProjectRequest(
title: "Sarah & Mike's Wedding Album",
customer: new Customer(
firstname: "Sarah",
lastname: "Mueller",
email: "[email protected]",
phone: "+4917612345678",
address: new Address(
line1: "Musterstraße 123",
line2: "Apartment 4B",
city: "Berlin",
postalCode: "10115",
country: "DE"
)
),
upload: new Upload(
numberOfImages: 150,
coverUrl: "https://my-photo-app.example.com/images/wedding-cover.jpg",
photoUrls: [
"https://my-photo-app.example.com/photos/img001.jpg",
"https://my-photo-app.example.com/photos/img002.jpg",
// ... more photo URLs
]
),
locale: "de_DE"
);
$result = $client->createProject($project);
$project = new CreateProjectRequest(
title: "Sarah & Mike's Wedding Album",
customer: new Customer(
firstname: "Sarah",
lastname: "Mueller",
email: "[email protected]",
// no address — collected at checkout
),
upload: new Upload(
numberOfImages: 150,
coverUrl: "https://my-photo-app.example.com/images/wedding-cover.jpg",
),
locale: "de_DE"
);
new CreateProjectRequest(
title: string, // Project title
customer: Customer, // Customer information
upload: Upload, // Upload metadata
locale: string // Locale (e.g., "de_DE", "en_US")
)
new Customer(
firstname: string, // Customer first name
lastname: string, // Customer last name
email: string, // Customer email address
address: ?Address = null, // Optional: Omit for B2B preview-before-checkout flows; customer provides it at checkout
phone: ?string = null // Optional: Mobile phone in E.164 format (e.g. +4917612345678)
)
new Address(
line1: string, // Address line 1
line2: string, // Address line 2 (can be empty)
city: string, // City
postalCode: string, // Postal code
country: string // ISO 3166-1 alpha-2 country code (e.g., "DE")
)
new Upload(
numberOfImages: int, // Total number of images
coverUrl: string, // URL of the cover image
photoUrls: ?array // Optional array of photo URLs
)
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.