Documentation for MelpeAPI

This guidance describes short description of public methods of processing of data

On this moment available API v1.0

Requirements:


- CURL extension in your web server

Parameters marked by is required

API v1.0 links:


All methods require this fields:
firm_id - firm ID from system
auth_key - authentification key for selected firm

This fields you may receive in firm profile "Ustawienia" -> "Integracje" -> "API"
After switch on option `Włączyć zewnętrzny API dla firmy`
All data returns as JSON string
CURL request:
curl -X POST 'https://panel.melpe.pl/api/v1/insertDocument/' \
--data-raw '{
    "firm_id": "integer",
    "auth_key": "string",
    "contractor": {
        {
            "id": "integer"
            "id": "integer"
        }
    }
    "product": {
        {
            "name": "string",
            "amount": "integer",
            "unit": "string",
            "tax": "string",
            "single_netto": "string",
            "single_brutto": "string"
        }               
    },
    "buyer_exists": "integer",
    "currency_rate": "floating",
    "currency_code": "pln",
    "date_issued": "string",
    "date_transaction": "string",
    "payment_type": "string",
    "payment-days": "integer",
    "date_payment": "string",
    "numbering": "integer",
    "vat_from": "string",
    "price_group": "integer",
    "procedures": {},
    "order_nr": "string",
    "delivery_nr": "string",
    "description": "string",
    "document_next_nr": "integer",
    "document_type": "string",
    "user_id": "integer"
}'
                    
CURL request:

Input parameters:
name - Name of product
code - Code of product
tax_buy - Tax rate ID for purchases from the list
tax_sell - Tax rate ID for sale from the list
ean_nr - EAN number
-
-
-
-
-
-


Output:
Returns `success` or `error` in `status` field
curl -X POST 'https://panel.melpe.pl/api/v1/addProduct/' \
--data-raw '{
    "firm_id": "integer",
    "auth_key": "string",
    "name": "string",
    "code": "",
    "tax_buy": "",
    "tax_sell": "",
    "ean_nr": "",
    "description": "",
    "type": "",
    "pkwiu": "",
    "gtu": "",
    "unit": "",
    "tax_buy": "",
    "tax_sell": "",
    "contractor": "",
    "contractor_product_code": "",
    "contractor_product_name": "",
    "mode_mpp": ""
}'
                    
CURL request:

Returns associative array (key `users`) of users with fields:
account_id - user identificator
account_login - user login
account_status - status
firm_group_id - affillation of user to group
group_slug - the slug of users group
display_name - real username and last name in system
last_login - date of last user authentification
user_photo - link to user profile photo
curl -X POST 'https://panel.melpe.pl/api/v1/listFirmUsers/' \
--data-raw '{
    "firm_id": "integer",
    "auth_key": "string"
}'
                    
CURL request:

Returns associative array (key `contractors`) of contractors for selected firm with fields:
contractor_id - contractor identificator
contractor_name - contractor name
contractor_date_created - date of creation in system
contractor_nip - NIP of contractor (may be empty)
contractor_type - `firm` or `person` (firm or physical person)
curl -X POST 'https://panel.melpe.pl/api/v1/listContractors/' \
--data-raw '{
    "firm_id": "integer",
    "auth_key": "string"
}'
                    
CURL request:

Returns success or error in `status` field
curl -X POST 'https://panel.melpe.pl/api/v1/addContractor/' \
--data-raw '{
    "firm_id": "integer",
    "auth_key": "string",
    ""
}'
                    
CURL request:

Returns associative array (key `taxes` => {id}) of taxes in system with fields:
tax_id - tax identificator
tax_name - tax name
tax_value - tax percentage
tax_short - label of tax
tax_position - sorting list
curl -X POST 'https://panel.melpe.pl/api/v1/listTaxes/' \
--data-raw '{
    "firm_id": "integer",
    "auth_key": "string"
}'
                    
CURL request:

Returns associative array (key `units` => {id}) of units in system with fields:
unit_id - unit identificator
unit_name - full unit name
unit_code - short unit name
curl -X POST 'https://panel.melpe.pl/api/v1/listSystemUnits/' \
--data-raw '{
    "firm_id": "integer",
    "auth_key": "string"
}'
                    
CURL request:

Returns associative array (key `units` => {id}) of units in system defined by users with fields:
id - unit identificator
unit_name - full unit name
unit_code - short unit name
curl -X POST 'https://panel.melpe.pl/api/v1/listUsersUnits/' \
--data-raw '{
    "firm_id": "integer",
    "auth_key": "string"
}'
                    
CURL request:

Returns associative array (key `gtu` => {id}) of GTUs with fields:
id - identificator
code - short name
description - dsecription for gtu
is_enabled - status in system: 1 - enabled, 0 - disabled
curl -X POST 'https://panel.melpe.pl/api/v1/listGtu/' \
--data-raw '{
    "firm_id": "integer",
    "auth_key": "string"
}'