NAV
shell php

Introduction

Welcome to the Seliton API docs!

Authentication

JSON Web Tokens and Scopes

Seliton API uses JSON Web Tokens (JWT) for authentication. Authorization is managed via scopes. We have the following scopes available:

Item Scope Access
Attribute read_attributes Read Attributes
Attribute write_attributes Create, update and delete Attributes
Brand read_brands Read Brands
Brand write_brands Create, update and delete Brands
Category read_categories Read Categories
Category write_categories Create, update and delete Categories
Customer read_customers Read Customers
Customer write_customers Create, update and delete Customers
Order read_orders Read Orders
Page read_pages Read Pages
Page write_pages Create, update and delete Pages
Product read_products Read Products
Product write_products Create, update and delete Products

To retreive JWT, you should register an App and redirect user to Seliton’s OAuth2 Server authorize endpoint with the following parameters:

Parameter Description
client_id Your App’s ID
response_type Should be equal to string "code"
shop URL of the user’s Seliton shop
scope List of the scopes required by your App (separated by space or %20 for URL)
<?php
// Build Seliton's authorize page URL
$authorizePageUrl = 'http://dev.seliton.com/authorize?'.http_build_query(array (
    'client_id' => 'testclient',
    'response_type' => 'code',
    'shop' => 'http://dev-1.myseliton.com',
    'scope' => 'read_customers read_orders',
));

// And finally redirect user to authorize page
header("Location: $authorizePageUrl");
?>

The Seliton’s authorize page URL looks like this:

http://dev.seliton.com/authorize?client_id=testclient&response_type=code&shop=http%3A%2F%2Fdev-1.myseliton.com&scope=read_customers+read_orders

When user authorizes your app to access his resource, Seliton’s OAuth2 server redirects user to your app’s redirect URL with code parameter.

Retrieve JWT by code

code parameter should be used to retreive JWT from the token endpoint.

<?php
$curl = curl_init('http://dev.seliton.com/token');
curl_setopt($curl, CURLOPT_POSTFIELDS, array (
    'grant_type' => 'authorization_code',
    'code' => '0deaa75298a6560a16674d8c79f2c6e7b5074199'
));
curl_setopt($curl, CURLOPT_USERPWD, 'testclient:testpass');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$responseBody = curl_exec($curl);
?>
curl -u testclient:testpass http://dev.seliton.com/token -d 'grant_type=authorization_code&code=0deaa75298a6560a16674d8c79f2c6e7b5074199'

The above command returns JSON structured like this:

{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8",
  "expires_in": 3600,
  "token_type": "bearer",
  "scope": "read_orders",
  "refresh_token": "28b0af25f00521f65b430e595922a1e011cdc832"
}

Access resource with JWT

Once you have JWT, you either attach it to every request manually or set it with Seliton Client.

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

list ($pages, $count) = $seliton->page()->all(array (
    'titleContains' => 'Test',
    'limit' => 2,
    'offset' => 1,
    'fields' => 'pageId,pageTitle'
));
?>
curl "http://dev-1.myseliton.com/api/v1/pages?titleContains=Test&limit=2&offset=1&fields=pageId,pageTitle&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "pages": [
        {
            "pageId": 44,
            "pageTitle": {
                "EN": "Test 2",
                "TR": "",
                "RO": ""
            }
        },
        {
            "pageId": 45,
            "pageTitle": {
                "EN": "Test 3",
                "TR": "",
                "RO": ""
            }
        }
    ],
    "_metadata": {
        "count": 3
    }
}

Attributes

Get All Attributes

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

list ($attributes, $count) = $seliton->attribute()->all(array (
    'nameContains' => 'Test',
    'limit' => 2,
    'offset' => 1,
    'fields' => 'attributeId,attributeName'
));
?>
curl "http://dev-1.myseliton.com/api/v1/attributes?nameContains=Test&limit=2&offset=1&fields=attributeId,attributeName&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "attributes": [
        {
            "attributeId": 154,
            "attributeName": {
                "EN": "Test 2",
                "TR": "",
                "RO": ""
            }
        },
        {
            "attributeId": 155,
            "attributeName": {
                "EN": "Test 3",
                "TR": "",
                "RO": ""
            }
        }
    ],
    "_metadata": {
        "count": 3
    }
}

This endpoint retrieves all attributes.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/attributes

Query Parameters

Parameter Description
nameContains Attribute name filter (substring).
limit Amount of Attributes in a result.
offset Amount of Attributes to skip from result.
fields Fields (comma separated) to be retrieved.

Get a Specific Attribute

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$attribute = $seliton->attribute()->retrieve(154);
?>
curl "http://dev-1.myseliton.com/api/v1/attributes/154?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "attribute": {
        "attributeId": 154,
        "attributeName": {
            "EN": "Test 2",
            "TR": "",
            "RO": ""
        },
        "attributeUnit": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "attributeCode": "test_2",
        "attributeType": "text",
        "attributeValidator": "number",
        "attributeIsFilterable": false,
        "attributeFilterWidget": "none",
        "attributeFilterWidgetShowCounts": false,
        "attributeFilterWidgetHideIrrelevant": false,
        "attributeFilterMoveOutWhenApplied": false,
        "attributeIsSearchable": false,
        "attributeIsComparable": false,
        "attributeApplyToAllProducts": false,
        "attributeShowAfterDescription": false,
        "attributeShowInTab": false,
        "attributeShowInQuickView": false,
        "attributeShowOnHover": false,
        "attributeSort": 50054
    }
}

This endpoint retrieves a specific attribute.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/attributes/<ID>

URL Parameters

Parameter Description
ID The ID of the attribute to retrieve

Create an Attribute

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$attribute = $seliton->attribute()->create(
    array (
        'attributeName' => array ('en' => 'Test'),
        'attributeUnit' => array ('en' => 'Unit'),
        'attributeCode' => 'test',
        'attributeType' => 'text',
        'attributeValidator' => 'number',
        'attributeIsFilterable' => true,
        'attributeFilterWidget' => 'text',
        'attributeFilterWidgetShowCounts' => true,
        'attributeFilterWidgetHideIrrelevant' => true,
        'attributeFilterMoveOutWhenApplied' => false,
        'attributeIsSearchable' => true,
        'attributeIsComparable' => true,
        'attributeApplyToAllProducts' => false,
        'attributeShowAfterDescription' => true,
        'attributeShowInTab' => false,
        'attributeShowInQuickView' => true,
        'attributeShowOnHover' => true,
        'attributeSort' => 200,
    )
);
?>
curl -X POST "http://dev-1.myseliton.com/api/v1/attributes?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"attributeName": {"en": "Test"}, "attributeUnit": {"en": "Unit"}, "attributeCode":  "test", "attributeType": "text", "attributeValidator": "number", "attributeIsFilterable": true, "attributeFilterWidget": "text", "attributeFilterWidgetShowCounts": true, "attributeFilterWidgetHideIrrelevant": true, "attributeFilterMoveOutWhenApplied": false, "attributeIsSearchable": true, "attributeIsComparable": true, "attributeApplyToAllProducts": false, "attributeShowAfterDescription": true, "attributeShowInTab": false, "attributeShowInQuickView": true, "attributeShowOnHover": true, "attributeSort": 200}'

The above command returns JSON structured like this:

{
    "attributeId": 156,
        "attributeName": {
        "EN": "Test",
        "TR": "",
        "RO": ""
    },
    "attributeUnit": {
        "EN": "Unit",
        "TR": "",
        "RO": ""
    },
    "attributeCode": "test",
    "attributeType": "text",
    "attributeValidator": "number",
    "attributeIsFilterable": true,
    "attributeFilterWidget": "text",
    "attributeFilterWidgetShowCounts": true,
    "attributeFilterWidgetHideIrrelevant": true,
    "attributeFilterMoveOutWhenApplied": false,
    "attributeIsSearchable": true,
    "attributeIsComparable": true,
    "attributeApplyToAllProducts": false,
    "attributeShowAfterDescription": true,
    "attributeShowInTab": false,
    "attributeShowInQuickView": true,
    "attributeShowOnHover": true,
    "attributeSort": 200
}

This endpoint creates an attribute.

HTTP Request

POST http://dev-1.myseliton.com/api/v1/attributes

POST JSON Parameters

Parameter Description
attributeName
attributeUnit
attributeCode
attributeType
attributeValidator
attributeIsFilterable
attributeFilterWidget
attributeFilterWidgetShowCounts
attributeFilterWidgetHideIrrelevant
attributeFilterMoveOutWhenApplied
attributeIsSearchable
attributeIsComparable
attributeApplyToAllProducts
attributeShowAfterDescription
attributeShowInTab
attributeShowInQuickView
attributeShowOnHover
attributeSort

Update a Specific Attribute

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;
use Seliton\Client\Resource\Enum;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

// Default method is to update Attribute directly
$attribute = $seliton->attribute()->update(
    array (
        'attributeId' => 156,
        'attributeType' => Enum\AttributeType::TEXT,
        'attributeValidator' => Enum\AttributeValidator::NONE,
    )
);

// Alternatively, it is possible to retrieve Attribute first, set fields and save it
$attribute = $seliton->attribute()->retrieve(156);
$attribute->type = Enum\AttributeType::TEXT;
$attribute->validator = Enum\AttributeValidator::NONE;
$attribute->save();
?>
curl -X PUT "http://dev-1.myseliton.com/api/v1/attributes/156?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"attributeType": "text", "validator": "number"}'

The above command returns JSON structured like this:

