Order Feed - PureClarity/php-sdk GitHub Wiki
Order Feed
Purpose
Sends historical orders to PureClarity
Class
\PureClarity\Api\Feed\Type\Order
Usage
Note: the order feed differs slightly from other feeds, in that the append row takes an array of rows to add, rather than just individual rows. This is so that you can add an order at a time to the feed, rather than having to call the append function per row.
$orders = <data pulled from your system>
$feed = new \PureClarity\Api\Feed\Type\Brand($accessKey, $secretKey, $region);
$feed->start();
foreach ($orders as $order) {
$orderRows = <data pulled from the order>
$feed->append($orderRows);
}
$feed->end();
See Data feed overview for more details
Format
The following array keys must be present when passed to the append function:
Key | Description | Empty allowed |
---|---|---|
OrderID | Order ID | No |
UserId | ID of the customer the order is for | Yes |
Email address of the customer the order is for | Yes | |
DateTime | Date & time of the order | Yes |
ProdCode | ID of the product | No |
Quantity | Amount ordered | No |
UnitPrice | Unit price for the item ordered | No |
LinePrice | Order line price | No |
Note: At least one of UserId or Email must be populated.
For specific formatting of the above fields, see the order feed documentation