<?php
//client can de downloaded from https://github.com/Newsman/newsman-api-php
require_once("Newsman/Client.php");
// you can get your API KEY, your newsman_user_id and list_id from My account -> API
$newsman_user_id = "your-username";
$api_key = "your-api-key";
$list_id = "your-list-id";
$order_details = array(
"order_no" => 32189883,
"created_at" => "2025-10-15 17:45:14",
"total" => 75.42,
"status" => "shipped",
"email" => "john@doe.com",
"firstname" => "John",
"lastname" => "doe",
"phone" => "747123328",
"currency" => "RON",
"fees" => 10.0524,
"shipping" => 17.5
);
$order_products = array(
array
(
"id" => 332,
"quantity" => 1,
"price" => 15.69,
"variation_code" => ""
),
array
(
"id" => 331,
"quantity" => 1,
"price" => 15.69,
"variation_code" => ""
),
array
(
"id" => 330,
"quantity" => 1,
"price" => 10.85,
"variation_code" => ""
),
array
(
"id" => 328,
"quantity" => 1,
"price" => 15.69,
"variation_code" => ""
)
);
try {
$client = new Newsman_Client($newsman_user_id, $api_key);
$ret = $client->remarketing->saveOrder($list_id, $order_details, $order_products);
} catch (Exception $e) {
//do something with the error, eg: log $e->getMessage()
}
return $ret;
?>