{
    "attribute": {
        "attributeId": 156,
        "attributeName": {
            "EN": "Test",
            "TR": "",
            "RO": ""
        },
        "attributeUnit": {
            "EN": "Unit",
            "TR": "",
            "RO": ""
        },
        "attributeCode": "test",
        "attributeType": "text",
        "attributeValidator": "number",
        "attributeIsFilterable": true,
        "attributeFilterWidget": "text",
        "attributeFilterWidgetShowCounts": true,
        "attributeFilterWidgetHideIrrelevant": true,
        "attributeFilterMoveOutWhenApplied": false,
        "attributeIsSearchable": true,
        "attributeIsComparable": true,
        "attributeApplyToAllProducts": false,
        "attributeShowAfterDescription": true,
        "attributeShowInTab": false,
        "attributeShowInQuickView": true,
        "attributeShowOnHover": true,
        "attributeSort": 200
    }
}

This endpoint updates a specific attribute.

HTTP Request

PUT http://dev-1.myseliton.com/api/v1/attributes/<ID>

URL Parameters

Parameter Description
ID The ID of the attribute to update

Delete a Specific Attribute

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$attribute = $seliton->attribute()->retrieve(156);
$attribute->delete();
?>
curl -X DELETE "http://dev-1.myseliton.com/api/v1/attributes/156?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "id": 156
}

This endpoint deletes a specific attribute.

HTTP Request

DELETE http://dev-1.myseliton.com/api/v1/attributes/<ID>

URL Parameters

Parameter Description
ID The ID of the attribute to delete

Brands

These are the Brands of your Products. Each of your Products may or may not have an associated Brand.

Get All Brands

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

list ($brands, $count) = $seliton->brand()->all(array (
    'nameContains' => 'Top Brand',
    'limit' => 2,
    'offset' => 1,
    'fields' => 'brandId,brandName'
));
?>
curl "http://dev-1.myseliton.com/api/v1/brands?nameContains=Top%20Brand&limit=2&offset=1&fields=brandId,brandName&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "brands": [
        {
            "brandId": 498,
            "brandName": {
                "EN": "Top Brand 2",
                "TR": "",
                "RO": ""
            }
        },
        {
            "brandId": 499,
            "brandName": {
                "EN": "Top Brand 3",
                "TR": "",
                "RO": ""
            }
        }
    ],
    "_metadata": {
        "count": 3
    }
}

This endpoint retrieves all brands.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/brands

Query Parameters

Parameter Description
nameContains Brand name filter (substring).
limit Amount of Brands in a result.
offset Amount of Brands to skip from result.
fields Fields (comma separated) to be retrieved.

Get a Specific Brand

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$brand = $seliton->brand()->retrieve(498);
?>
curl "http://dev-1.myseliton.com/api/v1/brands/498?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "brand": {
        "brandId": 498,
        "brandName": {
            "EN": "Top Brand 2",
            "TR": "",
            "RO": ""
        },
        "brandDescription": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "brandImage": "http://dev-1.myseliton.com/topbrand2.jpg",
        "brandWebsite": "",
        "brandSEOTitle": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "brandSEOKeywords": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "brandSEODescription": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "brandImageWidth": 0,
        "brandImageHeight": 0,
        "brandSort": 1017,
        "brandProductCount": 0
    }
}

This endpoint retrieves a specific brand.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/brands/<ID>

URL Parameters

Parameter Description
ID The ID of the brand to retrieve

Create a Brand

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$brand = $seliton->brand()->create(
    array (
        'brandName' => array ('en' => 'Brand'),
        'brandDescription' => array ('en' => 'Description'),
        'brandSEOTitle' => array ('en' => 'SEO Title'),
        'brandSEOKeywords' => array ('en' => 'SEO Keywords'),
        'brandSEODescription' => array ('en' => 'SEO Description'),
        'brandWebsite' => 'brand.com',
        'brandImage' => 'brand.jpg',
        'brandSort' => 1000,
    )
);
?>
curl -X POST "http://dev-1.myseliton.com/api/v1/brands?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"brandName": {"en": "Brand"}, "brandDescription": {"en": "Description"}, "brandSEOTitle": {"en": "SEO Title"}, "brandSEOKeywords": {"en": "SEO Keywords"}, "brandSEODescription": {"en": "SEO Description"}, "brandWebsite": "brand.com", "brandImage": "brand.jpg", "brandSort": 1000}'

The above command returns JSON structured like this:

{
    "brandId": 501,
    "brandName": {
        "EN": "Brand",
        "TR": "",
        "RO": ""
    },
    "brandDescription": {
        "EN": "Description",
        "TR": "",
        "RO": ""
    },
    "brandImage": "http://dev-1.myseliton.com/brand.jpg",
    "brandWebsite": "brand.com",
    "brandSEOTitle": {
        "EN": "SEO Title",
        "TR": "",
        "RO": ""
    },
    "brandSEOKeywords": {
        "EN": "SEO Keywords",
        "TR": "",
        "RO": ""
    },
    "brandSEODescription": {
        "EN": "SEO Description",
        "TR": "",
        "RO": ""
    },
    "brandImageWidth": 0,
    "brandImageHeight": 0,
    "brandSort": 1000,
    "brandProductCount": 0
}

This endpoint creates a brand.

HTTP Request

POST http://dev-1.myseliton.com/api/v1/brands

POST JSON Parameters

Parameter Description
brandName The name of the Brand
brandDescription Description of the Brand
brandSEOTitle
brandSEOKeywords
brandSEODescription
brandWebsite
brandImage Optional image of the Brand
brandSort Specifies a sort index. In Seliton Brands will be sorted by this index in ascending order.

Update a Specific Brand

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

// Default method is to update Brand directly
$brand = $seliton->brand()->update(array (
    'brandId' => 501,
    'brandWebsite' => 'new-website.com',
    'brandImage' => 'new-image.jpg',
));

// Alternatively, it is possible to retrieve Brand first, set fields and save it
$brand = $seliton->brand()->retrieve(501);
$brand->website = "new-website.com";
$brand->image = "new-image.jpg";
$brand->save();
?>
curl -X PUT "http://dev-1.myseliton.com/api/v1/brands/501?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"brandWebsite": "new-website.com", "brandImage": "new-image.jpg"}'

The above command returns JSON structured like this:

{
    "brand": {
        "brandId": 501,
        "brandName": {
            "EN": "Brand",
            "TR": "",
            "RO": ""
        },
        "brandDescription": {
            "EN": "Description",
            "TR": "",
            "RO": ""
        },
        "brandImage": "http://dev-1.myseliton.com/new-image.jpg",
        "brandWebsite": "new-website.com",
        "brandSEOTitle": {
            "EN": "SEO Title",
            "TR": "",
            "RO": ""
        },
        "brandSEOKeywords": {
            "EN": "SEO Keywords",
            "TR": "",
            "RO": ""
        },
        "brandSEODescription": {
            "EN": "SEO Description",
            "TR": "",
            "RO": ""
        },
        "brandImageWidth": 200,
        "brandImageHeight": 150,
        "brandSort": 1001,
        "brandProductCount": 1
    }
}

This endpoint updates a specific brand.

HTTP Request

PUT http://dev-1.myseliton.com/api/v1/brands/<ID>

URL Parameters

Parameter Description
ID The ID of the brand to update

Delete a Specific Brand

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$brand = $seliton->brand()->retrieve(501);
$brand->delete();
?>
curl -X DELETE "http://dev-1.myseliton.com/api/v1/brands/501?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "id": 501
}

This endpoint deletes a specific brand.

HTTP Request

DELETE http://dev-1.myseliton.com/api/v1/brands/<ID>

URL Parameters

Parameter Description
ID The ID of the brand to delete

Categories

Categories can be organized into a hierarchical structure. Each Product is assigned a Category, and end-users may browse Products by Categories.

Get All Categories

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

list ($categories, $count) = $seliton->category()->all(array (
    'nameContains' => 'Top Category',
    'limit' => 2,
    'offset' => 1,
    'fields' => 'categoryId,categoryName'
));
?>
curl "http://dev-1.myseliton.com/api/v1/categories?nameContains=Top%20Category&limit=2&offset=1&fields=categoryId,categoryName&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "categories": [
        {
            "categoryId": 327,
            "categoryName": {
                "EN": "Top Category 2",
                "TR": "",
                "RO": ""
            }
        },
        {
            "categoryId": 328,
            "categoryName": {
                "EN": "Top Category 3",
                "TR": "",
                "RO": ""
            }
        }
    ],
    "_metadata": {
        "count": 3
    }
}

This endpoint retrieves all categories.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/categories

Query Parameters

Parameter Description
nameContains Category name filter (substring).
limit Amount of Categories in a result.
offset Amount of Categories to skip from result.
fields Fields (comma separated) to be retrieved.

Get a Specific Category

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$category = $seliton->category()->retrieve(327);
?>
curl "http://dev-1.myseliton.com/api/v1/categories/327?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "category": {
        "categoryId": 327,
        "categoryName": {
            "EN": "Top Category 2",
            "TR": "",
            "RO": ""
        },
        "categoryDescription": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "categorySEOTitle": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "categorySEOKeywords": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "categorySEODescription": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "categoryWebPosName": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "categoryParentID": null,
        "categoryProductCount": 0,
        "categoryDeepProductCount": 0,
        "categorySort": 1000279,
        "categoryOriginalImage": "",
        "categoryImage": "topcategory2.jpg",
        "categoryImageWidth": 0,
        "categoryImageHeight": 0,
        "categoryStatus": "visible",
        "categoryFeatured": false,
        "categoryIncludeProductsFromSubs": false,
        "categoryCssClass": "",
        "categoryWebPosActive": true,
        "categoryWebPosPosition": 1000,
        "categoryWebPosButtonColor": "",
        "categoryWebPosButtonTextColor": "",
        "categoryIconImage": "",
        "categoryIconImageWidth": 0,
        "categoryIconImageHeight": 0
    }
}

