Manuál

Sme tu nato, aby sme pomohli.

Verzia 1


Upozornenie!
API je v testovacej beta verzií. Jednotlivé volania sa môžu zmeniť.

Napojenie na API prebieha vyžiadaním access tokenu cez request Prihlásenie, ktorý je následne nutné prenášať pri ostatných requestoch cez hlavičku X-Api-Authorization. Zoznam podporovaných requestov nájdete nižšie:

Prihlásenie

URL
POST /api/v1/access-token/create
Parameters
Name Type Method Required Default Description
email string POST yes Prihlasovací e-mail.
password string POST yes Heslo do API.
Request
{
    "email": "info@example.org",
    "password": "your_secret_api_password"
}
Response
{
    "user": "info@example.org",
    "access_token": "bf920b865efdda44451c4ff685e81454069ba514",
    "expiration": "2018-06-27 11:35:10",
    "status": "ok"
}

Odhlásenie

URL
POST /api/v1/access-token/revoke
Request
[]
Response
{
    "status": "ok"
}

Objednávky - vytvorenie

URL
POST /api/v1/orders/create
Parameters
Name Type Method Required Default Description
email string POST yes E-mail zákazníka.
phone string POST yes Telefón zákazníka.
shipping_id int POST yes ID dopravy.
payment_id int POST yes ID platby.
invoice_name string POST yes Fakturačná adresa: meno
invoice_street string POST yes Fakturačná adresa: ulica
invoice_postcode string POST yes Fakturačná adresa: PSČ
invoice_city string POST yes Fakturačná adresa: mesto
invoice_country_id int POST yes Fakturačná adresa: ID krajiny
delivery_name string POST yes Doručovacia adresa: meno
delivery_street string POST yes Doručovacia adresa: ulica
delivery_postcode string POST yes Doručovacia adresa: PSČ
delivery_city string POST yes Doručovacia adresa: mesto
delivery_country_id int POST yes Doručovacia adresa: ID krajiny
company_name string POST no Názov spoločnosti.
company_uid string POST yes/no IČO (povinné v prípade vyplnenia parametru company_name)
company_vatid string POST yes/no DIČ / IČ DPH (povinné v prípade vyplnenia parametru company_name)
company_vatpayer bool POST yes/no Platca DPH (povinné v prípade vyplnenia parametru company_name)
note string POST no Poznámka k objednávke.
items int[] POST yes Položky v objednávke. Pole má 1 povinný parameter id. Východzí počet ks je 1 a je možné ho ovplyvniť cez parameter quantity. Ostatné voliteľné parametre zahŕňajú price_base, price_discount, price_margin, price_purchase a price_vat - je možné cez ne prepísať ceny produktu, ktoré sa normálne načítavajú automaticky.
use_gifts bool POST no false Vytváranie darčekov pre objednávky a produkty pokiaľ je tak v eshope nastavené.
dispatch bool POST no true Pokračovať v procesovaní objednávky formou odoslania e-mailov + postúpenia dát do ERP systémov.
price_level_id int POST no 1 ID cenovej hladiny.
Request
{
    "email": "info@example.org",
    "phone": "+421949949949",
    "shipping_id": 3,
    "payment_id": 4,
    "invoice_name": "Jan Novak",
    "invoice_street": "Testovacia 1",
    "invoice_postcode": "83104",
    "invoice_city": "Bratislava",
    "invoice_country_id": 1,
    "delivery_name": "Jan Novak",
    "delivery_street": "Testovacia 99",
    "delivery_postcode": "83104",
    "delivery_city": "Bratislava",
    "delivery_country_id": 1,
    "company_name": "Skusobna firma, s.r.o.",
    "company_uid": "12345678",
    "company_vatid": "1234567890",
    "company_vatpayer": "SK1234567890",
    "note": "Poznamka zakaznika k objednavke.",
    "items": [
        {
            "id": 5216,
            "quantity": 10
        },
        {
            "id": 9186,
            "quantity": 1,
            "price_base": 54.54,
            "price_margin": 10,
            "price_purchase": 44.54,
            "price_vat": 10
        },
        {
            "id": 2151,
            "product_status": "Skladom"
        }
    ],
    "use_gifts": 0,
    "dispatch": 1,
    "price_level_id": 1
}
Response
{
    "order": {
        "id": 51,
        "number": "1201600049",
        "created": "2018-06-20 11:35:10"
    },
    "status": "ok"
}

Objednávky - stav

