curl -X POST https://api2.ecomailapp.cz/tracker/transaction \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transaction": {
"order_id": "transaction_1234",
"email": "foo@bar.cz",
"shop": "myshop.cz",
"amount": 1500,
"tax": 200,
"shipping": 100,
"city": "Praha",
"timestamp": 1441905935,
"status": "completed"
},
"transaction_items": [
{
"code": "product code",
"title": "product name",
"categories": ["my category 1", "my category 2"],
"price": 1500,
"amount": 1,
"tags": ["M", "3+", "puzzle"]
}
]
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/tracker/transaction');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'transaction' => [
'order_id' => 'transaction_1234',
'email' => 'foo@bar.cz',
'shop' => 'myshop.cz',
'amount' => 1500,
'tax' => 200,
'shipping' => 100,
'city' => 'Praha',
'timestamp' => 1441905935,
'status' => 'completed',
],
'transaction_items' => [
[
'code' => 'product code',
'title' => 'product name',
'categories' => ['my category 1', 'my category 2'],
'price' => 1500,
'amount' => 1,
'tags' => ['M', '3+', 'puzzle'],
],
],
]));
$response = curl_exec($ch);
curl_close($ch);
{
"order_id": "transaction_1234",
"email": "foo@bar.cz",
"shop": "myshop.cz",
"amount": 1500,
"timestamp": "2015-09-10 17:25:35",
"id": 1,
"status": "completed"
}
{
"errors": {
"transaction.order_id": ["The transaction.order id has already been taken."]
}
}
Transactions
Create a transaction
Create a new transaction for a subscriber.
POST
/
tracker
/
transaction
curl -X POST https://api2.ecomailapp.cz/tracker/transaction \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transaction": {
"order_id": "transaction_1234",
"email": "foo@bar.cz",
"shop": "myshop.cz",
"amount": 1500,
"tax": 200,
"shipping": 100,
"city": "Praha",
"timestamp": 1441905935,
"status": "completed"
},
"transaction_items": [
{
"code": "product code",
"title": "product name",
"categories": ["my category 1", "my category 2"],
"price": 1500,
"amount": 1,
"tags": ["M", "3+", "puzzle"]
}
]
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/tracker/transaction');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'transaction' => [
'order_id' => 'transaction_1234',
'email' => 'foo@bar.cz',
'shop' => 'myshop.cz',
'amount' => 1500,
'tax' => 200,
'shipping' => 100,
'city' => 'Praha',
'timestamp' => 1441905935,
'status' => 'completed',
],
'transaction_items' => [
[
'code' => 'product code',
'title' => 'product name',
'categories' => ['my category 1', 'my category 2'],
'price' => 1500,
'amount' => 1,
'tags' => ['M', '3+', 'puzzle'],
],
],
]));
$response = curl_exec($ch);
curl_close($ch);
{
"order_id": "transaction_1234",
"email": "foo@bar.cz",
"shop": "myshop.cz",
"amount": 1500,
"timestamp": "2015-09-10 17:25:35",
"id": 1,
"status": "completed"
}
{
"errors": {
"transaction.order_id": ["The transaction.order id has already been taken."]
}
}
Timestamps are saved and returned in UTC+0.
object
required
Transaction details.
Show transaction properties
Show transaction properties
string
required
Your unique transaction ID.
string
required
Subscriber’s email address.
string
Name of your shop, used in conditionals in the app. Case sensitive. An empty value results in not being able to select the shop in segments.
number
Total amount including tax and shipping.
number
Tax amount only.
number
Shipping amount only.
string
Delivery city.
string
Delivery county.
string
Delivery country.
integer
Unix timestamp of the transaction.
string|object
Optional properties, used in conditionals.
string
Transaction status. Accepted values:
processing, canceled, pending, completed, null.array
required
Array of transaction items.
Show transaction item properties
Show transaction item properties
string
Product code.
string
Product name.
string
Deprecated. Use
categories instead.array
List of product categories. Limited to 100 characters per category and 20 categories per item.
number
Total price for the given quantity.
number
Quantity of the product.
array
Optional item tags. Limited to 5000 characters per account.
curl -X POST https://api2.ecomailapp.cz/tracker/transaction \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transaction": {
"order_id": "transaction_1234",
"email": "foo@bar.cz",
"shop": "myshop.cz",
"amount": 1500,
"tax": 200,
"shipping": 100,
"city": "Praha",
"timestamp": 1441905935,
"status": "completed"
},
"transaction_items": [
{
"code": "product code",
"title": "product name",
"categories": ["my category 1", "my category 2"],
"price": 1500,
"amount": 1,
"tags": ["M", "3+", "puzzle"]
}
]
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/tracker/transaction');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'transaction' => [
'order_id' => 'transaction_1234',
'email' => 'foo@bar.cz',
'shop' => 'myshop.cz',
'amount' => 1500,
'tax' => 200,
'shipping' => 100,
'city' => 'Praha',
'timestamp' => 1441905935,
'status' => 'completed',
],
'transaction_items' => [
[
'code' => 'product code',
'title' => 'product name',
'categories' => ['my category 1', 'my category 2'],
'price' => 1500,
'amount' => 1,
'tags' => ['M', '3+', 'puzzle'],
],
],
]));
$response = curl_exec($ch);
curl_close($ch);
{
"order_id": "transaction_1234",
"email": "foo@bar.cz",
"shop": "myshop.cz",
"amount": 1500,
"timestamp": "2015-09-10 17:25:35",
"id": 1,
"status": "completed"
}
{
"errors": {
"transaction.order_id": ["The transaction.order id has already been taken."]
}
}
⌘I