This endpoint retrieves a specific category.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/categories/<ID>

URL Parameters

Parameter Description
ID The ID of the category to retrieve

Create a Category

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$category = $seliton->category()->create(
    array (
        'categoryName' => array ('en' => 'Category'),
        'categoryDescription' => array ('en' => 'Description'),
        'categorySEOTitle' => array ('en' => 'SEO Title'),
        'categorySEOKeywords' => array ('en' => 'SEO Keywords'),
        'categorySEODescription' => array ('en' => 'SEO Description'),
        'categoryWebPosName' => array ('en' => 'Web Pos Name'),
        'categoryParentID' => 1,
        'categoryOriginalImage' => 'original.jpg',
        'categoryImage' => 'category.jpg',
        'categoryStatus' => 'visible',
        'categoryFeatured' => false,
        'categoryIncludeProductsFromSubs' => true,
        'categoryCssClass' => 'category',
        'categoryWebPosActive' => true,
        'categoryWebPosPosition' => 500,
        'categoryWebPosButtonColor' => 'red',
        'categoryWebPosButtonTextColor' => 'green',
        'categoryIconImage' => 'icon.jpg',
        'categorySort' => 1000,
    )
);
?>
curl -X POST "http://dev-1.myseliton.com/api/v1/categories?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"categoryName": {"en": "Category"}, "categoryDescription": {"en": "Description"}, "categorySEOTitle": {"en": "SEO Title"}, "categorySEOKeywords": {"en": "SEO Keywords"}, "categorySEODescription": {"en": "SEO Description"}, "categoryWebPosName": {"en": "Web Pos Name"}, "categoryParentID": 1, "categoryOriginalImage": "original.jpg", "categoryImage": "category.jpg", "categoryStatus": "visible", "categoryFeatured": false, "categoryIncludeProductsFromSubs": true, "categoryCssClass": "category", "categoryWebPosActive": true, "categoryWebPosPosition": 500, "categoryWebPosButtonColor": "red", "categoryWebPosButtonTextColor": "green", "categoryIconImage": "icon.jpg", "categorySort": 1000}'

The above command returns JSON structured like this:

{
    "categoryId": 329,
    "categoryName": {
        "EN": "Category",
        "TR": "",
        "RO": ""
    },
    "categoryDescription": {
        "EN": "Description",
        "TR": "",
        "RO": ""
    },
    "categorySEOTitle": {
        "EN": "SEO Title",
        "TR": "",
        "RO": ""
    },
    "categorySEOKeywords": {
        "EN": "SEO Keywords",
        "TR": "",
        "RO": ""
    },
    "categorySEODescription": {
        "EN": "SEO Description",
        "TR": "",
        "RO": ""
    },
    "categoryWebPosName": {
        "EN": "Web Pos Name",
        "TR": "",
        "RO": ""
    },
    "categoryParentID": 1,
    "categoryProductCount": 0,
    "categoryDeepProductCount": 0,
    "categorySort": 1000,
    "categoryOriginalImage": "original.jpg",
    "categoryImage": "category.jpg",
    "categoryImageWidth": 0,
    "categoryImageHeight": 0,
    "categoryStatus": "visible",
    "categoryFeatured": false,
    "categoryIncludeProductsFromSubs": true,
    "categoryCssClass": "category",
    "categoryWebPosActive": true,
    "categoryWebPosPosition": 500,
    "categoryWebPosButtonColor": "red",
    "categoryWebPosButtonTextColor": "green",
    "categoryIconImage": "icon.jpg",
    "categoryIconImageWidth": 0,
    "categoryIconImageHeight": 0
}

This endpoint creates a category.

HTTP Request

POST http://dev-1.myseliton.com/api/v1/categories

POST JSON Parameters

Parameter Description
categoryName The name of the category
categoryDescription Description of the category
categorySEOTitle
categorySEOKeywords
categorySEODescription
categoryWebPosName
categoryParentID The ID of the parent Category, if this is not a root Category
categoryOriginalImage
categoryImage Optional image of the category
categoryStatus
categoryFeatured
categoryIncludeProductsFromSubs
categoryCssClass
categoryWebPosActive
categoryWebPosPosition
categoryWebPosButtonColor
categoryWebPosButtonTextColor
categoryIconImage
categorySort Specifies a sort index. In Seliton categories will be sorted by this index in ascending order.

Update a Specific Category

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

// Default method is to update Category directly
$category = $seliton->category()->update(array (
    'categoryId' => 329,
    'categoryCssClass' => 'new-category',
    'categoryImage' => 'new-image.jpg',
));

// Alternatively, it is possible to retrieve Category first, set fields and save it
$category = $seliton->category()->retrieve(329);
$category->cssClass = "new-category";
$category->image = "new-image.jpg";
$category->save();
?>
curl -X PUT "http://dev-1.myseliton.com/api/v1/categories/329?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"categoryCssClass": "new-category", "categoryImage": "new-image.jpg"}'

The above command returns JSON structured like this:

{
    "category": {
        "categoryId": 329,
        "categoryName": {
            "EN": "Category",
            "TR": "",
            "RO": ""
        },
        "categoryDescription": {
            "EN": "Description",
            "TR": "",
            "RO": ""
        },
        "categorySEOTitle": {
            "EN": "SEO Title",
            "TR": "",
            "RO": ""
        },
        "categorySEOKeywords": {
            "EN": "SEO Keywords",
            "TR": "",
            "RO": ""
        },
        "categorySEODescription": {
            "EN": "SEO Description",
            "TR": "",
            "RO": ""
        },
        "categoryWebPosName": {
            "EN": "Web Pos Name",
            "TR": "",
            "RO": ""
        },
        "categoryParentID": 1,
        "categoryProductCount": 4,
        "categoryDeepProductCount": 5,
        "categorySort": 1000,
        "categoryOriginalImage": "original.jpg",
        "categoryImage": "new-image.jpg",
        "categoryImageWidth": 200,
        "categoryImageHeight": 150,
        "categoryStatus": "visible",
        "categoryFeatured": false,
        "categoryIncludeProductsFromSubs": true,
        "categoryCssClass": "new-category",
        "categoryWebPosActive": true,
        "categoryWebPosPosition": 500,
        "categoryWebPosButtonColor": "red",
        "categoryWebPosButtonTextColor": "green",
        "categoryIconImage": "icon.jpg",
        "categoryIconImageWidth": 300,
        "categoryIconImageHeight": 250
    }
}

This endpoint updates a specific category.

HTTP Request

PUT http://dev-1.myseliton.com/api/v1/categories/<ID>

URL Parameters

Parameter Description
ID The ID of the category to update

Delete a Specific Category

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$category = $seliton->category()->retrieve(329);
$category->delete();
?>
curl -X DELETE "http://dev-1.myseliton.com/api/v1/categories/329?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "id": 329
}

This endpoint deletes a specific category.

HTTP Request

DELETE http://dev-1.myseliton.com/api/v1/categories/<ID>

URL Parameters

Parameter Description
ID The ID of the category to delete

Customers

The Customers of your web store. They can either register directly from the web store, or be imported from your business system. Each Customer may have one or more physical addresses. Note that the email of a Customer is a unique string and a primary key in Seliton. If you have a Customer with certain email address in your system and a different Customer with the same email address already registered in Seliton, insert will fail because the email address is already in use. So when inserting Customers, search for their email addresses in Seliton first (use the Get All Customers method with an emailContains parameter) and if any of the Customers are found, change the insert operation to an update operation.

Get All Customers

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

list ($customers, $count) = $seliton->customer()->all(array (
    'emailContains' => 'Test',
    'limit' => 2,
    'offset' => 1,
    'fields' => 'customerId,customerEmail'
));
?>
curl "http://dev-1.myseliton.com/api/v1/customers?emailContains=Test&limit=2&offset=1&fields=customerId,customerEmail&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "customers": [
        {
            "customerId": 39,
            "customerEmail": "test.2@example.com"
        },
        {
            "customerId": 40,
            "customerEmail": "test.3@example.com"
        }
    ],
    "_metadata": {
        "count": 3
    }
}

This endpoint retrieves all customers.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/customers

Query Parameters

Parameter Description
emailContains Customer email filter (substring).
limit Amount of Customers in a result.
offset Amount of Customers to skip from result.
fields Fields (comma separated) to be retrieved.

Get a Specific Customer

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$customer = $seliton->customer()->retrieve(17);
?>
curl "http://dev-1.myseliton.com/api/v1/customers/17?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "customer": {
        "customerId": 17,
        "customerEmail": "solmazneriman@hotmail.com",
        "customerStatus": "active",
        "customerGroupID": 1,
        "customerBonusPoints": 0,
        "customerReferrerID": null,
        "customerAddresses": [
            {
                "customerAddressID": 22,
                "customerID": 17,
                "customerAddressIsDefaultBilling": true,
                "customerAddressIsDefaultShipping": true,
                "customerAddressFirstName": "Neriman",
                "customerAddressLastName": "Solmaz",
                "customerAddressCompany": "Solmaz Züccaciye",
                "customerAddressLine1": "Eskihisar ",
                "customerAddressLine2": "Egeli",
                "customerAddressCity": "Bozüyük",
                "cityID": null,
                "stateCode": "06",
                "countryCode": "tr",
                "customerAddressZip": "11300",
                "customerAddressPhone": "0532 233 3223",
                "customerAddressFax": "",
                "customerAddressVatNumber": "",
                "customerAddressTaxNumber": "568974",
                "customerAddressTaxOffice": "Bozuyük V.D.",
                "customerAddressPersonalNumber": "",
                "customerAddressInvoiceContactPerson": "",
                "customerAddressIsCompany": true,
                "customerAddressBankName": "",
                "customerAddressBankAccount": ""
            }
        ]
    }
}

