Documentation for Masstrade API

Public API

/status

Host: public-api.masstrade.pl

Usage: Retrieves public information of the server. Key is not required for this request.

Test Call

{
    "serverName": "DevSebaMasstrade_optimo",
    "isProduction": false,
    "remoteWriteEnabled": true,
    "cronEnabled": true,
    "cronExtensionsEnabled": true,
    "adminAccessOnly": false
}

Seller’s API

Host: seller-api.masstrade.pl

Description: This API is used by seller to connect Masstrade with an ERP system or to make internal integrations. The sellers API key is required. Please contact us to get one.


Metods for Seller

Method

URL

Description

GET

/categories

Returns detailed data of MT categories

GET

/channels

Returns detailed data of the sales channels (rolo, ebay, allegro etc.)

GET

/products

Returns detailed data of MT products

GET

/products_translations

Returns descriptions and titles of MT products with translations

GET

/orders

Returns detailed data of the order documents

GET

/order/{id}

Returns detailed data of an order document with given id

GET

/order/{id}/getAttachments

Returns only an attachment address and file details with given id

POST

/order/{id}/addFileAttachment

Uploads an attachment with given id

GET

/me

Returns information of key owner

GET

/returns

Returns detailed data of the documents stored in the Complaints module in Masstrade

/categories

Parameter

Type

Description

key

string

Key generated and saved in Masstrade

format

string

Format of the output (json, csv, xml)

key
format
Test Call

[
    {
        "id": 1888849,
        "parentId": 18798753,
        "order": 0,
        "identifiers": {
            "internal": "--",
            "external": null
        },
        "propertyGroups": [
            "30709",
            "30724",
            "30723",
            "30716",
            "30720",
            "30722",
            "30721"
        ],
        "state": {
            "active": true
        }
    },
    {
        ...
    },
    ...
]
id,parentId,order,identifiers_internal,identifiers_external,propertyGroups_0,propertyGroups_1,propertyGroups_2,propertyGroups_3,propertyGroups_4,propertyGroups_5,propertyGroups_6,state_active
199349,199353,0,--,,30709,30724,30723,30716,30720,30722,30721,1
...
<data>
    <object>
        <id>124539</id>
        <parentId>1934533</parentId>
        <order>0</order>
        <identifiers>
            <internal>--</internal>
            <external></external>
        </identifiers>
        <propertyGroups>30709</propertyGroups>
        <propertyGroups>30724</propertyGroups>
        ...
        <state>
            <active>true</active>
        </state>
    </object>
    <object>
        ...
    </object>
    ...
<data>

/channels

Parameter

Type

Description

key

string

Key generated and saved in Masstrade

key
Test Call

[
    {
    channel_id: "29842",
    enabled: "1",
    api: "allegro",
    language: "pl"
    },
    {
        ...
    }
    ...
]

/products

Parameter

Type

Description

key

string

Key generated and saved in Masstrade

format

string

Format of the output (json, csv, xml)

key
format
Test Call

[
    {
        "id": 1841092,
        "parentId": 0,
        "identifiers": {
            "sku": null,
            "ean": "Does not apply",
            "pkwiu": null
        },
        "price": {
            "selling": {
                "netto": 365.44999999999998863131622783839702606201171875,
                "brutto": 449.5,
                "vat": 23,
                "currency": "EUR"
            },
            "buying": {
                "netto": 0,
                "vat": 0,
                "currency": null
            }
        },
        "state": {
            "id": 1,
            "name": "Nowy"
        },
        "type": {
            "id": 0,
            "name": "pid_primary"
        },
        "manufacturer": {
            "id": 43514
        },
        "storage": {
            "enabled": true
        },
        "categories": {
            "id": 294960,
            "additionalIds": []
        }
    },
    {
        ...
    }
    ...
]
id,parentId,identifiers_sku,identifiers_ean,identifiers_pkwiu,price_selling_netto,price_selling_brutto,price_selling_vat,price_selling_currency,price_buying_netto,price_buying_vat,price_buying_currency,state_id,state_name,type_id,type_name,manufacturer_id,storage_enabled,categories_id
1841092,0,,"Does not apply",,365.45,449.5,23,EUR,0,0,,1,Nowy,0,pid_primary,43514,1,294960
...
<data>
    <object>
        <id>1841092</id>
        <parentId>0</parentId>
        <identifiers>
            <sku></sku>
            <ean>Does not apply</ean>
            <pkwiu></pkwiu>
        </identifiers>
        <price>
            <selling>
                <netto>365.45</netto>
                <brutto>449.5</brutto>
                <vat>23</vat>
                <currency>EUR</currency>
            </selling>
            <buying>
                <netto>0</netto>
                <vat>0</vat>
                <currency></currency>
            </buying>
        </price>
        <state>
            <id>1</id>
            <name>Nowy</name>
        </state>
        <type>
            <id>0</id>
            <name>pid_primary</name>
        </type>
        <manufacturer>
            <id>43514</id>
        </manufacturer>
        <storage>
            <enabled>true</enabled>
        </storage>
        <categories>
            <id>294960</id>
            <additionalIds/>
        </categories>
    </object>
    <object>
        ...
    </object>
    ...