URL
POST /api/v1/orders/status
Parameters
Name Type Method Required Default Description
number string POST yes Číslo objednávky.
Request
{
    "number": "1201600049"
}
Response
{
    "order": {
        "id": 51,
        "number": "1201600049",
        "status": "Vybaven\u00e1",
        "created": "2018-06-20 11:35:10"
    },
    "status": "ok"
}

Doprava - zoznam

URL
POST /api/v1/shippings/list
Request
[]
Response
{
    "shippings": [
        {
            "id": 1,
            "name": "Kuri\u00e9r",
            "description": "Doru\u010denie do 24 hod\u00edn.",
            "price": {
                "base": 5,
                "vat": 20
            },
            "free_from": 20,
            "free_calc_vat": 1,
            "minimal_quantity": 1,
            "minimal_weight": 0,
            "price_level_id": 1,
            "payments": [
                3,
                6,
                10,
                24
            ],
            "countries": [
                1,
                4
            ]
        }
    ],
    "status": "ok"
}

Doprava - počet

URL
POST /api/v1/shippings/count
Request
[]
Response
{
    "count": 7,
    "status": "ok"
}

Platby - zoznam

URL
POST /api/v1/payments/list
Request
[]
Response
{
    "payments": [
        {
            "id": 1,
            "name": "Dobierka",
            "description": "Platba pri prevzat\u00ed tovaru.",
            "price": {
                "base": 5,
                "vat": 20
            },
            "free_from": 20,
            "free_calc_vat": 1,
            "auto_invoice": 1,
            "price_level_id": 1,
            "shippings": [
                3,
                6,
                10,
                24
            ],
            "countries": [
                1,
                4
            ]
        }
    ],
    "status": "ok"
}

Platby - počet

URL
POST /api/v1/payments/count
Request
[]
Response
{
    "count": 7,
    "status": "ok"
}

Krajiny - zoznam

URL
POST /api/v1/countries/list
Request
[]
Response
{
    "countries": {
        "id": 1,
        "code": "sk",
        "name": "Slovensko"
    },
    "status": "ok"
}

Krajiny - počet

URL
POST /api/v1/countries/count
Request
[]
Response
{
    "count": 195,
    "status": "ok"
}

Cenové hladiny - zoznam

URL
POST /api/v1/price-levels/list
Request
[]
Response
{
    "price_levels": {
        "id": 1,
        "name": "Z\u00e1kladn\u00e1"
    },
    "status": "ok"
}

Cenové hladiny - počet

URL
POST /api/v1/price-levels/count
Request
[]
Response
{
    "count": 4,
    "status": "ok"
}

Produkty - zoznam