This endpoint retrieves a specific customer.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/customers/<ID>

URL Parameters

Parameter Description
ID The ID of the customer to retrieve

Create a Customer

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;
use Seliton\Client\Resource\Enum;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$customer = $seliton->customer()->create(
    array (
    'customerEmail' => 'test@example.com',
    'customerPassword' => 'password',
    'customerStatus' => Enum\CustomerStatus::ACTIVE,
    'customerGroupID' => 1,
    'customerReferrerID' => null,
        'customerAddresses' => array (
            array (
                'customerAddressFirstName' => 'First1',
                'customerAddressLastName' => 'Last1',
                'countryCode' => 'tr',
                'stateCode' => '06',
            ),
            array (
                'customerAddressFirstName' => 'First2',
                'customerAddressLastName' => 'Last2',
                'countryCode' => 'tr',
                'stateCode' => '06',
            ),
        ),
    )
);
?>
curl -X POST "http://dev-1.myseliton.com/api/v1/customers?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"customerEmail":"test@example.com", "customerPassword":"password", "customerStatus":"active", "customerGroupID":1, "customerReferrerID":null, "customerAddresses":[{"customerAddressFirstName":"First1", "customerAddressLastName":"Last1", "countryCode":"tr", "stateCode":"06"},{"customerAddressFirstName":"First2", "customerAddressLastName":"Last2", "countryCode":"tr", "stateCode":"06"}]}'

The above command returns JSON structured like this:

{
    "customerId": 136,
    "customerEmail": "test@example.com",
    "customerStatus": "active",
    "customerGroupID": 1,
    "customerBonusPoints": 0,
    "customerReferrerID": null,
    "customerAddresses": [
        {
            "customerAddressID": 102,
            "customerID": 136,
            "customerAddressIsDefaultBilling": false,
            "customerAddressIsDefaultShipping": false,
            "customerAddressFirstName": "First1",
            "customerAddressLastName": "Last1",
            "customerAddressCompany": "",
            "customerAddressLine1": "",
            "customerAddressLine2": "",
            "customerAddressCity": "",
            "cityID": null,
            "stateCode": "06",
            "countryCode": "tr",
            "customerAddressZip": "",
            "customerAddressPhone": "",
            "customerAddressFax": "",
            "customerAddressVatNumber": "",
            "customerAddressTaxNumber": "",
            "customerAddressTaxOffice": "",
            "customerAddressPersonalNumber": "",
            "customerAddressInvoiceContactPerson": "",
            "customerAddressIsCompany": false,
            "customerAddressBankName": "",
            "customerAddressBankAccount": ""
        },
        {
            "customerAddressID": 103,
            "customerID": 136,
            "customerAddressIsDefaultBilling": false,
            "customerAddressIsDefaultShipping": false,
            "customerAddressFirstName": "First2",
            "customerAddressLastName": "Last2",
            "customerAddressCompany": "",
            "customerAddressLine1": "",
            "customerAddressLine2": "",
            "customerAddressCity": "",
            "cityID": null,
            "stateCode": "06",
            "countryCode": "tr",
            "customerAddressZip": "",
            "customerAddressPhone": "",
            "customerAddressFax": "",
            "customerAddressVatNumber": "",
            "customerAddressTaxNumber": "",
            "customerAddressTaxOffice": "",
            "customerAddressPersonalNumber": "",
            "customerAddressInvoiceContactPerson": "",
            "customerAddressIsCompany": false,
            "customerAddressBankName": "",
            "customerAddressBankAccount": ""
        }
    ]
}

This endpoint creates a customer.

HTTP Request

POST http://dev-1.myseliton.com/api/v1/customers

POST JSON Parameters

Parameter Description
customerEmail The email of the Customer. Must be a unique string.
customerPassword The password of the Customer’s Seliton account. Passwords are not returned by the API service. You can modify them with an update operation.
customerStatus The status of the Customer, "active" or "disabled".
customerGroupID The ID of the Customer’s group in Seliton. Optional.
customerReferrerID The ID of the Customer’s referrer Customer. Optional.
customerAddresses Customer Addresses collection.

Customer Addresses

Represents an Address of a Customer. Each Customer may have one or more Addresses, with different identities (first name, last name, company, etc.) on each Address. One of the Addresses must be marked as default for billing, and one as default for shipping (these can be the same Address).

customerAddresses parameter Description
customerAddressIsDefaultBilling Specifies whether this is the default billing Address.
customerAddressIsDefaultShipping Specifies whether this is the default shipping Address.
customerAddressFirstName The first name of the Customer on this Address.
customerAddressLastName The last name of the Customer on this Address.
customerAddressCompany The company of the Customer on this Address.
customerAddressLine1 The first line of the Address.
customerAddressLine2 The second line of the Address.
customerAddressCity The city of the Customer Address.
cityID
stateCode The state code of the Customer Address.
countryCode The ISO 3166-1 Alpha2 country code of the Customer Address.
customerAddressZip
customerAddressPhone The phone of the Customer on this Address.
customerAddressFax The fax of the Customer on this Address.
customerAddressVatNumber The VAT number of the Customer on this Address.
customerAddressTaxNumber
customerAddressTaxOffice
customerAddressPersonalNumber
customerAddressInvoiceContactPerson
customerAddressIsCompany
customerAddressBankName
customerAddressBankAccount

Update a Specific Customer

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

// Default method is to update Customer directly
$customer = $seliton->customer()->update(array (
    'customerId' => 136,
    'customerEmail' => 'updated.test@example.com',
    'customerStatus' => 'disabled',
));

// Alternatively, it is possible to retrieve Customer first, set fields and save it
$customer = $seliton->customer()->retrieve(136);
$customer->email = 'updated.test@example.com';
$customer->status = 'disabled';
$customer->save();
?>
curl -X PUT "http://dev-1.myseliton.com/api/v1/customers/136?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"customerEmail": "updated.test@example.com", "customerStatus": "disabled"}'

The above command returns JSON structured like this:

{
    "customer": {
        "customerId": 136,
        "customerEmail": "updated.test@example.com",
        "customerStatus": "disabled",
        "customerGroupID": 1,
        "customerBonusPoints": 0,
        "customerReferrerID": null,
        "customerAddresses": [
            {
                "customerAddressID": 102,
                "customerID": 136,
                "customerAddressIsDefaultBilling": false,
                "customerAddressIsDefaultShipping": false,
                "customerAddressFirstName": "First1",
                "customerAddressLastName": "Last1",
                "customerAddressCompany": "",
                "customerAddressLine1": "",
                "customerAddressLine2": "",
                "customerAddressCity": "",
                "cityID": null,
                "stateCode": "06",
                "countryCode": "tr",
                "customerAddressZip": "",
                "customerAddressPhone": "",
                "customerAddressFax": "",
                "customerAddressVatNumber": "",
                "customerAddressTaxNumber": "",
                "customerAddressTaxOffice": "",
                "customerAddressPersonalNumber": "",
                "customerAddressInvoiceContactPerson": "",
                "customerAddressIsCompany": false,
                "customerAddressBankName": "",
                "customerAddressBankAccount": ""
            },
            {
                "customerAddressID": 103,
                "customerID": 136,
                "customerAddressIsDefaultBilling": false,
                "customerAddressIsDefaultShipping": false,
                "customerAddressFirstName": "First2",
                "customerAddressLastName": "Last2",
                "customerAddressCompany": "",
                "customerAddressLine1": "",
                "customerAddressLine2": "",
                "customerAddressCity": "",
                "cityID": null,
                "stateCode": "06",
                "countryCode": "tr",
                "customerAddressZip": "",
                "customerAddressPhone": "",
                "customerAddressFax": "",
                "customerAddressVatNumber": "",
                "customerAddressTaxNumber": "",
                "customerAddressTaxOffice": "",
                "customerAddressPersonalNumber": "",
                "customerAddressInvoiceContactPerson": "",
                "customerAddressIsCompany": false,
                "customerAddressBankName": "",
                "customerAddressBankAccount": ""
            }
        ]
    }
}

This endpoint updates a specific customer.

HTTP Request

PUT http://dev-1.myseliton.com/api/v1/customers/<ID>

URL Parameters

Parameter Description
ID The ID of the customer to update

Delete a Specific Customer

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$customer = $seliton->customer()->retrieve(41);
$customer->delete();
?>
curl -X DELETE "http://dev-1.myseliton.com/api/v1/customers/41?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "id": 41
}

This endpoint deletes a specific customer.

HTTP Request

DELETE http://dev-1.myseliton.com/api/v1/customers/<ID>

URL Parameters

Parameter Description
ID The ID of the customer to delete

Orders

Orders placed by Customers on your web store. An Order may contain one or more Order Items (referencing Products) and Order Total Lines (with summaries).

Get All Orders

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