</data>

/products_translations

Parameter

Type

Description

key

string

Key generated and saved in Masstrade

format

string

Format of the output (json, csv, xml)

key
format
Test Call

[
    {
        "id": "2074943",
        "productId": "1770002",
        "language": "de",
        "data": {
            "title": "",
            "title.short": "",
            "descriptions": [
                ""
            ]
        }
    },
    {
        ...
    },
    ...
]
id,productId,language,data_title,data_title.short,data_descriptions_0
2074943,1770002,de,,,
...
<data>
    <object>
        <id>2074943</id>
        <productId>1770002</productId>
        <language>de</language>
        <data>
            <title></title>
            <title.short></title.short>
            <descriptions></descriptions>
        </data>
    </object>
    <object>
        ...
    </object>
    ...
</data>

/orders

Parameter

Type

Description

key

string

Key generated and saved in Masstrade

outputFormat

string

Format of the output, available formats: api, mt_sync, edi

key
outputFormat
Test Call

[
    {
        "channel": {
            "id": "434",
            "api": "allegro",
            "site": 1,
            "order_id": "1004461846",
            "byuer_id": "Client:60411911"
        },
        "document": {
            "id": "18060",
            "name": "ZAM/Brulion/18060/04/2019",
            "type": "IORI",
            "seller": {
                "id": 158997
            },
            "buyer": {
                "id": 168982
            },
            "lines_count": 0,
            "storage": {
                "id_source": 568,
                "id_dest": 568,
                "is_commited": false
            },
            "status": {
                "status": "opened",
                "closed_id": null,
                "closed_by_user_id": null,
                "closed_at": null
            }
        },
        "pricing": {
            "currency": "PLN",
            "total_net": "37.3170000000",
            "total_gross": "45.8999100000",
            "transport_net": "13.00810000",
            "transport_tax": "23"
        },
        "attachments": []
    },
    ...
]

/order/{id}

Parameter

Type

Description

{id}

int

Order id

key

string

Key generated and saved in Masstrade

outputFormat

string

Format of the output (api, mt_sync, edi)

