Objednávky


Vytvorenie objednávky

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 / firma
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_uid string POST yes/no IČO
company_taxid string POST yes/no DIČ
company_vatid string POST yes/no IČ DPH
company_vatpayer bool POST yes/no Platca DPH
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": "Testovacia firma, s.r.o.",
    "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_uid": "12345678",
    "company_taxid": "1234567890",
    "company_vatid": "SK1234567890",
    "company_vatpayer": true,
    "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
HTTP 201 - Created
Host: example.org
Content-Type: application/vnd.shoptec.v1.0+json; charset=utf-8
{
    "order": {
        "id": 51,
        "number": "1201600049",
        "created": "2024-10-16 07:20:25"
    }
}

Upravenie objednávky

URL
PATCH /api/v1/orders/update
Parameters
Name Type Method Required Default Description
number string GET yes Číslo objednávky.
order_note_subject string POST yes Predmet e-mailu/poznámky o zmene objednávky. Max. 200 znakov.
order_note_message string POST yes Popis e-mailu/poznámky o zmene objednávky.
order_note_internal bool POST no 1 Príznak, či ide o internú poznámku alebo nie. Interné poznámky sa neodosielajú zákazníkovi na e-mail.
order_status_id string POST no ID stavu objednávky.
date_paid string POST no Dátum úhrady v ľubovoľnom formáte podľa PHP funkcie strtotime. Pri použití textového reťazca "null" sa dátum úhrady vymaže.
Request
{
    "order_note_subject": "Prijatie platby k objednavke c. 1202100419",
    "order_note_message": "Dobry den, dna 16.10.2024 o 07:20 sme prijali uhradu za objednavku c. 1202100419. Zabalili sme ju a poslali kurierom. Dakujeme.",
    "order_note_internal": 0,
    "order_status_id": 1,
    "date_paid": "now"
}
Response
HTTP 204 - No Content
Host: example.org
Content-Type: application/vnd.shoptec.v1.0+json; charset=utf-8

Stav objednávky

URL
GET /api/v1/orders/status
Parameters
Name Type Method Required Default Description
number string GET yes Číslo objednávky.
Request
(empty)
Response
HTTP 200 - OK
Host: example.org
Content-Type: application/vnd.shoptec.v1.0+json; charset=utf-8
{
    "order": {
        "id": 51,
        "number": "1201600049",
        "status": {
            "id": 1,
            "name": "Vybaven\u00e1"
        },
        "created": "2024-10-16 07:20:25"
    }
}

Zoznam objednávok

URL
GET /api/v1/orders/list
Parameters
Name Type Method Required Default Description
page int GET no 1 Stránkovanie.
order_status_id int GET no 1 Stav objednávky.
date_from string GET no Dátum od.
date_to string GET no Dátum do.
Request
(empty)
Response
HTTP 200 - OK
Host: example.org
Content-Type: application/vnd.shoptec.v1.0+json; charset=utf-8
{
    "page": 1,
    "pages": 1,
    "itemsCount": 1,
    "itemsPerPage": 1,
    "orders": [
        {
            "id": 1,
            "prefix": "12024",
            "number": "00001",
            "internal_number": null,
            "email": "info@example.org",
            "phone": "00421949949949",
            "note": "",
            "created": "2020-04-11 00:31",
            "modified": null,
            "paid": null,
            "sum_total": 26.25,
            "sum_totalvat": 31.5,
            "shipping_id": 1,
            "shipping_name": "Kuri\u00e9r",
            "shipping_description": "Doru\u010denie kuri\u00e9rom do celej SR do 48 hod\u00edn.",
            "shipping_data": null,
            "shipping_interface": null,
            "shipping_price_base": 5,
            "shipping_price_vat": 20,
            "shipping_purchase_order": 1,
            "payment_id": 1,
            "payment_name": "Prevod na \u00fa\u010det",
            "payment_description": "Platba prevod\u00fdm pr\u00edkazom.",
            "payment_price_base": 5,
            "payment_price_vat": 20,
            "payment_purchase_order": 1,
            "price_level": null,
            "ip": "127.0.0.1",
            "user_agent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit\/605.1.15 (KHTML, like Gecko) Version\/13.0.5 Safari\/605.1.15",
            "customer_id": null,
            "status": {
                "id": 1,
                "name": "Vybaven\u00e1"
            },
            "invoice_company": null,
            "invoice_address": {
                "name": "J\u00e1n Nov\u00e1k",
                "street": "Testovacia 1",
                "postcode": "83104",
                "city": "Bratislava",
                "country_id": 1
            },
            "delivery_address": {
                "name": "J\u00e1n Nov\u00e1k",
                "street": "Testovacia 999",
                "postcode": "83104",
                "city": "Ko\u0161ice",
                "phone": null,
                "country_id": 1
            },
            "items": [
                {
                    "id": 337,
                    "quantity": 2,
                    "name": "Spiral Triple XXX Mesh Backpack Bag",
                    "weight": null,
                    "sku": null,
                    "ean": "",
                    "supplier_code": "1165-OG_Size_UNI",
                    "price_base": 29.9167,
                    "price_discount": 26.275,
                    "price_margin": 0,
                    "price_purchase": 0,
                    "price_vat": 20,
                    "brand": "Spiral",
                    "unit": null,
                    "product_status": "Skladom",
                    "parameter1_name": null,
                    "parameter2_name": null,
                    "parameter3_name": null,
                    "parameter1_value": null,
                    "parameter2_value": null,
                    "parameter3_value": null,
                    "note": 29.9167,
                    "free_shipping": 29.9167,
                    "free_payment": 29.9167,
                    "created": "2020-04-29 16 => 35",
                    "modified": null,
                    "accessory_id": null,
                    "product_id": 53494,
                    "product_variant_id": 60750,
                    "order_status_item_id": null,
                    "order_item_id": null
                }
            ]
        }
    ]
}

Počet objednávok

URL
GET /api/v1/orders/count
Request
(empty)
Response
HTTP 200 - OK
Host: example.org
Content-Type: application/vnd.shoptec.v1.0+json; charset=utf-8
{
    "count": 51265
}

Pomohlo? Áno Nie

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

Otázky? Volajte +421 915 149 960