list ($orders, $count) = $seliton->order()->all(array (
    'limit' => 2,
    'offset' => 1,
    'fields' => 'orderId,orderInvoiceDate',
    'order' => 'orderId:desc'
));
?>
curl "http://dev-1.myseliton.com/api/v1/orders?limit=2&offset=1&fields=orderId,orderInvoiceDate&order=orderId:desc&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "orders": [
        {
            "orderId": 2052,
            "orderInvoiceDate": "0000-00-00"
        },
        {
            "orderId": 2051,
            "orderInvoiceDate": "0000-00-00"
        }
    ],
    "_metadata": {
        "count": 284
    }
}

This endpoint retrieves all orders.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/orders

Query Parameters

Parameter Description
limit Amount of Orders in a result.
offset Amount of Orders to skip from result.
fields Fields (comma separated) to be retrieved.
order Sort order of Orders in a result optionally separated by colon (:) with sort direction (asc or desc, asc by default).

Fields available for order parameter

Field Description
orderId Order ID.
orderCreatedAt Order creation date/time.
orderCustomerEmail E-mail address of a Customer, who made the Order.
customerID ID of a Customer, who made the Order.

Get a Specific Order

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$order = $seliton->order()->retrieve(2051);
?>
curl "http://dev-1.myseliton.com/api/v1/orders/2051?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "order": {
        "orderId": 2051,
        "orderInvoiceNumber": null,
        "orderInvoicePreparedBy": "",
        "orderInvoiceDate": "0000-00-00",
        "orderCreatedAt": "2010-10-11T09:38:40+00:00",
        "orderIPAddress": "10.200.200.30",
        "orderIsDirectPayment": false,
        "orderStatus": "unfinished",
        "orderPaymentStatus": "offline",
        "orderLanguageCode": "EN",
        "orderCustomerInstructions": "",
        "orderCustomerEmail": "guest@nest.bg",
        "customerID": 1,
        "orderCustomerReferringHash": "",
        "shippingModuleID": 2,
        "orderShippingMethodCode": "I1",
        "orderShippingTrackingNo": "",
        "orderShippingNotes": "",
        "orderShippingModuleName": "USPS",
        "orderCustomerLanguageShippingModuleName": "USPS",
        "orderShippingMethodName": "USPS Express Mail International (EMS)",
        "orderCustomerLanguageShippingMethodName": "USPS Express Mail International (EMS)",
        "paymentModuleID": 8,
        "orderPaymentModuleName": "Collect on delivery",
        "orderCustomerLanguagePaymentModuleName": "Collect on delivery",
        "orderPaymentModuleIntegration": "",
        "orderPaymentNotes": "",
        "orderPaymentTransactionNo": "",
        "checkoutModuleID": 1,
        "orderCheckoutModuleName": "Wizard Checkout",
        "orderCustomerLanguageCheckoutModuleName": "Wizard Checkout",
        "orderBillingFirstName": "Amaru",
        "orderBillingLastName": "Shakur",
        "orderBillingCompany": "",
        "orderBillingPhone": "0883",
        "orderBillingFax": "",
        "orderBillingAddress1": "home sweet home",
        "orderBillingAddress2": "",
        "orderBillingCity": "GT",
        "orderBillingCityID": 0,
        "orderBillingState": "",
        "orderBillingCustomerLanguageState": "",
        "orderBillingStateCode": "",
        "orderBillingCountry": "Kazakhstan",
        "orderBillingCustomerLanguageCountry": "Kazakhstan",
        "orderBillingCountryCode2": "KZ",
        "orderBillingZip": "1421",
        "orderBillingVatNumber": "",
        "orderBillingTaxNumber": "",
        "orderBillingTaxOffice": "",
        "orderBillingPersonalNumber": "",
        "orderBillingInvoiceContactPerson": "",
        "orderBillingIsCompany": false,
        "orderBillingBankName": "",
        "orderBillingBankAccount": "",
        "orderShipToBillingAddress": true,
        "orderShippingFirstName": "Amaru",
        "orderShippingLastName": "Shakur",
        "orderShippingCompany": "",
        "orderShippingPhone": "0883",
        "orderShippingFax": "",
        "orderShippingAddress1": "home sweet home",
        "orderShippingAddress2": "",
        "orderShippingCity": "GT",
        "orderShippingCityID": 0,
        "orderShippingState": "",
        "orderShippingCustomerLanguageState": "",
        "orderShippingStateCode": "",
        "orderShippingCountry": "Kazakhstan",
        "orderShippingCustomerLanguageCountry": "Kazakhstan",
        "orderShippingCountryCode2": "KZ",
        "orderShippingZip": "1421",
        "orderShippingVatNumber": "",
        "orderCouponCode": "",
        "orderTotal": 625.75,
        "orderCurrencyCode": "USD",
        "orderTotalPayAmount": 625.75,
        "orderTotalPayCurrencyCode": "USD",
        "orderQuantitiesInStockReduced": false,
        "orderCustomerCurrencyCode": "USD",
        "orderCustomerCurrencyTotal": 625.75,
        "orderDiscountFreeShipping": false,
        "orderTerms": "",
        "orderItems": [
            {
                "orderItemID": 2986,
                "orderID": 2051,
                "parentOrderItemID": null,
                "productID": 25,
                "productVariantID": null,
                "productImageID": 99,
                "orderItemProductCode": "ELECTRONICS_CONSOLE_XBOX360",
                "orderItemProductName": "XBOX 360 Halo 3 Special Edition Package",
                "orderItemCustomerLanguageProductName": "XBOX 360 Halo 3 Special Edition Package",
                "orderItemCategoryName": "Game Consoles",
                "orderItemCustomerLanguageCategoryName": "Game Consoles",
                "orderItemBrandName": "",
                "orderItemCustomerLanguageBrandName": "",
                "orderItemQty": 1,
                "orderItemDiscount": 0,
                "orderItemPrice": 524.95,
                "orderItemDistributorPrice": 0,
                "orderItemTotal": 524.95,
                "orderItemTaxesAmount": 0,
                "orderItemTaxesRate": 0,
                "orderItemCustomerCurrencyDiscount": 0,
                "orderItemCustomerCurrencyPrice": 524.95,
                "orderItemCustomerCurrencyTotal": 524.95,
                "orderItemCustomerCurrencyTaxesAmount": 0,
                "orderItemBonusPointsSpent": 0,
                "shippingModuleID": 2,
                "orderItemShippingMethodCode": "I1",
                "orderItemShippingModuleName": "USPS",
                "orderItemCustomerLanguageShippingModuleName": "USPS",
                "orderItemShippingMethodName": "USPS Express Mail International (EMS)",
                "orderItemCustomerLanguageShippingMethodName": "USPS Express Mail International (EMS)",
                "vendorID": null,
                "orderItemVendorName": "",
                "vendorOrderID": null,
                "vendorOrderCreateTimestamp": null,
                "orderItemOriginalProductCode": ""
            }
        ],
        "orderTotalLines": [
            {
                "orderTotalLineID": 4003,
                "orderID": 2051,
                "orderTotalLineType": "subtotal",
                "orderTotalLineName": "Subtotal",
                "orderTotalLineCustomerLanguageName": "Subtotal",
                "orderTotalLineAmount": 524.95,
                "orderTotalLineCustomerCurrencyAmount": 524.95,
                "orderTotalLineSort": 0
            },
            {
                "orderTotalLineID": 4004,
                "orderID": 2051,
                "orderTotalLineType": "shipping",
                "orderTotalLineName": "Shipping",
                "orderTotalLineCustomerLanguageName": "Shipping",
                "orderTotalLineAmount": 80.3,
                "orderTotalLineCustomerCurrencyAmount": 80.3,
                "orderTotalLineSort": 1
            },
            {
                "orderTotalLineID": 4005,
                "orderID": 2051,
                "orderTotalLineType": "surcharge",
                "orderTotalLineName": "C.O.D. fee",
                "orderTotalLineCustomerLanguageName": "C.O.D. fee",
                "orderTotalLineAmount": 20.5,
                "orderTotalLineCustomerCurrencyAmount": 20.5,
                "orderTotalLineSort": 2
            }
        ]
    }
}

This endpoint retrieves a specific order.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/orders/<ID>

URL Parameters

Parameter Description
ID The ID of the order to retrieve

JSON Response Fields