[
    {
        "channel": {
            "id": "434",
            "api": "allegro",
            "site": 1,
            "order_id": "1004461846",
            "byuer_id": "Client:60411911"
        },
        "document": {
            "id": "18060",
            "name": "ZAM/Brulion/18060/04/2019",
            "type": "IORI",
            "seller": {
                "id": 158997
            },
            "buyer": {
                "id": 168982
            },
            "lines_count": 0,
            "storage": {
                "id_source": 568,
                "id_dest": 568,
                "is_commited": false
            },
            "status": {
                "status": "opened",
                "closed_id": null,
                "closed_by_user_id": null,
                "closed_at": null
            }
        },
        "pricing": {
            "currency": "PLN",
            "total_net": "37.3170000000",
            "total_gross": "45.8999100000",
            "transport_net": "13.00810000",
            "transport_tax": "23"
        },
        "attachments": []
    }
]
<zamowienia>
    <zam>
        <docid>20908</docid>
        <mag_symbol>default</mag_symbol>
        <foreign_number>16801</foreign_number>
        <foreign_number_combined>prestashop.1.16801</foreign_number_combined>
        <datec>1573991678</datec>
        <datec_nice>2019-11-17 12:54</datec_nice>
        <api>prestashop</api>
        <apisite>1</apisite>
        <apisite2>pl</apisite2>
        <user>jan.kowalski@gmail.com</user>
        <cur>PLN</cur>
        <c_brut>74.2800000000</c_brut>
        <cm/>
        <pt>Przelewy24</pt>
        <snd>0</snd>
        <klient>
            <idk>199643</idk>
            <nazwa>JAN KOWALSKI</nazwa>
            <nazwa_s/>
            <nip/>
            <fa>0</fa>
            <isc>0</isc>
            <nrdomu> </nrdomu>
            <ulica>Polna 5</ulica>
            <miasto>Warszawa</miasto>
            <woj>-1</woj>
            <kod>62-081</kod>
            <kraj2>PL</kraj2>
            <kraj>Poland</kraj>
        </klient>
        <title>prestashop/ZAM/Brulion/20908/11/2019/jankowalski</title>
        <subtitle>BEZ FAKTURY</subtitle>
        <data>
            <l>
                <sku>mt_transport</sku>
                <p_name>Usługa transportowa</p_name>
                <c_net>11.3821</c_net>
                <c_brut>14</c_brut>
                <vat_id>23</vat_id>
                <szt>1</szt>
                <tr>1</tr>
            </l>
            <l>
                <sku>mt_751e5e830601abd6</sku>
                <p_name>Edeka Karma 4 kg dla psa - Jagnięcina wołowina dr</p_name>
                <c_net>22</c_net>
                <c_brut>27.06</c_brut>
                <vat_id>23</vat_id>
                <szt>1</szt>
                <tr>0</tr>
            </l>
            <l>
                <sku>mt_fb11d18f8a411b23</sku>
                <p_name>Edeka karma 15 kg dla psa - miękkie krokiety</p_name>
                <c_net>13.5</c_net>
                <c_brut>16.61</c_brut>
                <vat_id>23</vat_id>
                <szt>2</szt>
                <tr>0</tr>
            </l>
        </data>
    </zam>
</zamowienia>
<?xml version="1.0"?>
<masstrade_data>
    <Order>
        <OrderHeader>
            <OrderNumber>N aukcji: 16801</OrderNumber>
            <IdNumber>20908</IdNumber>
            <OrderDate>2019-11-17 12:11:38</OrderDate>
            <OrderType/>
            <DocumentFunctionCode>0</DocumentFunctionCode>
            <OrderCurrencyCode>PLN</OrderCurrencyCode>
            <OrderComment/>
        </OrderHeader>
        <OrderParty>
            <BuyerParty>
                <ILN/>
                <Name> JAN KOWALSKI</Name>
                <Street>Polna 5 </Street>
                <PostalCode>62-081</PostalCode>
                <City>Prze&#x17A;mierowo</City>
                <Country>PL</Country>
                <Contact>
                    <Mail>jan.kowalski@gmail.com</Mail>
                    <Phone>607849488</Phone>
                </Contact>
            </BuyerParty>
            <ShipToParty>
                <ILN/>
                <Name> JAN KOWALSKI</Name>
                <Street>Polna 5 </Street>
                <PostalCode>62-081</PostalCode>
                <City>Warszawa</City>
                <Country>PL</Country>
                <Contact>
                    <Mail>jan.kowalski@gmail.com</Mail>
                    <Phone>607849488</Phone>
                </Contact>
            </ShipToParty>
        </OrderParty>
        <OrderDetail>
            <Item>
                <ItemNumber>1</ItemNumber>
                <EAN/>
                <SellerItemId>Us&#x142;uga transportowa</SellerItemId>
                <Name>Transport</Name>
                <UnitOfMeasure>PCE</UnitOfMeasure>
                <QuantityValue>1</QuantityValue>
                <UnitPriceValue>11.3821</UnitPriceValue>
                <GrossPrice>14</GrossPrice>
            </Item>
            <Item>
                <ItemNumber>2</ItemNumber>
                <EAN/>
                <SellerItemId/>
                <Name>Edeka Karma 4 kg dla psa - Jagni&#x119;cina wo&#x142;owina dr&#xF3;b i ry&#x17C;</Name>
                <UnitOfMeasure>PCE</UnitOfMeasure>
                <QuantityValue>1</QuantityValue>
                <UnitPriceValue>22</UnitPriceValue>
                <GrossPrice>27.06</GrossPrice>
            </Item>
            <Item>
                <ItemNumber>3</ItemNumber>
                <EAN/>
                <SellerItemId/>
                <Name>Edeka karma 15 kg dla psa - mi&#x119;kkie krokiety</Name>
                <UnitOfMeasure>PCE</UnitOfMeasure>
                <QuantityValue>2</QuantityValue>
                <UnitPriceValue>13.5</UnitPriceValue>
                <GrossPrice>16.61</GrossPrice>
            </Item>
        </OrderDetail>
        <MassTradeData>
            <IsB2B>0</IsB2B>
            <Apiname>prestashop</Apiname>
        </MassTradeData>
    </Order>