URL
POST /api/v1/products/list
Parameters
Name Type Method Required Default Description
number int GET no 1 Stránkovanie.
Request
[]
Response
{
    "page": 1,
    "pages": 2,
    "products": {
        "id": 1,
        "url": "testovaci-produkt",
        "name": "Testovac\u00ed produkt",
        "annotation": "Kr\u00e1tky popis",
        "text": "Dlh\u00fd popis",
        "parameter1_name": "Farba",
        "parameter2_name": "Ve\u013ekos\u0165",
        "parameter3_name": null,
        "brand": {
            "id": 5,
            "url": "microsoft",
            "name": "Microsoft"
        },
        "categories": {
            "id": 17,
            "url": "pociace\/notebooky\/pracovne",
            "name": "Pracovn\u00e9 notebooky",
            "parent_id": 5
        },
        "collections": {
            "id": 1,
            "url": "notebooky-thinkpad",
            "name": "Notebooky ThinkPad"
        },
        "photos": {
            "id": 3616,
            "url": "testovacia-fotka",
            "name": "Testovacia fotka",
            "alt": "Alternat\u00edvny popis",
            "format": "jpg",
            "main": 1,
            "priority": 1,
            "variants": [
                6,
                7,
                8
            ]
        },
        "colors": {
            "hex": "#521762",
            "product_photo_id": 3616
        },
        "parameters": {
            "id": 7,
            "name": "Uhloprie\u010dka",
            "value": "15\"",
            "color": "#000000",
            "priority": 1
        },
        "related": {
            "collection_id": null,
            "category_id": 17,
            "brand_id": 5,
            "product_id": null,
            "priority": 1
        },
        "gifts": {
            "id": 215,
            "name": "My\u0161",
            "link": "http:\/\/example.org\/...",
            "text": "Po\u010d\u00edta\u010dov\u00e1 my\u0161 k notebooku.",
            "quantity": 1,
            "price": {
                "base": 40,
                "vat": 20
            },
            "unit": {
                "id": 1,
                "name": "Kus",
                "symbol": "ks",
                "type": "Po\u010det"
            },
            "priority": 1
        },
        "created": "2018-06-27 11:35:10",
        "rating": 5,
        "priority": 1,
        "enabled": 1,
        "variants": {
            "id": 951,
            "sku": "SK16516",
            "ean": "6173173273271",
            "supplier_code": "PJT6326A",
            "weight": 1450,
            "size_x": 30,
            "size_y": 60,
            "size_z": 3,
            "cart_quantity": 1,
            "unit": {
                "id": 1,
                "name": "Kus",
                "symbol": "ks",
                "type": "Po\u010det"
            },
            "parameter1_value": "\u010cierny",
            "parameter2_value": "Ve\u013ek\u00fd",
            "parameter3_value": null,
            "supplier": {
                "id": 2,
                "name": "Dealer najlep\u0161\u00edch notebookov s.r.o."
            },
            "warranty": {
                "id": 4,
                "name": "2 roky"
            },
            "price": [
                {
                    "base": 2000,
                    "discount": 1665.53,
                    "vat": 20,
                    "price_level_id": 1
                },
                {
                    "base": 1800,
                    "discount": 1200,
                    "vat": 20,
                    "price_level_id": 2
                }
            ],
            "stocks": [
                {
                    "quantity": 5,
                    "unit": {
                        "id": 1,
                        "name": "Kus",
                        "symbol": "ks",
                        "type": "Po\u010det"
                    },
                    "warehouse": {
                        "id": 1,
                        "name": "Centr\u00e1lny sklad"
                    }
                }
            ],
            "enabled": 1
        }
    },
    "status": "ok"
}

Produkty - počet

URL
POST /api/v1/products/count
Request
[]
Response
{
    "count": 1613,
    "status": "ok"
}

Sklady - počet

URL
POST /api/v1/stocks/count
Request
[]
Response
{
    "count": 4,
    "status": "ok"
}

Sklady - zoznam

URL
POST /api/v1/stocks/list
Request
[]
Response
{
    "warehouses": [
        {
            "id": 1,
            "name": "Hlavny sklad",
            "street": null,
            "postcode": null,
            "city": null,
            "country": null,
            "order_deadline": null,
            "pickup_time": null,
            "heureka_depotid": 1111
        },
        {
            "id": 2,
            "name": "Velkoobchodny sklad",
            "street": null,
            "postcode": null,
            "city": null,
            "country": null,
            "order_deadline": "13:00",
            "pickup_time": 20,
            "heureka_depotid": 9999
        }
    ],
    "status": "ok"
}

Sklady - pohyby

URL
POST /api/v1/stocks/logs
Parameters
Name Type Method Required Default Description
product_variant_id int GET yes ID produkt variantu.
page int GET no 1 Stránka.
Request
[]
Response
{
    "page": 1,
    "pages": 1,
    "logs": {
        "id": 99,
        "quantity_moved": 1,
        "quantity_balance": 1,
        "note": null,
        "created": "2017-01-06 01:27:54",
        "unit": null,
        "order": null,
        "invoice": null,
        "credit_note": null
    },
    "status": "ok"
}

Sklady - zmena stavu

URL
POST /api/v1/stocks/move
Parameters
Name Type Method Required Default Description
product_variant_id int POST yes if supplier_code is not defined ID produkt variantu.
supplier_id int POST yes if product_variant_id is not defined ID dodávateľa.
supplier_code int POST yes if product_variant_id is not defined Kód dodávateľa.
warehouse_id int POST yes ID skladu.
quantity int POST yes Počet merných jednotiek, ktoré sa majú pričítať/odčítať zo skladu. Nesmie byť rovné 0.
Request
[]
Response
{
    "stock": {
        "id": 704
    },
    "status": "ok"
}

Účtovné doklady - zoznam faktúr

URL
POST /api/v1/accounting.invoices/list
Request
[]
Response
{
    "status": "ok"
}

Účtovné doklady - zoznam dobropisov

URL
POST /api/v1/accounting.credit-notes/list
Request
[]
Response
{
    "status": "ok"
}

Pomohlo? Áno Nie

Začnite nezáväzne zadarmo na 14 dní.

Otázky? Volajte +421 221 028 001