Field Description
orderId The ID of the Order in Seliton.
orderInvoiceNumber
orderInvoicePreparedBy
orderInvoiceDate
orderCreatedAt The date and time the Order was placed.
orderIPAddress
orderIsDirectPayment
orderStatus The Order Status code. Seliton has a number of predefined Order Statuses that cannot be deleted, and the user is allowed to define more Statuses that are specific to his web store. Typically an application needs to only handle the predefined statuses. For user defined Statuses you will see Order Status ID instead of code ("56" for example).
orderPaymentStatus The Payment Status of the Order.
orderLanguageCode
orderCustomerInstructions Instructions given by the Customer.
orderCustomerEmail The email of the Customer.
customerID
orderCustomerReferringHash
shippingModuleID
orderShippingMethodCode
orderShippingTrackingNo Shipping tracking number, if one is available.
orderShippingNotes
orderShippingModuleName The name of the shipping module.
orderCustomerLanguageShippingModuleName
orderShippingMethodName
orderCustomerLanguageShippingMethodName The name of the shipping method.
paymentModuleID
orderPaymentModuleName The name of the payment module.
orderCustomerLanguagePaymentModuleName
orderPaymentModuleIntegration The name of the payment module integration.
orderPaymentNotes
orderPaymentTransactionNo Payment transaction number.
checkoutModuleID
orderCheckoutModuleName The name of the checkout module.
orderCustomerLanguageCheckoutModuleName
orderBillingFirstName
orderBillingLastName
orderBillingCompany
orderBillingPhone
orderBillingFax
orderBillingAddress1
orderBillingAddress2
orderBillingCity
orderBillingCityID
orderBillingState
orderBillingCustomerLanguageState
orderBillingStateCode
orderBillingCountry
orderBillingCustomerLanguageCountry
orderBillingCountryCode2
orderBillingZip
orderBillingVatNumber
orderBillingTaxNumber
orderBillingTaxOffice
orderBillingPersonalNumber
orderBillingInvoiceContactPerson
orderBillingIsCompany
orderBillingBankName
orderBillingBankAccount
orderShipToBillingAddress
orderShippingFirstName
orderShippingLastName
orderShippingCompany
orderShippingPhone
orderShippingFax
orderShippingAddress1
orderShippingAddress2
orderShippingCity
orderShippingCityID
orderShippingState
orderShippingCustomerLanguageState
orderShippingStateCode
orderShippingCountry
orderShippingCustomerLanguageCountry
orderShippingCountryCode2
orderShippingZip
orderShippingVatNumber
orderCouponCode Coupon code if one is used.
orderTotal The total amount of the Order.
orderCurrencyCode The code of the currency used.
orderTotalPayAmount Total amount to be paid for the Order.
orderTotalPayCurrencyCode The code of the total pay amount currency.
orderQuantitiesInStockReduced
orderCustomerCurrencyCode The code of the currency used by the Customer.
orderCustomerCurrencyTotal The total amount of the Order in the currency used by the Customer.
orderDiscountFreeShipping
orderTerms
orderItems Order Items.
orderTotalLines Order Total Lines.

Order Statuses

Status Code Description
Unfinished unfinished The Order is not yet finished
Payment Failed payment_failed The payment of the Order failed
Payment Pending payment_pending The Order was placed and processed by the operator, but not yet paid
New new_order The Order was placed by the Customer, but not yet processed
In Progress in_progress The Order is being processed by the operator
Cancelled cancelled The Order was cancelled
On Hold on_hold The Order is on hold
Delivered delivered The Order was delivered
Returned returned The Order was returned by the Customer
Queued queued The Order was queued for later processing
Quick Buy quick_buy

Order Payment Statuses

Code Description
none No payment has been made
at_processor We are waiting for the payment processor
declined Payment was declined
pending Received payment pending from processor
auth Received authorization confirmation from processor
capture Received capture confirmation from processor
partial_refund Payment partially refunded
refund Payment refunded
chargeback Payment charged back
other Unknown Payment Status received from processor
offline The payment will happen offline
partial_capture Some of the amount has been captured
void Payment voided

Order Items

Order items that represent an ordered Product with its quantity.

Field Description
orderItemID The ID of the Order Item in Seliton.
orderID
parentOrderItemID
productID
productVariantID
productImageID
orderItemProductCode The code of the Product.
orderItemProductName The name of the Product.
orderItemCustomerLanguageProductName
orderItemCategoryName The name of the Product Category.
orderItemCustomerLanguageCategoryName
orderItemBrandName
orderItemCustomerLanguageBrandName
orderItemQty
orderItemDiscount The discount per unit for this Order Item in the store currency.
orderItemPrice The unit price of the Product in the store currency.
orderItemDistributorPrice
orderItemTotal
orderItemTaxesAmount
orderItemTaxesRate
orderItemCustomerCurrencyDiscount The discount per unit for this Order Item in the currency selected by the Customer.
orderItemCustomerCurrencyPrice The unit price of the Product in the currency selected by the Customer.
orderItemCustomerCurrencyTotal
orderItemCustomerCurrencyTaxesAmount
orderItemBonusPointsSpent
shippingModuleID
orderItemShippingMethodCode
orderItemShippingModuleName
orderItemCustomerLanguageShippingModuleName
orderItemShippingMethodName
orderItemCustomerLanguageShippingMethodName
vendorID
orderItemVendorName
vendorOrderID
vendorOrderCreateTimestamp
orderItemOriginalProductCode

Order Total Lines

Lines of text displayed at the end of an Order that would typically contain total amounts and other summaries.

Field Description
orderTotalLineID The ID of the Order Total Line in Seliton.
orderID
orderTotalLineType The type of total line.
orderTotalLineName The text displayed on the Total Line.
orderTotalLineCustomerLanguageName
orderTotalLineAmount The amount of the Total Line.
orderTotalLineCustomerCurrencyAmount The amount of the Total Line in the currency selected by the Customer.
orderTotalLineSort Sort index.

Pages

Get All Pages

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

list ($pages, $count) = $seliton->page()->all(array (
    'titleContains' => 'Test',
    'limit' => 2,
    'offset' => 1,
    'fields' => 'pageId,pageTitle'
));
?>
curl "http://dev-1.myseliton.com/api/v1/pages?titleContains=Test&limit=2&offset=1&fields=pageId,pageTitle&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "pages": [
        {
            "pageId": 44,
            "pageTitle": {
                "EN": "Test 2",
                "TR": "",
                "RO": ""
            }
        },
        {
            "pageId": 45,
            "pageTitle": {
                "EN": "Test 3",
                "TR": "",
                "RO": ""
            }
        }
    ],
    "_metadata": {
        "count": 3
    }
}

This endpoint retrieves all pages.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/pages

Query Parameters

Parameter Description
titleContains Page title filter (substring).
limit Amount of Pages in a result.
offset Amount of Pages to skip from result.
fields Fields (comma separated) to be retrieved.

Get a Specific Page

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$page = $seliton->page()->retrieve(44);
?>
curl "http://dev-1.myseliton.com/api/v1/pages/44?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "page": {
        "pageId": 44,
        "pageTitle": {
            "EN": "Test 2",
            "TR": "",
            "RO": ""
        },
        "pageContent": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "pageSEOTitle": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "pageSEOKeywords": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "pageSEODescription": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "pageCssClass": "test-2",
        "pageUpdateTimestamp": "2015-12-29T19:00:23+00:00",
        "pageIsActive": true
    }
}

This endpoint retrieves a specific page.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/pages/<ID>

URL Parameters

Parameter Description
ID The ID of the page to retrieve

Create a Page

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$page = $seliton->page()->create(
    array (
    'pageTitle' => array ('en' => 'Test'),
    'pageContent' => array ('en' => 'Content'),
    'pageSEOTitle' => array ('en' => 'SEO Title'),
    'pageSEOKeywords' => array ('en' => 'SEO Keywords'),
    'pageSEODescription' => array ('en' => 'SEO Description'),
    'pageCssClass' => 'test',
    'pageIsActive' => true,
    )
);
?>
curl -X POST "http://dev-1.myseliton.com/api/v1/pages?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"pageTitle": {"en": "Test"}, "pageContent": {"en": "Content"}, "pageSEOTitle": {"en": "SEO Title"}, "pageSEOKeywords": {"en": "SEO Keywords"}, "pageSEODescription": {"en": "SEO Description"}, "pageCssClass": "test", "pageIsActive": true}'

The above command returns JSON structured like this:

{
    "pageId": 46,
    "pageTitle": {
        "EN": "Test",
        "TR": "",
        "RO": ""
    },
    "pageContent": {
        "EN": "Content",
        "TR": "",
        "RO": ""
    },
    "pageSEOTitle": {
        "EN": "SEO Title",
        "TR": "",
        "RO": ""
    },
    "pageSEOKeywords": {
        "EN": "SEO Keywords",
        "TR": "",
        "RO": ""
    },
    "pageSEODescription": {
        "EN": "SEO Description",
        "TR": "",
        "RO": ""
    },
    "pageCssClass": "test",
    "pageUpdateTimestamp": "2015-12-30T12:47:12+00:00",
    "pageIsActive": true
}

This endpoint creates a page.

HTTP Request

POST http://dev-1.myseliton.com/api/v1/pages

POST JSON Parameters

Parameter Description
pageTitle
pageContent
pageSEOTitle
pageSEOKeywords
pageSEODescription
pageCssClass
pageIsActive

Update a Specific Page

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

// Default method is to update Page directly
$page = $seliton->page()->update(array (
    'pageId' => 46,
    'pageCssClass' => 'updated-test',
    'pageIsActive' => false,
));

// Alternatively, it is possible to retrieve Page first, set fields and save it
$page = $seliton->page()->retrieve(46);
$page->cssClass = "updated-test";
$page->isActive = false;
$page->save();
?>
curl -X PUT "http://dev-1.myseliton.com/api/v1/pages/46?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"pageCssClass": "updated-test", "pageIsActive": false}'

The above command returns JSON structured like this:

{
    "page": {
        "pageId": 46,
        "pageTitle": {
            "EN": "Test",
            "TR": "",
            "RO": ""
        },
        "pageContent": {
            "EN": "Content",
            "TR": "",
            "RO": ""
        },
        "pageSEOTitle": {
            "EN": "SEO Title",
            "TR": "",
            "RO": ""
        },
        "pageSEOKeywords": {
            "EN": "SEO Keywords",
            "TR": "",
            "RO": ""
        },
        "pageSEODescription": {
            "EN": "SEO Description",
            "TR": "",
            "RO": ""
        },
        "pageCssClass": "updated-test",
        "pageUpdateTimestamp": "2015-12-30T12:52:05+00:00",
        "pageIsActive": false
    }
}