</masstrade_data>

/order/{id}/getAttachments

This request returns only attachments.

Parameter

Type

Description

{id}

int

Document number

key

string

Key generated and saved in Masstrade

Sample response:

[
    {
        "attachment_name": "protokoly-9e909604ce3c63a8f60eb6e0808c8e13.pdf",
        "attachment_mime": "application/pdf",
        "billOfSale_type": "invoice",
        "attachment_type": "file",
        "url": "https://seller-api.masstrade.pl/path_to_file/protokoly-9e909604ce3c63a8f60eb6e0808c8e13.pdf"
    }
]

/order/{id}/addFileAttachment

This request replaces the order attachment.

Parameter

Type

Description

{id}

int

Document number

key

string

Key generated and saved in Masstrade

attachmentId

string/int

ID assigned to the attachment

form-data Parameters

key

value

file

{path_to_the_file}

type

invoice

The uploaded file should be returned by the /order/{id}/getAttachments request

/me

Parameter

Type

Description

key

string

Key generated and saved in Masstrade

key
Test Call

{
    "account_id": "1",
    "created_at": {
        "date": "2017-01-02 09:53:27.614099",
        "timezone_type": 3,
        "timezone": "Europe/Sarajevo"
    },
    "account_configured": true,
    "is_blocked": false,
    "is_blocked_temporary": false,
    "register_package": "retail"
}

/channels

Parameter

Type

Description

key

string

Key generated and saved in Masstrade

key
Test Call

[
    {
    channel_id: "29842",
    enabled: "1",
    api: "allegro",
    language: "pl"
    },
    {
        ...
    }
    ...
]

/returns

Parametr

Type

Description

key

string

Key generated and saved in Masstrade

key
Test Call

{
    0: {
        return_aid: "209",
        channel_id: "459",
        return_account_id: "297",
        return_sandbox: false,
        return_group: "1",
        return_last_status: "0",
        return_last_status_data: "2019-07-05 14:37:14",
        return_internal_doc_id: "-1",
        return_doc_number: "100/001/test3",
        return_hash_access: "wtwerteww",
        return_person_name: "Zgłoszenie klienta",
        return_hash_id: "235",
        return_person_email: "john.kowalski@example.pl",
        return_person_phone: "570894687",
        return_company_nip: "",
        return_company_name: "",
        return_created_by__mode: "10",
        return_created_by__b2b_userid: "-1",
        return_created_by__mt_idu: "220",
        return_created_by__accountid: "297",
        return_created_by__customerid: "-1",
        return_created_by__customer_addressid: "-1",
        return_doc_friendly_number: "00209/2019",
        return_reklamacja_detail: {
            return_detail_item: [
                {
                    kod: "a",
                    ilosc: "1",
                    rodzaj: "2"
                },
                {
                    kod: "b",
                    ilosc: "2",
                    rodzaj: "4"
                },
                {
                    kod: "c",
                    ilosc: "3",
                    rodzaj: "3"
                }
            ]
        },
    return_adres_detail: null,
    _lastUpdateResult: null,
    updated_at: "2019-07-05 14:37:14",
    created_at: "2019-07-05 14:37:14"
    },
    1: {
        ...
    },
    2: {
        ...
    },
    ...
}