Documentation Index
Fetch the complete documentation index at: https://docs.topsort.com/llms.txt
Use this file to discover all available pages before exploring further.
Topsort.php ist ein PHP Software Development Kit für die Promoted Listings API von Topsort.
Installation
Installieren Sie mit Composer:
composer require topsort/sdk
Oder fügen Sie zu Ihrer composer.json hinzu:
{
"require": {
"topsort/sdk": "3.0.0"
}
}
Ausführen einer Auktion
<?php
use Topsort\SDK;
$topsort_client = new SDK("mein_api_schlüssel");
$products = ["i8bfHPJaxcAb3", "gDG0HV97ed2s"];
$slots = 1;
$auction_result = $topsort_client->create_auction($slots, $products)->wait();
Meldung von Klick-Ereignissen
<?php
use Topsort\SDK;
$topsort_client = new SDK('mein_api_schlüssel');
$placement = [
"path" => "/categories/schuhe",
];
$topsort_client->report_click([
"placement" => $placement,
"resolvedBidId" => "AKFU78",
]);
Meldung von Impression-Ereignissen
<?php
use Topsort\SDK;
$topsort_client = new SDK('mein_api_schlüssel');
$impression = [
"placement" => [
"path" => "/categories/schuhe",
],
"resolvedBidId" => "AKFU78",
];
$topsort_client->report_impression($impression);
Meldung von Kauf-Ereignissen
<?php
use Topsort\SDK;
$topsort_client = new SDK('mein_api_schlüssel');
$items = [
[
"productId" => "gDG0HV97ed2s",
"quantity" => 2,
"unitPrice" => 10000,
]
];
$topsort_client->report_purchase([
"occurredAt" => new DateTime(),
"items" => $items,
]);
Für die vollständige Dokumentation besuchen Sie das GitHub-Repository.