This endpoint updates a specific page.

HTTP Request

PUT http://dev-1.myseliton.com/api/v1/pages/<ID>

URL Parameters

Parameter Description
ID The ID of the page to update

Delete a Specific Page

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$page = $seliton->page()->retrieve(46);
$page->delete();
?>
curl -X DELETE "http://dev-1.myseliton.com/api/v1/pages/46?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "id": 46
}

This endpoint deletes a specific page.

HTTP Request

DELETE http://dev-1.myseliton.com/api/v1/pages/<ID>

URL Parameters

Parameter Description
ID The ID of the page to delete

Products

These are the Products you sell in your web store. Each Product falls into a certain Category, and has a number of built-in properties, such as code, name, price, weight and quantity.

Get All Products

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

list ($products, $count) = $seliton->product()->all(array (
    'nameContains' => 'Test',
    'limit' => 2,
    'offset' => 1,
    'fields' => 'productId,productName'
));
?>
curl "http://dev-1.myseliton.com/api/v1/products?nameContains=Test&limit=2&offset=1&fields=productId,productName&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "products": [
        {
            "productId": 920,
            "productName": {
                "EN": "Test 2",
                "TR": "",
                "RO": ""
            }
        },
        {
            "productId": 921,
            "productName": {
                "EN": "Test 3",
                "TR": "",
                "RO": ""
            }
        }
    ],
    "_metadata": {
        "count": 3
    }
}

This endpoint retrieves all products.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/products

Query Parameters

Parameter Description
nameContains Product name filter (substring).
limit Amount of Products in a result.
offset Amount of Products to skip from result.
fields Fields (comma separated) to be retrieved.

Get a Specific Product

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$product = $seliton->product()->retrieve(920);
?>
curl "http://dev-1.myseliton.com/api/v1/products/920?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "product": {
        "productId": 920,
        "productName": {
            "EN": "Test 2",
            "TR": "",
            "RO": ""
        },
        "productDescription": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "productDetailedDescription": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "productPageTitle": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "productMetaKeywords": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "productMetaDescription": {
            "EN": "",
            "TR": "",
            "RO": ""
        },
        "brandID": null,
        "productIsActive": false,
        "productAvailabilityStatus": "out_of_stock",
        "availabilityLabelID": null,
        "productCode": "test_2",
        "productBarcode": null,
        "productNameXHTML": false,
        "productDescriptionXHTML": false,
        "productDetailedDescriptionXHTML": false,
        "productHomePageFeatured": false,
        "productHomePageFeaturedFromCategory": false,
        "productPrice": 0,
        "productDistributorPrice": 0,
        "productWeight": 0,
        "productQuantity": 0,
        "productCreatedTimestamp": "2015-12-29T19:00:37+00:00",
        "productBonusPointsMode": "money_only",
        "productBonusPointsPrice": null,
        "productIsNew": false,
        "productFeaturedStyle": "normal",
        "productImages": [

        ],
        "productCategories": [
            {
                "categoryID": 4
            }
        ]
    }
}

This endpoint retrieves a specific product.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/products/<ID>

URL Parameters

Parameter Description
ID The ID of the product to retrieve

Create a Product

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$product = $seliton->product()->create(
    array (
    'productName' => array ('en' => 'Test'),
    'productDescription' => array ('en' => 'Test Description'),
    'productDetailedDescription' => array ('en' => 'Test Detailed Description'),
    'productPageTitle' => array ('en' => 'Test Page Tile'),
    'productMetaKeywords' => array ('en' => 'Test Meta Keywords'),
    'productMetaDescription' => array ('en' => 'Test Meta Description'),
    'brandID' => 1,
    'productIsActive' => true,
    'productAvailabilityStatus' => ProductAvailabilityStatus::IN_STOCK,
    'availabilityLabelID' => null,
    'productCode' => 'test',
    'productBarcode' => null,
    'productNameXHTML' => false,
    'productDescriptionXHTML' => false,
    'productDetailedDescriptionXHTML' => false,
    'productCategories' => array (
            array ('categoryID' => 4),
            array ('categoryID' => 2),
        ),
    'productHomePageFeatured' => false,
    'productHomePageFeaturedFromCategory' => false,
    'productPrice' => 500,
    'productDistributorPrice' => 300,
    'productWeight' => 4,
    'productQuantity' => 6,
    'productBonusPointsMode' => ProductBonusPointsMode::MONEY_ONLY,
    'productBonusPointsPrice' => null,
    'productIsNew' => false,
    'productFeaturedStyle' => ProductFeaturedStyle::NORMAL,
    'productImages' => array (
            array (
                'productImage' => 'image_1.jpg',
                'productImageFeaturedStyle' => ProductFeaturedStyle::NORMAL
            ),
            array (
                'productImage' => 'image_2.jpg',
                'productImageFeaturedStyle' => ProductFeaturedStyle::DOUBLE_WIDTH
            ),
        ),
    )
);
?>
curl -X POST "http://dev-1.myseliton.com/api/v1/products?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"productName": {"en":"Test"}, "productDescription": {"en":"Test Description"}, "productDetailedDescription": {"en":"Test Detailed Description"}, "productPageTitle": {"en":"Test Page Tile"}, "productMetaKeywords": {"en":"Test Meta Keywords"}, "productMetaDescription": {"en":"Test Meta Description"}, "brandID":1, "productIsActive":true, "productAvailabilityStatus":"in_stock", "availabilityLabelID":null, "productCode":"test", "productBarcode":null, "productNameXHTML":false, "productDescriptionXHTML":false, "productDetailedDescriptionXHTML":false, "productCategories": [{"categoryID":4}, {"categoryID":2}], "productHomePageFeatured":false, "productHomePageFeaturedFromCategory":false, "productPrice":500, "productDistributorPrice":300, "productWeight":4, "productQuantity":6, "productBonusPointsMode":"money_only", "productBonusPointsPrice":null, "productIsNew":false, "productFeaturedStyle":"normal", "productImages": [{"productImage":"image_1.jpg", "productImageFeaturedStyle":"normal"}, {"productImage":"image_2.jpg", "productImageFeaturedStyle":"double_width"}]}'

The above command returns JSON structured like this:

{
    "productId": 1033,
    "productName": {
        "EN": "Test",
        "TR": "",
        "RO": ""
    },
    "productDescription": {
        "EN": "Test Description",
        "TR": "",
        "RO": ""
    },
    "productDetailedDescription": {
        "EN": "Test Detailed Description",
        "TR": "",
        "RO": ""
    },
    "productPageTitle": {
        "EN": "Test Page Tile",
        "TR": "",
        "RO": ""
    },
    "productMetaKeywords": {
        "EN": "Test Meta Keywords",
        "TR": "",
        "RO": ""
    },
    "productMetaDescription": {
        "EN": "Test Meta Description",
        "TR": "",
        "RO": ""
    },
    "brandID": 1,
    "productIsActive": true,
    "productAvailabilityStatus": "in_stock",
    "availabilityLabelID": null,
    "productCode": "test",
    "productBarcode": null,
    "productNameXHTML": false,
    "productDescriptionXHTML": false,
    "productDetailedDescriptionXHTML": false,
    "productHomePageFeatured": false,
    "productHomePageFeaturedFromCategory": false,
    "productPrice": 500,
    "productDistributorPrice": 300,
    "productWeight": 4,
    "productQuantity": 6,
    "productCreatedTimestamp": "2016-01-04T01:32:17+00:00",
    "productBonusPointsMode": "money_only",
    "productBonusPointsPrice": null,
    "productIsNew": false,
    "productFeaturedStyle": "normal",
    "productImages": [
        {
            "productImageID": 2640,
            "productImage": "image_1.jpg",
            "productImageWidth": 0,
            "productImageHeight": 0,
            "productImageSize": 0,
            "productImageSort": 1,
            "productImageFeaturedStyle": "normal"
        },
        {
            "productImageID": 2641,
            "productImage": "image_2.jpg",
            "productImageWidth": 0,
            "productImageHeight": 0,
            "productImageSize": 0,
            "productImageSort": 2,
            "productImageFeaturedStyle": "double_width"
        }
    ],
    "productCategories": [
        {
            "categoryID": 4
        },
        {
            "categoryID": 2
        }
    ]
}

This endpoint creates a product.

HTTP Request

POST http://dev-1.myseliton.com/api/v1/products

POST JSON Parameters

Parameter Description
productName The name of the Product.
productDescription Description of the Product.
productDetailedDescription Detailed description of the Product. Long text up to 65536 chars.
productPageTitle Text to be used as page title (and thus browser window title) when a user opens the details of the Product. If not specified, the name of the Product will be used.
productMetaKeywords Meta keywords about the Product.
productMetaDescription Meta description of the Product.
brandID The ID of the Product Brand
productIsActive Specifies whether the Product is active and thus visible in your web store.
productAvailabilityStatus
availabilityLabelID
productCode The code of the Product. Must be a unique string.
productBarcode
productNameXHTML
productDescriptionXHTML
productDetailedDescriptionXHTML
productCategories Collection of Categories this Product belongs to.
productHomePageFeatured
productHomePageFeaturedFromCategory
productPrice The price of the Product.
productDistributorPrice
productWeight The weight of the Product.
productQuantity The quantity of the Product you have in stock.
productBonusPointsMode
productBonusPointsPrice
productIsNew
productFeaturedStyle
productImages Collection of Product Images

Product Categories

productCategories parameter Description
categoryID ID of a Category this Product belongs to.

Product Images

Each Product in your web store may have one or more Images.

productImages parameter Description
productImage
productImageFeaturedStyle

Update a Specific Product

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

// Default method is to update Product directly
$product = $seliton->product()->update(array (
    'productId' => 922,
    'productCode' => 'test_save',
));

// Alternatively, it is possible to retrieve Product first, set fields and save it
$product = $seliton->product()->retrieve(922);
$product->code = 'test_save';
$product->save();
?>
curl -X PUT "http://dev-1.myseliton.com/api/v1/products/922?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"productCode": "test_save"}'

The above command returns JSON structured like this:

{
    "product": {
        "productId": 922,
        "productName": {
            "EN": "Test",
            "TR": "",
            "RO": ""
        },
        "productDescription": {
            "EN": "Test Description",
            "TR": "",
            "RO": ""
        },
        "productDetailedDescription": {
            "EN": "Test Detailed Description",
            "TR": "",
            "RO": ""
        },
        "productPageTitle": {
            "EN": "Test Page Tile",
            "TR": "",
            "RO": ""
        },
        "productMetaKeywords": {
            "EN": "Test Meta Keywords",
            "TR": "",
            "RO": ""
        },
        "productMetaDescription": {
            "EN": "Test Meta Description",
            "TR": "",
            "RO": ""
        },
        "brandID": 1,
        "productIsActive": true,
        "productAvailabilityStatus": "in_stock",
        "availabilityLabelID": null,
        "productCode": "test_save",
        "productBarcode": null,
        "productNameXHTML": false,
        "productDescriptionXHTML": false,
        "productDetailedDescriptionXHTML": false,
        "productHomePageFeatured": false,
        "productHomePageFeaturedFromCategory": false,
        "productPrice": 500,
        "productDistributorPrice": 300,
        "productWeight": 4,
        "productQuantity": 6,
        "productCreatedTimestamp": "2015-12-30T10:59:35+00:00",
        "productBonusPointsMode": "money_only",
        "productBonusPointsPrice": null,
        "productIsNew": false,
        "productFeaturedStyle": "normal",
        "productImages": [

        ],
        "productCategories": [
            {
                "categoryID": 4
            }
        ]
    }
}

This endpoint updates a specific product.

HTTP Request

PUT http://dev-1.myseliton.com/api/v1/products/<ID>

URL Parameters

Parameter Description
ID The ID of the product to update

Delete a Specific Product

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$product = $seliton->product()->retrieve(922);
$product->delete();
?>
curl -X DELETE "http://dev-1.myseliton.com/api/v1/products/922?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "id": 922
}

This endpoint deletes a specific product.

HTTP Request

DELETE http://dev-1.myseliton.com/api/v1/products/<ID>

URL Parameters

Parameter Description
ID The ID of the product to delete

Script Codes

Get All Script Codes

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

list ($scriptCodes, $count) = $seliton->scriptCode()->all(array (
    'nameContains' => 'Test',
    'limit' => 2,
    'offset' => 1,
    'fields' => 'scriptCodeId,scriptCodeName'
));
?>
curl "http://dev-1.myseliton.com/api/v1/scriptCodes?nameContains=Test&limit=2&offset=1&fields=scriptCodeId,scriptCodeName&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "scriptCodes": [
        {
            "scriptCodeId": 44,
            "scriptCodeName": "Test 2"
        },
        {
            "scriptCodeId": 45,
            "scriptCodeName": "Test 3"
        }
    ],
    "_metadata": {
        "count": 3
    }
}

This endpoint retrieves all script codes.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/scriptCodes

Query Parameters

Parameter Description
nameContains Script Code name filter (substring).
limit Amount of Script Codes in a result.
offset Amount of Script Codes to skip from result.
fields Fields (comma separated) to be retrieved.

Get a Specific Script Code

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$scriptCode = $seliton->scriptCode()->retrieve(44);
?>
curl "http://dev-1.myseliton.com/api/v1/scriptCodes/44?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "scriptCode": {
        "scriptCodeId": 44,
        "scriptCodePosition": "end_of_body",
        "scriptCodeText": "test1",
        "scriptCodeAppID": null,
        "scriptCodeName": "Test 1"
    }
}

This endpoint retrieves a specific script code.

HTTP Request

GET http://dev-1.myseliton.com/api/v1/scriptCodes/<ID>

URL Parameters

Parameter Description
ID The ID of the script code to retrieve

Create a Script Code

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;
use Seliton\Client\Resource\Enum;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$scriptCode = $seliton->scriptCode()->create(
    array (
        'scriptCodePosition' => Enum\ScriptCodePosition::END_OF_BODY,
        'scriptCodeText' => '
            <div id="script-code"></div>

            <style type="text/css">
            .script-code {
                text-weight: bold;
            }
            </style>

            <script type="text/javascript" src="http://example.com/js/script-code.js" />

            <script type="text/javascript">
                alert("Hello");
            </script>
        ',
        'scriptCodeAppID' => '123',
        'scriptCodeName' => 'Test',
    )
);
?>
curl -X POST "http://dev-1.myseliton.com/api/v1/scriptCodes?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"scriptCodePosition": "end_of_body", "scriptCodeText": "<div id=\"script-code\"></div>\n\n<style type=\"text/css\">\n.script-code {\n    text-weight: bold;\n}\n</style>\n\n<script type=\"text/javascript\" src=\"http://example.com/js/script-code.js\" />\n\n<script type=\"text/javascript\">\n    alert("Hello");\n</script>", "scriptCodeAppID": "123", "scriptCodeName": "test"}'

The above command returns JSON structured like this:

{
    "scriptCodeId": 46,
    "scriptCodePosition": "end_of_body",
    "scriptCodeText": "<div id=\"script-code\"></div>\n\n<style type=\"text/css\">\n.script-code {\n    text-weight: bold;\n}\n</style>\n\n<script type=\"text/javascript\" src=\"http://example.com/js/script-code.js\" />\n\n<script type=\"text/javascript\">\n    alert(\"Hello\");\n</script>",
    "scriptCodeAppID": "123",
    "scriptCodeName": "Test"
}

This endpoint creates a script code.

HTTP Request

POST http://dev-1.myseliton.com/api/v1/scriptCodes

POST JSON Parameters

Parameter Description
scriptCodePosition Script Code location at the page (end_of_body or end_of_head, end_of_body by default)
scriptCodeText Script Code content (it might be JavaScript, HTML or CSS)
scriptCodeAppID App ID, if inserted by App (null by default)
scriptCodeName Script Code name (to distinguish one from another)

Update a Specific Script Code

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

// Default method is to update Script Code directly
$scriptCode = $seliton->scriptCode()->update(array (
    'scriptCodeId' => 46,
    'scriptCodeText' => 'updated-test',
    'scriptCodeName' => 'Updated Test',
));

// Alternatively, it is possible to retrieve Script Code first, set fields and save it
$scriptCode = $seliton->scriptCode()->retrieve(46);
$scriptCode->text = "updated-test";
$scriptCode->name = "Updated Test;
$scriptCode->save();
?>
curl -X PUT "http://dev-1.myseliton.com/api/v1/scriptCodes/46?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8" -H "Content-Type: application/json" -d '{"scriptCodeText": "updated-test", "scriptCodeName": "Updated Test"}'

The above command returns JSON structured like this:

{
    "scriptCode": {
        "scriptCodeId": 46,
        "scriptCodePosition": "end_of_body",
        "scriptCodeText": "updated-test",
        "scriptCodeAppID": "123",
        "scriptCodeName": "Updated Test"
    }
}

This endpoint updates a specific script code.

HTTP Request

PUT http://dev-1.myseliton.com/api/v1/scriptCodes/<ID>

URL Parameters

Parameter Description
ID The ID of the script code to update

Delete a Specific Script Code

<?php
require_once('/path/to/seliton-php-client/init.php');

use Seliton\Client\Seliton;

$seliton = new Seliton('http://dev-1.myseliton.com/api/v1/', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8');

$scriptCode = $seliton->scriptCode()->retrieve(46);
$scriptCode->delete();
?>
curl -X DELETE "http://dev-1.myseliton.com/api/v1/scriptCodes/46?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6ImU3MzdjZTNjNTUyMGMxMjI1Y2I1YWMyMWE3MDBlNWE1MDM3NmE0ZWMiLCJqdGkiOiJlNzM3Y2UzYzU1MjBjMTIyNWNiNWFjMjFhNzAwZTVhNTAzNzZhNGVjIiwiaXNzIjoiIiwiYXVkIjoidGVzdGNsaWVudCIsInN1YiI6IjEyMzQiLCJleHAiOjE0NTIzNDE2ODQsImlhdCI6MTQ1MjMzODA4NCwidG9rZW5fdHlwZSI6ImJlYXJlciIsInNjb3BlIjpudWxsfQ.sLDLMJyxaLXzbMF6kXvj_2pKnwkh0kmUWQ8eTmjGEoUbe-V3TpAc6F01bTer0F-X7d0RXRpdIXods4yN7BPSQnIuV2i3NGI26pCAooOKegr3CRxHo-Iyqx18S1MbCjkm2qvQ9WTNp4v83hI2P2GislMXZYS7N1XJ0kNkPSZ3JF8"

The above command returns JSON structured like this:

{
    "id": 46
}

This endpoint deletes a specific script code.

HTTP Request

DELETE http://dev-1.myseliton.com/api/v1/scriptCodes/<ID>

URL Parameters

Parameter Description
ID The ID of the script code to delete