NAV
Shell HTTP JavaScript Ruby Python PHP Java Go

Berg CRM API v0.9.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

About this document

The following specification describes REST API for Berg CRM.

Versioning

Specification versioning follows Semantic Versioning

Cloud version vs server version

There's one specification for both versions as cloud version difference is only additional field for tenant identification (X-Tenant).

Authorization

For Cloud version API X-Tenant header is required for every request. The only exception is authorization url in authorization code flow - X-Tenant should be passed as query parameter, for example: https://app.bergsystem.pl/api/authorize?client_id=your_client&respone_type=code&redirect_uri=https://encoded_redirec_url&scope=all&X-Tenant=tenant_name

Base URLs:

Authentication

Tokens

post_token

Code samples

# You can also use wget
curl -X POST https://app.bergsystem.pl/api/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://app.bergsystem.pl/api/token HTTP/1.1
Host: app.bergsystem.pl
Content-Type: application/x-www-form-urlencoded
Accept: application/json

const inputBody = '{
  "client_id": "api-client",
  "client_secret": "secret",
  "grant_type": "password",
  "scope": "string",
  "username": "john.doe@bersystem.pl",
  "password": "my_secret"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/token',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/x-www-form-urlencoded',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://app.bergsystem.pl/api/token',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://app.bergsystem.pl/api/token', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/x-www-form-urlencoded',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://app.bergsystem.pl/api/token', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/token");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/x-www-form-urlencoded"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.bergsystem.pl/api/token", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /token

Body parameter

client_id: api-client
client_secret: secret
grant_type: password
scope: string
username: john.doe@bersystem.pl
password: my_secret

A endpoint that allows to get the authorization token required by other api requests

Parameters

Name In Type Required Description
body body object true none
» client_id body string true none
» client_secret body string false none
» grant_type body string true none
» scope body string true none
» username body string false none
» password body string false none

Enumerated Values

Parameter Value
» grant_type password
» grant_type refresh_token
» grant_type authorization_code
» grant_type client_credentials

Example responses

200 Response

{
  "token_type": "Bearer",
  "expires_in": 3600,
  "access_token": "very_long_string",
  "refresh_token": "very_long_string2",
  "tenant": "My company"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» token_type string true none none
» expires_in integer true none none
» access_token string true none none
» refresh_token string true none none
» tenant string false none OPTIONAL - this field is being used on cloud version only

Enumerated Values

Property Value
token_type Bearer

Customers

get_customers_{customerId}

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/customers/{customerId} \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/customers/{customerId} HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/customers/{customerId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/customers/{customerId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/customers/{customerId}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/customers/{customerId}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/customers/{customerId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/customers/{customerId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /customers/{customerId}

An endpoint that allows to get customer data by its identifier.

Parameters

Name In Type Required Description
customerId path integer true Customer id
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Example responses

200 Response

{
  "id": "/api/customers/15",
  "type": "Customer",
  "attributes": {
    "_id": 12333,
    "firstname": "James",
    "lastname": "Smith",
    "parentUserId": 1,
    "path": "/1/2",
    "email": "kljkasd@o2.pl",
    "originsStatus": "1",
    "personalDataProcessingAgreement": true,
    "commercialContentAgreement": true,
    "marketingContentAgreement": false,
    "mailSmsMessagesAgreement": true,
    "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
    "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
    "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
    "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
    "visibility": "ADVISER_ONLY",
    "idCardSeries": "STM",
    "phone": "48943210675",
    "pesel": "33072308033",
    "city": "Wroclaw",
    "street": "Jaworowa",
    "houseNumber": "20A/77",
    "premisesNumber": "18",
    "postcode": "00-930",
    "state": "Krakow",
    "region": "Malopolskie",
    "gender": "male",
    "birthday": "2000-01-30",
    "driveLicenceDate": "2000-01-30",
    "invoiceCity": "Poznan",
    "invoiceEmail": "kljkasd@o2.pl",
    "invoiceStreet": "Topolowa",
    "invoiceHouseNumber": "30A/36",
    "invoicePremisesNumber": "37A",
    "invoicePostcode": "invoicePostcode",
    "invoiceNip": "2967751927",
    "invoiceName": "Faktura",
    "additionalPhone": "48475036329",
    "additionalEmail": "emilia05@sawicka.pl",
    "additionalCity": "Sieradz",
    "additionalStreet": "Orzeszkowej Elizy",
    "additionalHouseNumber": "89/11",
    "additionalPremisesNumber": "42/69",
    "additionalPostcode": "07-524",
    "officeCity": "Poznan",
    "officeStreet": "Cisowa",
    "officeHouseNumber": "32A",
    "officePremisesNumber": "11",
    "officePostcode": "26-536",
    "createdDate": "2020-09-25T00:00:00+02:00",
    "modifiedDate": "2020-09-25T00:00:00+02:00",
    "tags": [
      "VIP"
    ],
    "description": "My description",
    "linkedIn": "string",
    "facebook": "string",
    "extraFields": {
      "property1": "string",
      "property2": "string"
    },
    "extraAgreements": {
      "property1": true,
      "property2": true
    },
    "country": "Polska",
    "invoiceCountry": "Polska",
    "additionalCountry": "Polska",
    "officeCountry": "Polska",
    "origins": "Lead"
  }
}

Responses

Status Meaning Description Schema
200 OK Customer's data CustomerData
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

get_customers

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/customers \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/customers HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/customers',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/customers',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/customers', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/customers', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/customers");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/customers", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /customers

An endpoint that allows to get collection of customers data, it is possible to filter and sort according to selected fields.

Parameters

Name In Type Required Description
page%5Bpage%5D query integer(int32) false Page number.
sort query string false Sort data by field. Default sorting order is ascending. To reverse it use "-" before field name.
filter%5Bid%5D query integer false Filter by customer id.
filter%5BparentCompany%5D query string false Filter by parent company name or part of it.
filter%5Bfirstname%5D query string false Filter by customer's firstname or part of it.
filter%5Blastname%5D query string false Filter by customer's lastname or part of it.
filter%5Bcity%5D query string false Filter by customer's city name or part of it.
filter%5Bphone%5D query string false Filter by customer's phone number or part of it.
filter%5Bemail%5D query string false Filter by customer's email or part of it.
filter%5BstateId%5D query string false Filter by customer's state id or collection separated by comma.
filter%5BoriginsId%5D query string false Filter by customer's origins id or collection separated by comma.
filter%5Bpesel%5D query string false Filter by customer's PESEL or part of it.
filter%5BparentUserId%5D query string false Filter by parent empoloyee's id or collection separated by comma.
filter%5BcreationDateFromd%5D query string(date) false Filter by creation date from (inclusive).
filter%5BcreationDateTo%5D query string(date) false Filter by creation date to (inclusive).
filter%5BtagId%5D query string false Filter by tag id or tag ids separated by comma.
filter%5BcrmStatusId%5D query string false Filter by CRM status id or CRM status ids separated by comma.
filter%5BpersonalDataProcessingAgreement%5D query integer false Filter customer's by personal data processing agreeement. 0 - for "no", 1 - for "yes".
filter%5BmarketingContentAgreement%5D query integer false Filter customer's by markenting content agreement. 0 - for "no", 1 - for "yes".
filter%5BmailSmsMessagesAgreement%5D query integer false Filter customer's by e-mail and SMS messages delivery agreement. 0 - for "no", 1 - for "yes".
filter%5BcommercialContentAgreement%5D query integer false Filter customer's by commercial content delivery agreement. 0 - for "no", 1 - for "yes".
filter%5BproductCategoryId%5D query string false Filter by customer's product category id or ids separated by comma.
filter%5BproductProducerId%5D query string false Filter by customers product producer id or ids separated by comma.
filter%5BproductId%5D query string false Filter by customers product id or ids separated by comma.
filter%5BcontractStatusId%5D query string false Filter by contract status id or ids separated by comma.
filter query object false Extra fields filter. For example ?filter%5BextraField_myFieldd%5D=myValue
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Detailed descriptions

sort: Sort data by field. Default sorting order is ascending. To reverse it use "-" before field name. For sorting by extra fields use prefix "extraField_" before field name.

Supported sorting fields: * lastname * parentUser * state * city * phone * email * pesel * origins * createdDate * crmStatus * personalDataProcessingAgreement * marketingContentAgreement * commercialContentAgreement * mailSmsMessagesAgreement * id * ... and extra fields.

filter%5Bid%5D: Filter by customer id.

filter%5BparentCompany%5D: Filter by parent company name or part of it.

filter%5Bfirstname%5D: Filter by customer's firstname or part of it.

filter%5Blastname%5D: Filter by customer's lastname or part of it.

filter%5Bcity%5D: Filter by customer's city name or part of it.

filter%5Bphone%5D: Filter by customer's phone number or part of it.

filter%5Bemail%5D: Filter by customer's email or part of it.

filter%5BstateId%5D: Filter by customer's state id or collection separated by comma.

filter%5BoriginsId%5D: Filter by customer's origins id or collection separated by comma.

filter%5Bpesel%5D: Filter by customer's PESEL or part of it.

filter%5BparentUserId%5D: Filter by parent empoloyee's id or collection separated by comma.

filter%5BcreationDateFromd%5D: Filter by creation date from (inclusive).

filter%5BcreationDateTo%5D: Filter by creation date to (inclusive).

filter%5BtagId%5D: Filter by tag id or tag ids separated by comma.

filter%5BcrmStatusId%5D: Filter by CRM status id or CRM status ids separated by comma.

filter%5BpersonalDataProcessingAgreement%5D: Filter customer's by personal data processing agreeement. 0 - for "no", 1 - for "yes".

filter%5BmarketingContentAgreement%5D: Filter customer's by markenting content agreement. 0 - for "no", 1 - for "yes".

filter%5BmailSmsMessagesAgreement%5D: Filter customer's by e-mail and SMS messages delivery agreement. 0 - for "no", 1 - for "yes".

filter%5BcommercialContentAgreement%5D: Filter customer's by commercial content delivery agreement. 0 - for "no", 1 - for "yes".

filter%5BproductCategoryId%5D: Filter by customer's product category id or ids separated by comma.

filter%5BproductProducerId%5D: Filter by customers product producer id or ids separated by comma.

filter%5BproductId%5D: Filter by customers product id or ids separated by comma.

filter%5BcontractStatusId%5D: Filter by contract status id or ids separated by comma.

Enumerated Values

Parameter Value
filter%5BpersonalDataProcessingAgreement%5D 0
filter%5BpersonalDataProcessingAgreement%5D 1
filter%5BmarketingContentAgreement%5D 0
filter%5BmarketingContentAgreement%5D 1
filter%5BmailSmsMessagesAgreement%5D 0
filter%5BmailSmsMessagesAgreement%5D 1
filter%5BcommercialContentAgreement%5D 0
filter%5BcommercialContentAgreement%5D 1

Example responses

200 Response

{
  "links": {
    "self": "/customers?page%5Bpage%5D=2",
    "first": "/customers?page%5Bpage%5D=1",
    "prev": "/customers?page%5Bpage%5D=1",
    "next": "/customers?page%5Bpage%5D=3",
    "last": "/customers?page%5Bpage%5D=3"
  },
  "meta": {
    "totalItems": 4,
    "itemsPerPage": 4,
    "currentPage": 1
  },
  "data": [
    {
      "id": "/api/customers/15",
      "type": "Customer",
      "attributes": {
        "_id": 12333,
        "firstname": "James",
        "lastname": "Smith",
        "parentUserId": 1,
        "path": "/1/2",
        "email": "kljkasd@o2.pl",
        "originsStatus": "1",
        "personalDataProcessingAgreement": true,
        "commercialContentAgreement": true,
        "marketingContentAgreement": false,
        "mailSmsMessagesAgreement": true,
        "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
        "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
        "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
        "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
        "visibility": "ADVISER_ONLY",
        "idCardSeries": "STM",
        "phone": "48943210675",
        "pesel": "33072308033",
        "city": "Wroclaw",
        "street": "Jaworowa",
        "houseNumber": "20A/77",
        "premisesNumber": "18",
        "postcode": "00-930",
        "state": "Krakow",
        "region": "Malopolskie",
        "gender": "male",
        "birthday": "2000-01-30",
        "driveLicenceDate": "2000-01-30",
        "invoiceCity": "Poznan",
        "invoiceEmail": "kljkasd@o2.pl",
        "invoiceStreet": "Topolowa",
        "invoiceHouseNumber": "30A/36",
        "invoicePremisesNumber": "37A",
        "invoicePostcode": "invoicePostcode",
        "invoiceNip": "2967751927",
        "invoiceName": "Faktura",
        "additionalPhone": "48475036329",
        "additionalEmail": "emilia05@sawicka.pl",
        "additionalCity": "Sieradz",
        "additionalStreet": "Orzeszkowej Elizy",
        "additionalHouseNumber": "89/11",
        "additionalPremisesNumber": "42/69",
        "additionalPostcode": "07-524",
        "officeCity": "Poznan",
        "officeStreet": "Cisowa",
        "officeHouseNumber": "32A",
        "officePremisesNumber": "11",
        "officePostcode": "26-536",
        "createdDate": "2020-09-25T00:00:00+02:00",
        "modifiedDate": "2020-09-25T00:00:00+02:00",
        "tags": [
          "VIP"
        ],
        "description": "My description",
        "linkedIn": "string",
        "facebook": "string",
        "extraFields": {
          "property1": "string",
          "property2": "string"
        },
        "extraAgreements": {
          "property1": true,
          "property2": true
        },
        "country": "Polska",
        "invoiceCountry": "Polska",
        "additionalCountry": "Polska",
        "officeCountry": "Polska",
        "origins": "Lead"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of customers. Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links PaginationLinks false none none
»» self string false none none
»» first string false none none
»» prev string false none none
»» next string false none none
»» last string false none none
» meta Meta false none none
»» totalItems integer false none none
»» itemsPerPage integer false none none
»» currentPage integer false none none
» data [CustomerData] true none none
»» id string false none none
»» type string false none none
»» attributes any false none none

allOf

Name Type Required Restrictions Description
»»» anonymous any false none none

allOf

Name Type Required Restrictions Description
»»»» anonymous BaseCustomer false none none
»»»»» _id integer false read-only none
»»»»» firstname string false none none
»»»»» lastname string false none none
»»»»» parentUserId integer false none none
»»»»» path string false read-only none
»»»»» email string(email) false none none
»»»»» originsStatus string false none none
»»»»» personalDataProcessingAgreement boolean false none none
»»»»» commercialContentAgreement boolean false none none
»»»»» marketingContentAgreement boolean false none none
»»»»» mailSmsMessagesAgreement boolean false none none
»»»»» personalDataProcessingAgreementModified string(date-time) false read-only none
»»»»» commercialContentAgreementModified string(date-time) false read-only none
»»»»» marketingContentAgreementModified string(date-time) false read-only none
»»»»» mailSmsMessagesAgreementModified string(date-time) false read-only none
»»»»» visibility string false none none
»»»»» idCardSeries string false none none
»»»»» phone string false none none
»»»»» pesel string false none none
»»»»» city string false none none
»»»»» street string false none none
»»»»» houseNumber string false none none
»»»»» premisesNumber string false none none
»»»»» postcode string false none none
»»»»» state string false none none
»»»»» region string false none none
»»»»» gender string false none none
»»»»» birthday string(date) false none none
»»»»» driveLicenceDate string(date) false none none
»»»»» invoiceCity string false none none
»»»»» invoiceEmail string(email) false none none
»»»»» invoiceStreet string false none none
»»»»» invoiceHouseNumber string false none none
»»»»» invoicePremisesNumber string false none none
»»»»» invoicePostcode string false none none
»»»»» invoiceNip string false none none
»»»»» invoiceName string false none none
»»»»» additionalPhone string false none none
»»»»» additionalEmail string(email) false none none
»»»»» additionalCity string false none none
»»»»» additionalStreet string false none none
»»»»» additionalHouseNumber string false none none
»»»»» additionalPremisesNumber string false none none
»»»»» additionalPostcode string false none none
»»»»» officeCity string false none none
»»»»» officeStreet string false none none
»»»»» officeHouseNumber string false none none
»»»»» officePremisesNumber string false none none
»»»»» officePostcode string false none none
»»»»» createdDate string(date-time) false read-only none
»»»»» modifiedDate string(date-time) false read-only none
»»»»» tags [string] false none none
»»»»» description string false none none
»»»»» linkedIn string false none none
»»»»» facebook string false none none
»»»»» extraFields object false none User defined fields
»»»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»»»» extraAgreements object false none User defined agreements
»»»»»» additionalProperties boolean false none none

and

Name Type Required Restrictions Description
»»»» anonymous object false none none
»»»»» country string false none none
»»»»» invoiceCountry string false none none
»»»»» additionalCountry string false none none
»»»»» officeCountry string false none none

and

Name Type Required Restrictions Description
»»» anonymous object false none none
»»»» origins string false none none

Enumerated Values

Property Value
gender male
gender female

post_customers

Code samples

# You can also use wget
curl -X POST https://app.bergsystem.pl/api/customers \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

POST https://app.bergsystem.pl/api/customers HTTP/1.1
Host: app.bergsystem.pl
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
X-Tenant: string

const inputBody = '{
  "data": {
    "firstname": "James",
    "lastname": "Smith",
    "parentUserId": 1,
    "email": "kljkasd@o2.pl",
    "originsStatus": "1",
    "personalDataProcessingAgreement": true,
    "commercialContentAgreement": true,
    "marketingContentAgreement": false,
    "mailSmsMessagesAgreement": true,
    "visibility": "ADVISER_ONLY",
    "idCardSeries": "STM",
    "phone": "48943210675",
    "pesel": "33072308033",
    "city": "Wroclaw",
    "street": "Jaworowa",
    "houseNumber": "20A/77",
    "premisesNumber": "18",
    "postcode": "00-930",
    "state": "Krakow",
    "region": "Malopolskie",
    "gender": "male",
    "birthday": "2000-01-30",
    "driveLicenceDate": "2000-01-30",
    "invoiceCity": "Poznan",
    "invoiceEmail": "kljkasd@o2.pl",
    "invoiceStreet": "Topolowa",
    "invoiceHouseNumber": "30A/36",
    "invoicePremisesNumber": "37A",
    "invoicePostcode": "invoicePostcode",
    "invoiceNip": "2967751927",
    "invoiceName": "Faktura",
    "additionalPhone": "48475036329",
    "additionalEmail": "emilia05@sawicka.pl",
    "additionalCity": "Sieradz",
    "additionalStreet": "Orzeszkowej Elizy",
    "additionalHouseNumber": "89/11",
    "additionalPremisesNumber": "42/69",
    "additionalPostcode": "07-524",
    "officeCity": "Poznan",
    "officeStreet": "Cisowa",
    "officeHouseNumber": "32A",
    "officePremisesNumber": "11",
    "officePostcode": "26-536",
    "tags": [
      "VIP"
    ],
    "description": "My description",
    "linkedIn": "string",
    "facebook": "string",
    "extraFields": {
      "property1": "string",
      "property2": "string"
    },
    "extraAgreements": {
      "property1": true,
      "property2": true
    },
    "originsId": 1,
    "countryId": 135,
    "invoiceCountryId": 135,
    "additionalCountryId": 135,
    "officeCountryId": 135
  }
}';
const headers = {
  'Content-Type':'application/vnd.api+json',
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/customers',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/vnd.api+json',
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://app.bergsystem.pl/api/customers',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/vnd.api+json',
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://app.bergsystem.pl/api/customers', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/vnd.api+json',
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://app.bergsystem.pl/api/customers', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/customers");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/vnd.api+json"},
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.bergsystem.pl/api/customers", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /customers

Body parameter

{
  "data": {
    "firstname": "James",
    "lastname": "Smith",
    "parentUserId": 1,
    "email": "kljkasd@o2.pl",
    "originsStatus": "1",
    "personalDataProcessingAgreement": true,
    "commercialContentAgreement": true,
    "marketingContentAgreement": false,
    "mailSmsMessagesAgreement": true,
    "visibility": "ADVISER_ONLY",
    "idCardSeries": "STM",
    "phone": "48943210675",
    "pesel": "33072308033",
    "city": "Wroclaw",
    "street": "Jaworowa",
    "houseNumber": "20A/77",
    "premisesNumber": "18",
    "postcode": "00-930",
    "state": "Krakow",
    "region": "Malopolskie",
    "gender": "male",
    "birthday": "2000-01-30",
    "driveLicenceDate": "2000-01-30",
    "invoiceCity": "Poznan",
    "invoiceEmail": "kljkasd@o2.pl",
    "invoiceStreet": "Topolowa",
    "invoiceHouseNumber": "30A/36",
    "invoicePremisesNumber": "37A",
    "invoicePostcode": "invoicePostcode",
    "invoiceNip": "2967751927",
    "invoiceName": "Faktura",
    "additionalPhone": "48475036329",
    "additionalEmail": "emilia05@sawicka.pl",
    "additionalCity": "Sieradz",
    "additionalStreet": "Orzeszkowej Elizy",
    "additionalHouseNumber": "89/11",
    "additionalPremisesNumber": "42/69",
    "additionalPostcode": "07-524",
    "officeCity": "Poznan",
    "officeStreet": "Cisowa",
    "officeHouseNumber": "32A",
    "officePremisesNumber": "11",
    "officePostcode": "26-536",
    "tags": [
      "VIP"
    ],
    "description": "My description",
    "linkedIn": "string",
    "facebook": "string",
    "extraFields": {
      "property1": "string",
      "property2": "string"
    },
    "extraAgreements": {
      "property1": true,
      "property2": true
    },
    "originsId": 1,
    "countryId": 135,
    "invoiceCountryId": 135,
    "additionalCountryId": 135,
    "officeCountryId": 135
  }
}

An endpoint that allows to create customer with the requested data payload.

Parameters

Name In Type Required Description
body body object true none
» data body any false none
»» anonymous body BaseCustomer false none
»»» _id body integer false none
»»» firstname body string false none
»»» lastname body string false none
»»» parentUserId body integer false none
»»» path body string false none
»»» email body string(email) false none
»»» originsStatus body string false none
»»» personalDataProcessingAgreement body boolean false none
»»» commercialContentAgreement body boolean false none
»»» marketingContentAgreement body boolean false none
»»» mailSmsMessagesAgreement body boolean false none
»»» personalDataProcessingAgreementModified body string(date-time) false none
»»» commercialContentAgreementModified body string(date-time) false none
»»» marketingContentAgreementModified body string(date-time) false none
»»» mailSmsMessagesAgreementModified body string(date-time) false none
»»» visibility body string false none
»»» idCardSeries body string false none
»»» phone body string false none
»»» pesel body string false none
»»» city body string false none
»»» street body string false none
»»» houseNumber body string false none
»»» premisesNumber body string false none
»»» postcode body string false none
»»» state body string false none
»»» region body string false none
»»» gender body string false none
»»» birthday body string(date) false none
»»» driveLicenceDate body string(date) false none
»»» invoiceCity body string false none
»»» invoiceEmail body string(email) false none
»»» invoiceStreet body string false none
»»» invoiceHouseNumber body string false none
»»» invoicePremisesNumber body string false none
»»» invoicePostcode body string false none
»»» invoiceNip body string false none
»»» invoiceName body string false none
»»» additionalPhone body string false none
»»» additionalEmail body string(email) false none
»»» additionalCity body string false none
»»» additionalStreet body string false none
»»» additionalHouseNumber body string false none
»»» additionalPremisesNumber body string false none
»»» additionalPostcode body string false none
»»» officeCity body string false none
»»» officeStreet body string false none
»»» officeHouseNumber body string false none
»»» officePremisesNumber body string false none
»»» officePostcode body string false none
»»» createdDate body string(date-time) false none
»»» modifiedDate body string(date-time) false none
»»» tags body [string] false none
»»» description body string false none
»»» linkedIn body string false none
»»» facebook body string false none
»»» extraFields body object false User defined fields
»»»» additionalProperties body any false none
»»»»» anonymous body string false none
»»»»» anonymous body integer false none
»»»»» anonymous body boolean false none
»»» extraAgreements body object false User defined agreements
»»»» additionalProperties body boolean false none
»» anonymous body object false none
»»» originsId body integer false none
»»» countryId body integer false none
»»» invoiceCountryId body integer false none
»»» additionalCountryId body integer false none
»»» officeCountryId body integer false none
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Enumerated Values

Parameter Value
»»» gender male
»»» gender female

Example responses

201 Response

{
  "data": {
    "id": "/api/customers/15",
    "type": "Customer",
    "attributes": {
      "_id": 12333,
      "firstname": "James",
      "lastname": "Smith",
      "parentUserId": 1,
      "path": "/1/2",
      "email": "kljkasd@o2.pl",
      "originsStatus": "1",
      "personalDataProcessingAgreement": true,
      "commercialContentAgreement": true,
      "marketingContentAgreement": false,
      "mailSmsMessagesAgreement": true,
      "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
      "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
      "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
      "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
      "visibility": "ADVISER_ONLY",
      "idCardSeries": "STM",
      "phone": "48943210675",
      "pesel": "33072308033",
      "city": "Wroclaw",
      "street": "Jaworowa",
      "houseNumber": "20A/77",
      "premisesNumber": "18",
      "postcode": "00-930",
      "state": "Krakow",
      "region": "Malopolskie",
      "gender": "male",
      "birthday": "2000-01-30",
      "driveLicenceDate": "2000-01-30",
      "invoiceCity": "Poznan",
      "invoiceEmail": "kljkasd@o2.pl",
      "invoiceStreet": "Topolowa",
      "invoiceHouseNumber": "30A/36",
      "invoicePremisesNumber": "37A",
      "invoicePostcode": "invoicePostcode",
      "invoiceNip": "2967751927",
      "invoiceName": "Faktura",
      "additionalPhone": "48475036329",
      "additionalEmail": "emilia05@sawicka.pl",
      "additionalCity": "Sieradz",
      "additionalStreet": "Orzeszkowej Elizy",
      "additionalHouseNumber": "89/11",
      "additionalPremisesNumber": "42/69",
      "additionalPostcode": "07-524",
      "officeCity": "Poznan",
      "officeStreet": "Cisowa",
      "officeHouseNumber": "32A",
      "officePremisesNumber": "11",
      "officePostcode": "26-536",
      "createdDate": "2020-09-25T00:00:00+02:00",
      "modifiedDate": "2020-09-25T00:00:00+02:00",
      "tags": [
        "VIP"
      ],
      "description": "My description",
      "linkedIn": "string",
      "facebook": "string",
      "extraFields": {
        "property1": "string",
        "property2": "string"
      },
      "extraAgreements": {
        "property1": true,
        "property2": true
      },
      "country": "Polska",
      "invoiceCountry": "Polska",
      "additionalCountry": "Polska",
      "officeCountry": "Polska",
      "origins": "Lead"
    }
  }
}

Responses

Status Meaning Description Schema
201 Created Customers data. Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error
404 Not Found Resource not found. Error

Response Schema

Status Code 201

Name Type Required Restrictions Description
» data CustomerData false none none
»» id string false none none
»» type string false none none
»» attributes any false none none

allOf

Name Type Required Restrictions Description
»»» anonymous any false none none

allOf

Name Type Required Restrictions Description
»»»» anonymous BaseCustomer false none none
»»»»» _id integer false read-only none
»»»»» firstname string false none none
»»»»» lastname string false none none
»»»»» parentUserId integer false none none
»»»»» path string false read-only none
»»»»» email string(email) false none none
»»»»» originsStatus string false none none
»»»»» personalDataProcessingAgreement boolean false none none
»»»»» commercialContentAgreement boolean false none none
»»»»» marketingContentAgreement boolean false none none
»»»»» mailSmsMessagesAgreement boolean false none none
»»»»» personalDataProcessingAgreementModified string(date-time) false read-only none
»»»»» commercialContentAgreementModified string(date-time) false read-only none
»»»»» marketingContentAgreementModified string(date-time) false read-only none
»»»»» mailSmsMessagesAgreementModified string(date-time) false read-only none
»»»»» visibility string false none none
»»»»» idCardSeries string false none none
»»»»» phone string false none none
»»»»» pesel string false none none
»»»»» city string false none none
»»»»» street string false none none
»»»»» houseNumber string false none none
»»»»» premisesNumber string false none none
»»»»» postcode string false none none
»»»»» state string false none none
»»»»» region string false none none
»»»»» gender string false none none
»»»»» birthday string(date) false none none
»»»»» driveLicenceDate string(date) false none none
»»»»» invoiceCity string false none none
»»»»» invoiceEmail string(email) false none none
»»»»» invoiceStreet string false none none
»»»»» invoiceHouseNumber string false none none
»»»»» invoicePremisesNumber string false none none
»»»»» invoicePostcode string false none none
»»»»» invoiceNip string false none none
»»»»» invoiceName string false none none
»»»»» additionalPhone string false none none
»»»»» additionalEmail string(email) false none none
»»»»» additionalCity string false none none
»»»»» additionalStreet string false none none
»»»»» additionalHouseNumber string false none none
»»»»» additionalPremisesNumber string false none none
»»»»» additionalPostcode string false none none
»»»»» officeCity string false none none
»»»»» officeStreet string false none none
»»»»» officeHouseNumber string false none none
»»»»» officePremisesNumber string false none none
»»»»» officePostcode string false none none
»»»»» createdDate string(date-time) false read-only none
»»»»» modifiedDate string(date-time) false read-only none
»»»»» tags [string] false none none
»»»»» description string false none none
»»»»» linkedIn string false none none
»»»»» facebook string false none none
»»»»» extraFields object false none User defined fields
»»»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»»»» extraAgreements object false none User defined agreements
»»»»»» additionalProperties boolean false none none

and

Name Type Required Restrictions Description
»»»» anonymous object false none none
»»»»» country string false none none
»»»»» invoiceCountry string false none none
»»»»» additionalCountry string false none none
»»»»» officeCountry string false none none

and

Name Type Required Restrictions Description
»»» anonymous object false none none
»»»» origins string false none none

Enumerated Values

Property Value
gender male
gender female

Customer Extra Fields

get_customer_extra_fields

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/customer_extra_fields \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/customer_extra_fields HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json


const headers = {
  'Accept':'application/vnd.api+json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/customer_extra_fields',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/customer_extra_fields',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/customer_extra_fields', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/customer_extra_fields', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/customer_extra_fields");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/customer_extra_fields", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /customer_extra_fields

Example responses

200 Response

{
  "links": {
    "self": "/api/customer_extra_fields"
  },
  "meta": {
    "totalItems": 4
  },
  "data": [
    {
      "id": "/api/customer_extra_fields/1243",
      "type": "CustomerExtraField",
      "attributes": {
        "_id": 1243,
        "label": "Product name",
        "key": "ProductName1"
      }
    }
  ]
}

An endpoint that allows to get collection of all active extra fields for customers.

Responses

Status Meaning Description Schema
200 OK List of customer extra fields. Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links object false none none
»» self string false none none
» meta object false none none
»» totalItems integer false none none
» data [CustomerExtraFieldData] true none none
»» id string false none none
»» type string false none none
»» attributes ExtraField false none none
»»» _id integer false read-only none
»»» label string false none none
»»» key string false none none

Customer Extra Agreements

get_customer_extra_agreements

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/customer_extra_agreements \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/customer_extra_agreements HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json


const headers = {
  'Accept':'application/vnd.api+json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/customer_extra_agreements',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/customer_extra_agreements',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/customer_extra_agreements', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/customer_extra_agreements', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/customer_extra_agreements");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/customer_extra_agreements", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /customer_extra_agreements

Example responses

200 Response

{
  "links": {
    "self": "/api/customer_extra_agreements"
  },
  "meta": {
    "totalItems": 4
  },
  "data": [
    {
      "id": "/api/customer_extra_agreements/1243",
      "type": "CustomerExtraAgreement",
      "attributes": {
        "_id": 1243,
        "label": "Agreement name",
        "key": "smsAgreement",
        "active": true
      }
    }
  ]
}

An endpoint that allows to get collection of all active extra agreements for customers.

Responses

Status Meaning Description Schema
200 OK List of customer extra agreements. Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links object false none none
»» self string false none none
» meta object false none none
»» totalItems integer false none none
» data [CustomerExtraAgreementsData] true none none
»» id string false none none
»» type string false none none
»» attributes ExtraAgreement false none none
»»» _id integer false read-only none
»»» label string false none none
»»» key string false none Dynamic api key like rodo_{id} or static like smsAgreement
»»» active boolean false none none

Employees

get_employees

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/employees \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/employees HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/employees',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/employees',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/employees', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/employees', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/employees");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/employees", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /employees

An endpoint that allows to get collection of employees data, it is possible to filter and sort according to selected fields.

Parameters

Name In Type Required Description
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Example responses

200 Response

{
  "links": {
    "self": "/customers?page%5Bpage%5D=2",
    "first": "/customers?page%5Bpage%5D=1",
    "prev": "/customers?page%5Bpage%5D=1",
    "next": "/customers?page%5Bpage%5D=3",
    "last": "/customers?page%5Bpage%5D=3"
  },
  "meta": {
    "totalItems": 4,
    "itemsPerPage": 4,
    "currentPage": 1
  },
  "data": [
    {
      "id": "/api/employees/15",
      "type": "Employee",
      "attributtes": {
        "_id": 12333,
        "firstname": "James",
        "lastname": "Smith",
        "parentUserId": 1,
        "path": "/1/2",
        "email": "kljkasd@o2.pl",
        "originsStatus": "1",
        "personalDataProcessingAgreement": true,
        "commercialContentAgreement": true,
        "marketingContentAgreement": false,
        "mailSmsMessagesAgreement": true,
        "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
        "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
        "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
        "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
        "visibility": "ADVISER_ONLY",
        "idCardSeries": "STM",
        "phone": "48943210675",
        "pesel": "string",
        "city": "Wroclaw",
        "street": "Jaworowa",
        "houseNumber": "20A/77",
        "premisesNumber": "18",
        "postcode": "00-930",
        "state": "Krakow",
        "region": "Malopolskie",
        "gender": "string",
        "birthday": "string",
        "driveLicenceDate": "2000-01-30",
        "invoiceCity": "Poznan",
        "invoiceEmail": "kljkasd@o2.pl",
        "invoiceStreet": "Topolowa",
        "invoiceHouseNumber": "30A/36",
        "invoicePremisesNumber": "37A",
        "invoicePostcode": "invoicePostcode",
        "invoiceNip": "2967751927",
        "invoiceName": "Faktura",
        "additionalPhone": "48475036329",
        "additionalEmail": "emilia05@sawicka.pl",
        "additionalCity": "Sieradz",
        "additionalStreet": "Orzeszkowej Elizy",
        "additionalHouseNumber": "89/11",
        "additionalPremisesNumber": "42/69",
        "additionalPostcode": "07-524",
        "officeCity": "Poznan",
        "officeStreet": "Cisowa",
        "officeHouseNumber": "32A",
        "officePremisesNumber": "11",
        "officePostcode": "26-536",
        "createdDate": "2020-09-25T00:00:00+02:00",
        "modifiedDate": "2020-09-25T00:00:00+02:00",
        "tags": [
          "VIP"
        ],
        "description": "My description",
        "linkedIn": "string",
        "facebook": "string",
        "extraFields": {
          "property1": "string",
          "property2": "string"
        },
        "extraAgreements": {
          "property1": true,
          "property2": true
        },
        "country": "Polska",
        "invoiceCountry": "Polska",
        "additionalCountry": "Polska",
        "officeCountry": "Polska",
        "firstName": "string",
        "lastName": "string",
        "driveLicenseDate": "string"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of employees Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links PaginationLinks false none none
»» self string false none none
»» first string false none none
»» prev string false none none
»» next string false none none
»» last string false none none
» meta Meta false none none
»» totalItems integer false none none
»» itemsPerPage integer false none none
»» currentPage integer false none none
» data [Employee] true none none
»» id string false none none
»» type string false none none
»» attributtes any false none none

allOf

Name Type Required Restrictions Description
»»» anonymous any false none none

allOf

Name Type Required Restrictions Description
»»»» anonymous BaseCustomer false none none
»»»»» _id integer false read-only none
»»»»» firstname string false none none
»»»»» lastname string false none none
»»»»» parentUserId integer false none none
»»»»» path string false read-only none
»»»»» email string(email) false none none
»»»»» originsStatus string false none none
»»»»» personalDataProcessingAgreement boolean false none none
»»»»» commercialContentAgreement boolean false none none
»»»»» marketingContentAgreement boolean false none none
»»»»» mailSmsMessagesAgreement boolean false none none
»»»»» personalDataProcessingAgreementModified string(date-time) false read-only none
»»»»» commercialContentAgreementModified string(date-time) false read-only none
»»»»» marketingContentAgreementModified string(date-time) false read-only none
»»»»» mailSmsMessagesAgreementModified string(date-time) false read-only none
»»»»» visibility string false none none
»»»»» idCardSeries string false none none
»»»»» phone string false none none
»»»»» pesel string false none none
»»»»» city string false none none
»»»»» street string false none none
»»»»» houseNumber string false none none
»»»»» premisesNumber string false none none
»»»»» postcode string false none none
»»»»» state string false none none
»»»»» region string false none none
»»»»» gender string false none none
»»»»» birthday string(date) false none none
»»»»» driveLicenceDate string(date) false none none
»»»»» invoiceCity string false none none
»»»»» invoiceEmail string(email) false none none
»»»»» invoiceStreet string false none none
»»»»» invoiceHouseNumber string false none none
»»»»» invoicePremisesNumber string false none none
»»»»» invoicePostcode string false none none
»»»»» invoiceNip string false none none
»»»»» invoiceName string false none none
»»»»» additionalPhone string false none none
»»»»» additionalEmail string(email) false none none
»»»»» additionalCity string false none none
»»»»» additionalStreet string false none none
»»»»» additionalHouseNumber string false none none
»»»»» additionalPremisesNumber string false none none
»»»»» additionalPostcode string false none none
»»»»» officeCity string false none none
»»»»» officeStreet string false none none
»»»»» officeHouseNumber string false none none
»»»»» officePremisesNumber string false none none
»»»»» officePostcode string false none none
»»»»» createdDate string(date-time) false read-only none
»»»»» modifiedDate string(date-time) false read-only none
»»»»» tags [string] false none none
»»»»» description string false none none
»»»»» linkedIn string false none none
»»»»» facebook string false none none
»»»»» extraFields object false none User defined fields
»»»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»»»» extraAgreements object false none User defined agreements
»»»»»» additionalProperties boolean false none none

and

Name Type Required Restrictions Description
»»»» anonymous object false none none
»»»»» country string false none none
»»»»» invoiceCountry string false none none
»»»»» additionalCountry string false none none
»»»»» officeCountry string false none none

and

Name Type Required Restrictions Description
»»» anonymous object false none none
»»»» firstName string¦null false none none
»»»» lastName string¦null false none none
»»»» pesel string¦null false none none
»»»» gender string¦null false none none
»»»» driveLicenseDate string¦null false none none
»»»» birthday string¦null false none none
»»»» extraFields object false none none

Enumerated Values

Property Value
gender male
gender female

post_employees

Code samples

# You can also use wget
curl -X POST https://app.bergsystem.pl/api/employees \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

POST https://app.bergsystem.pl/api/employees HTTP/1.1
Host: app.bergsystem.pl
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
X-Tenant: string

const inputBody = '{
  "data": {
    "attributes": {
      "id": "/api/employees/15",
      "type": "Employee",
      "attributtes": {
        "firstname": "James",
        "lastname": "Smith",
        "parentUserId": 1,
        "email": "kljkasd@o2.pl",
        "originsStatus": "1",
        "personalDataProcessingAgreement": true,
        "commercialContentAgreement": true,
        "marketingContentAgreement": false,
        "mailSmsMessagesAgreement": true,
        "visibility": "ADVISER_ONLY",
        "idCardSeries": "STM",
        "phone": "48943210675",
        "pesel": "string",
        "city": "Wroclaw",
        "street": "Jaworowa",
        "houseNumber": "20A/77",
        "premisesNumber": "18",
        "postcode": "00-930",
        "state": "Krakow",
        "region": "Malopolskie",
        "gender": "string",
        "birthday": "string",
        "driveLicenceDate": "2000-01-30",
        "invoiceCity": "Poznan",
        "invoiceEmail": "kljkasd@o2.pl",
        "invoiceStreet": "Topolowa",
        "invoiceHouseNumber": "30A/36",
        "invoicePremisesNumber": "37A",
        "invoicePostcode": "invoicePostcode",
        "invoiceNip": "2967751927",
        "invoiceName": "Faktura",
        "additionalPhone": "48475036329",
        "additionalEmail": "emilia05@sawicka.pl",
        "additionalCity": "Sieradz",
        "additionalStreet": "Orzeszkowej Elizy",
        "additionalHouseNumber": "89/11",
        "additionalPremisesNumber": "42/69",
        "additionalPostcode": "07-524",
        "officeCity": "Poznan",
        "officeStreet": "Cisowa",
        "officeHouseNumber": "32A",
        "officePremisesNumber": "11",
        "officePostcode": "26-536",
        "tags": [
          "VIP"
        ],
        "description": "My description",
        "linkedIn": "string",
        "facebook": "string",
        "extraFields": {
          "property1": "string",
          "property2": "string"
        },
        "extraAgreements": {
          "property1": true,
          "property2": true
        },
        "country": "Polska",
        "invoiceCountry": "Polska",
        "additionalCountry": "Polska",
        "officeCountry": "Polska",
        "firstName": "string",
        "lastName": "string",
        "driveLicenseDate": "string"
      }
    }
  }
}';
const headers = {
  'Content-Type':'application/vnd.api+json',
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/employees',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/vnd.api+json',
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://app.bergsystem.pl/api/employees',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/vnd.api+json',
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://app.bergsystem.pl/api/employees', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/vnd.api+json',
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://app.bergsystem.pl/api/employees', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/employees");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/vnd.api+json"},
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.bergsystem.pl/api/employees", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /employees

Body parameter

{
  "data": {
    "attributes": {
      "id": "/api/employees/15",
      "type": "Employee",
      "attributtes": {
        "firstname": "James",
        "lastname": "Smith",
        "parentUserId": 1,
        "email": "kljkasd@o2.pl",
        "originsStatus": "1",
        "personalDataProcessingAgreement": true,
        "commercialContentAgreement": true,
        "marketingContentAgreement": false,
        "mailSmsMessagesAgreement": true,
        "visibility": "ADVISER_ONLY",
        "idCardSeries": "STM",
        "phone": "48943210675",
        "pesel": "string",
        "city": "Wroclaw",
        "street": "Jaworowa",
        "houseNumber": "20A/77",
        "premisesNumber": "18",
        "postcode": "00-930",
        "state": "Krakow",
        "region": "Malopolskie",
        "gender": "string",
        "birthday": "string",
        "driveLicenceDate": "2000-01-30",
        "invoiceCity": "Poznan",
        "invoiceEmail": "kljkasd@o2.pl",
        "invoiceStreet": "Topolowa",
        "invoiceHouseNumber": "30A/36",
        "invoicePremisesNumber": "37A",
        "invoicePostcode": "invoicePostcode",
        "invoiceNip": "2967751927",
        "invoiceName": "Faktura",
        "additionalPhone": "48475036329",
        "additionalEmail": "emilia05@sawicka.pl",
        "additionalCity": "Sieradz",
        "additionalStreet": "Orzeszkowej Elizy",
        "additionalHouseNumber": "89/11",
        "additionalPremisesNumber": "42/69",
        "additionalPostcode": "07-524",
        "officeCity": "Poznan",
        "officeStreet": "Cisowa",
        "officeHouseNumber": "32A",
        "officePremisesNumber": "11",
        "officePostcode": "26-536",
        "tags": [
          "VIP"
        ],
        "description": "My description",
        "linkedIn": "string",
        "facebook": "string",
        "extraFields": {
          "property1": "string",
          "property2": "string"
        },
        "extraAgreements": {
          "property1": true,
          "property2": true
        },
        "country": "Polska",
        "invoiceCountry": "Polska",
        "additionalCountry": "Polska",
        "officeCountry": "Polska",
        "firstName": "string",
        "lastName": "string",
        "driveLicenseDate": "string"
      }
    }
  }
}

An endpoint that allows to create employee with the requested data payload.

Parameters

Name In Type Required Description
body body object true none
» data body object false none
»» attributes body Employee false none
»»» id body string false none
»»» type body string false none
»»» attributtes body any false none
»»»» anonymous body any false none
»»»»» anonymous body BaseCustomer false none
»»»»»» _id body integer false none
»»»»»» firstname body string false none
»»»»»» lastname body string false none
»»»»»» parentUserId body integer false none
»»»»»» path body string false none
»»»»»» email body string(email) false none
»»»»»» originsStatus body string false none
»»»»»» personalDataProcessingAgreement body boolean false none
»»»»»» commercialContentAgreement body boolean false none
»»»»»» marketingContentAgreement body boolean false none
»»»»»» mailSmsMessagesAgreement body boolean false none
»»»»»» personalDataProcessingAgreementModified body string(date-time) false none
»»»»»» commercialContentAgreementModified body string(date-time) false none
»»»»»» marketingContentAgreementModified body string(date-time) false none
»»»»»» mailSmsMessagesAgreementModified body string(date-time) false none
»»»»»» visibility body string false none
»»»»»» idCardSeries body string false none
»»»»»» phone body string false none
»»»»»» pesel body string false none
»»»»»» city body string false none
»»»»»» street body string false none
»»»»»» houseNumber body string false none
»»»»»» premisesNumber body string false none
»»»»»» postcode body string false none
»»»»»» state body string false none
»»»»»» region body string false none
»»»»»» gender body string false none
»»»»»» birthday body string(date) false none
»»»»»» driveLicenceDate body string(date) false none
»»»»»» invoiceCity body string false none
»»»»»» invoiceEmail body string(email) false none
»»»»»» invoiceStreet body string false none
»»»»»» invoiceHouseNumber body string false none
»»»»»» invoicePremisesNumber body string false none
»»»»»» invoicePostcode body string false none
»»»»»» invoiceNip body string false none
»»»»»» invoiceName body string false none
»»»»»» additionalPhone body string false none
»»»»»» additionalEmail body string(email) false none
»»»»»» additionalCity body string false none
»»»»»» additionalStreet body string false none
»»»»»» additionalHouseNumber body string false none
»»»»»» additionalPremisesNumber body string false none
»»»»»» additionalPostcode body string false none
»»»»»» officeCity body string false none
»»»»»» officeStreet body string false none
»»»»»» officeHouseNumber body string false none
»»»»»» officePremisesNumber body string false none
»»»»»» officePostcode body string false none
»»»»»» createdDate body string(date-time) false none
»»»»»» modifiedDate body string(date-time) false none
»»»»»» tags body [string] false none
»»»»»» description body string false none
»»»»»» linkedIn body string false none
»»»»»» facebook body string false none
»»»»»» extraFields body object false User defined fields
»»»»»»» additionalProperties body any false none
»»»»»»»» anonymous body string false none
»»»»»»»» anonymous body integer false none
»»»»»»»» anonymous body boolean false none
»»»»»» extraAgreements body object false User defined agreements
»»»»»»» additionalProperties body boolean false none
»»»»» anonymous body object false none
»»»»»» country body string false none
»»»»»» invoiceCountry body string false none
»»»»»» additionalCountry body string false none
»»»»»» officeCountry body string false none
»»»» anonymous body object false none
»»»»» firstName body string¦null false none
»»»»» lastName body string¦null false none
»»»»» pesel body string¦null false none
»»»»» gender body string¦null false none
»»»»» driveLicenseDate body string¦null false none
»»»»» birthday body string¦null false none
»»»»» extraFields body object false none
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Enumerated Values

Parameter Value
»»»»»» gender male
»»»»»» gender female

Example responses

201 Response

{
  "data": {
    "id": "/api/employees/15",
    "type": "Employee",
    "attributtes": {
      "_id": 12333,
      "firstname": "James",
      "lastname": "Smith",
      "parentUserId": 1,
      "path": "/1/2",
      "email": "kljkasd@o2.pl",
      "originsStatus": "1",
      "personalDataProcessingAgreement": true,
      "commercialContentAgreement": true,
      "marketingContentAgreement": false,
      "mailSmsMessagesAgreement": true,
      "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
      "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
      "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
      "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
      "visibility": "ADVISER_ONLY",
      "idCardSeries": "STM",
      "phone": "48943210675",
      "pesel": "string",
      "city": "Wroclaw",
      "street": "Jaworowa",
      "houseNumber": "20A/77",
      "premisesNumber": "18",
      "postcode": "00-930",
      "state": "Krakow",
      "region": "Malopolskie",
      "gender": "string",
      "birthday": "string",
      "driveLicenceDate": "2000-01-30",
      "invoiceCity": "Poznan",
      "invoiceEmail": "kljkasd@o2.pl",
      "invoiceStreet": "Topolowa",
      "invoiceHouseNumber": "30A/36",
      "invoicePremisesNumber": "37A",
      "invoicePostcode": "invoicePostcode",
      "invoiceNip": "2967751927",
      "invoiceName": "Faktura",
      "additionalPhone": "48475036329",
      "additionalEmail": "emilia05@sawicka.pl",
      "additionalCity": "Sieradz",
      "additionalStreet": "Orzeszkowej Elizy",
      "additionalHouseNumber": "89/11",
      "additionalPremisesNumber": "42/69",
      "additionalPostcode": "07-524",
      "officeCity": "Poznan",
      "officeStreet": "Cisowa",
      "officeHouseNumber": "32A",
      "officePremisesNumber": "11",
      "officePostcode": "26-536",
      "createdDate": "2020-09-25T00:00:00+02:00",
      "modifiedDate": "2020-09-25T00:00:00+02:00",
      "tags": [
        "VIP"
      ],
      "description": "My description",
      "linkedIn": "string",
      "facebook": "string",
      "extraFields": {
        "property1": "string",
        "property2": "string"
      },
      "extraAgreements": {
        "property1": true,
        "property2": true
      },
      "country": "Polska",
      "invoiceCountry": "Polska",
      "additionalCountry": "Polska",
      "officeCountry": "Polska",
      "firstName": "string",
      "lastName": "string",
      "driveLicenseDate": "string"
    }
  }
}

Responses

Status Meaning Description Schema
201 Created Employee data Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error
404 Not Found Resource not found. Error

Response Schema

Status Code 201

Name Type Required Restrictions Description
» data Employee false none none
»» id string false none none
»» type string false none none
»» attributtes any false none none

allOf

Name Type Required Restrictions Description
»»» anonymous any false none none

allOf

Name Type Required Restrictions Description
»»»» anonymous BaseCustomer false none none
»»»»» _id integer false read-only none
»»»»» firstname string false none none
»»»»» lastname string false none none
»»»»» parentUserId integer false none none
»»»»» path string false read-only none
»»»»» email string(email) false none none
»»»»» originsStatus string false none none
»»»»» personalDataProcessingAgreement boolean false none none
»»»»» commercialContentAgreement boolean false none none
»»»»» marketingContentAgreement boolean false none none
»»»»» mailSmsMessagesAgreement boolean false none none
»»»»» personalDataProcessingAgreementModified string(date-time) false read-only none
»»»»» commercialContentAgreementModified string(date-time) false read-only none
»»»»» marketingContentAgreementModified string(date-time) false read-only none
»»»»» mailSmsMessagesAgreementModified string(date-time) false read-only none
»»»»» visibility string false none none
»»»»» idCardSeries string false none none
»»»»» phone string false none none
»»»»» pesel string false none none
»»»»» city string false none none
»»»»» street string false none none
»»»»» houseNumber string false none none
»»»»» premisesNumber string false none none
»»»»» postcode string false none none
»»»»» state string false none none
»»»»» region string false none none
»»»»» gender string false none none
»»»»» birthday string(date) false none none
»»»»» driveLicenceDate string(date) false none none
»»»»» invoiceCity string false none none
»»»»» invoiceEmail string(email) false none none
»»»»» invoiceStreet string false none none
»»»»» invoiceHouseNumber string false none none
»»»»» invoicePremisesNumber string false none none
»»»»» invoicePostcode string false none none
»»»»» invoiceNip string false none none
»»»»» invoiceName string false none none
»»»»» additionalPhone string false none none
»»»»» additionalEmail string(email) false none none
»»»»» additionalCity string false none none
»»»»» additionalStreet string false none none
»»»»» additionalHouseNumber string false none none
»»»»» additionalPremisesNumber string false none none
»»»»» additionalPostcode string false none none
»»»»» officeCity string false none none
»»»»» officeStreet string false none none
»»»»» officeHouseNumber string false none none
»»»»» officePremisesNumber string false none none
»»»»» officePostcode string false none none
»»»»» createdDate string(date-time) false read-only none
»»»»» modifiedDate string(date-time) false read-only none
»»»»» tags [string] false none none
»»»»» description string false none none
»»»»» linkedIn string false none none
»»»»» facebook string false none none
»»»»» extraFields object false none User defined fields
»»»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»»»» extraAgreements object false none User defined agreements
»»»»»» additionalProperties boolean false none none

and

Name Type Required Restrictions Description
»»»» anonymous object false none none
»»»»» country string false none none
»»»»» invoiceCountry string false none none
»»»»» additionalCountry string false none none
»»»»» officeCountry string false none none

and

Name Type Required Restrictions Description
»»» anonymous object false none none
»»»» firstName string¦null false none none
»»»» lastName string¦null false none none
»»»» pesel string¦null false none none
»»»» gender string¦null false none none
»»»» driveLicenseDate string¦null false none none
»»»» birthday string¦null false none none
»»»» extraFields object false none none

Enumerated Values

Property Value
gender male
gender female

get_employees_{id}

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/employees/{id} \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/employees/{id} HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/employees/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/employees/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/employees/{id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/employees/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/employees/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/employees/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /employees/{id}

An endpoint that allows to get employee data by its identifier.

Parameters

Name In Type Required Description
id path integer true Employee identifier
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Example responses

200 Response

{
  "data": {
    "id": "/api/employees/15",
    "type": "Employee",
    "attributtes": {
      "_id": 12333,
      "firstname": "James",
      "lastname": "Smith",
      "parentUserId": 1,
      "path": "/1/2",
      "email": "kljkasd@o2.pl",
      "originsStatus": "1",
      "personalDataProcessingAgreement": true,
      "commercialContentAgreement": true,
      "marketingContentAgreement": false,
      "mailSmsMessagesAgreement": true,
      "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
      "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
      "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
      "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
      "visibility": "ADVISER_ONLY",
      "idCardSeries": "STM",
      "phone": "48943210675",
      "pesel": "string",
      "city": "Wroclaw",
      "street": "Jaworowa",
      "houseNumber": "20A/77",
      "premisesNumber": "18",
      "postcode": "00-930",
      "state": "Krakow",
      "region": "Malopolskie",
      "gender": "string",
      "birthday": "string",
      "driveLicenceDate": "2000-01-30",
      "invoiceCity": "Poznan",
      "invoiceEmail": "kljkasd@o2.pl",
      "invoiceStreet": "Topolowa",
      "invoiceHouseNumber": "30A/36",
      "invoicePremisesNumber": "37A",
      "invoicePostcode": "invoicePostcode",
      "invoiceNip": "2967751927",
      "invoiceName": "Faktura",
      "additionalPhone": "48475036329",
      "additionalEmail": "emilia05@sawicka.pl",
      "additionalCity": "Sieradz",
      "additionalStreet": "Orzeszkowej Elizy",
      "additionalHouseNumber": "89/11",
      "additionalPremisesNumber": "42/69",
      "additionalPostcode": "07-524",
      "officeCity": "Poznan",
      "officeStreet": "Cisowa",
      "officeHouseNumber": "32A",
      "officePremisesNumber": "11",
      "officePostcode": "26-536",
      "createdDate": "2020-09-25T00:00:00+02:00",
      "modifiedDate": "2020-09-25T00:00:00+02:00",
      "tags": [
        "VIP"
      ],
      "description": "My description",
      "linkedIn": "string",
      "facebook": "string",
      "extraFields": {
        "property1": "string",
        "property2": "string"
      },
      "extraAgreements": {
        "property1": true,
        "property2": true
      },
      "country": "Polska",
      "invoiceCountry": "Polska",
      "additionalCountry": "Polska",
      "officeCountry": "Polska",
      "firstName": "string",
      "lastName": "string",
      "driveLicenseDate": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Employee data Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» data Employee false none none
»» id string false none none
»» type string false none none
»» attributtes any false none none

allOf

Name Type Required Restrictions Description
»»» anonymous any false none none

allOf

Name Type Required Restrictions Description
»»»» anonymous BaseCustomer false none none
»»»»» _id integer false read-only none
»»»»» firstname string false none none
»»»»» lastname string false none none
»»»»» parentUserId integer false none none
»»»»» path string false read-only none
»»»»» email string(email) false none none
»»»»» originsStatus string false none none
»»»»» personalDataProcessingAgreement boolean false none none
»»»»» commercialContentAgreement boolean false none none
»»»»» marketingContentAgreement boolean false none none
»»»»» mailSmsMessagesAgreement boolean false none none
»»»»» personalDataProcessingAgreementModified string(date-time) false read-only none
»»»»» commercialContentAgreementModified string(date-time) false read-only none
»»»»» marketingContentAgreementModified string(date-time) false read-only none
»»»»» mailSmsMessagesAgreementModified string(date-time) false read-only none
»»»»» visibility string false none none
»»»»» idCardSeries string false none none
»»»»» phone string false none none
»»»»» pesel string false none none
»»»»» city string false none none
»»»»» street string false none none
»»»»» houseNumber string false none none
»»»»» premisesNumber string false none none
»»»»» postcode string false none none
»»»»» state string false none none
»»»»» region string false none none
»»»»» gender string false none none
»»»»» birthday string(date) false none none
»»»»» driveLicenceDate string(date) false none none
»»»»» invoiceCity string false none none
»»»»» invoiceEmail string(email) false none none
»»»»» invoiceStreet string false none none
»»»»» invoiceHouseNumber string false none none
»»»»» invoicePremisesNumber string false none none
»»»»» invoicePostcode string false none none
»»»»» invoiceNip string false none none
»»»»» invoiceName string false none none
»»»»» additionalPhone string false none none
»»»»» additionalEmail string(email) false none none
»»»»» additionalCity string false none none
»»»»» additionalStreet string false none none
»»»»» additionalHouseNumber string false none none
»»»»» additionalPremisesNumber string false none none
»»»»» additionalPostcode string false none none
»»»»» officeCity string false none none
»»»»» officeStreet string false none none
»»»»» officeHouseNumber string false none none
»»»»» officePremisesNumber string false none none
»»»»» officePostcode string false none none
»»»»» createdDate string(date-time) false read-only none
»»»»» modifiedDate string(date-time) false read-only none
»»»»» tags [string] false none none
»»»»» description string false none none
»»»»» linkedIn string false none none
»»»»» facebook string false none none
»»»»» extraFields object false none User defined fields
»»»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»»»» extraAgreements object false none User defined agreements
»»»»»» additionalProperties boolean false none none

and

Name Type Required Restrictions Description
»»»» anonymous object false none none
»»»»» country string false none none
»»»»» invoiceCountry string false none none
»»»»» additionalCountry string false none none
»»»»» officeCountry string false none none

and

Name Type Required Restrictions Description
»»» anonymous object false none none
»»»» firstName string¦null false none none
»»»» lastName string¦null false none none
»»»» pesel string¦null false none none
»»»» gender string¦null false none none
»»»» driveLicenseDate string¦null false none none
»»»» birthday string¦null false none none
»»»» extraFields object false none none

Enumerated Values

Property Value
gender male
gender female

Companies

get_companies

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/companies \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/companies HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/companies',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/companies',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/companies', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/companies', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/companies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/companies", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /companies

An endpoint that allows to get collection of companies data, it is possible to filter and sort according to selected fields.

Parameters

Name In Type Required Description
page%5Bpage%5D query integer(int32) false Page number.
sort query string false Sort data by field. Default sorting order is ascending. To reverse it use "-" before field name.
filter%5Bid%5D query integer false Filter by company id.
filter%5Bname%5D query string false Filter by company's name or part of it.
filter%5Bcity%5D query string false Filter by company's city name or part of it.
filter%5Bnip%5D query string false Filter by company's NIP number.
filter%5Bphone%5D query string false Filter by company's phone number or part of it.
filter%5Bemail%5D query string false Filter by company's email or part of it.
filter%5BstateId%5D query string false Filter by company's state id or collection separated by comma.
filter%5BoriginsId%5D query string false Filter by company's origins id or collection separated by comma.
filter%5BparentUserId%5D query string false Filter by parent empoloyee's id or collection separated by comma.
filter%5BcreationDateFrom%5D query string(date) false Filter by creation date from (inclusive).
filter%5BcreationDateTo%5D query string(date) false Filter by creation date to (inclusive).
filter%5BtagId%5D query string false Filter by tag id or tag ids separated by comma.
filter%5BcrmStatusId%5D query string false Filter by CRM status id or CRM status ids separated by comma.
filter%5BproductCategoryId%5D query string false Filter by customer's product category id or ids separated by comma.
filter%5BproductProducerId%5D query string false Filter by customers product producer id or ids separated by comma.
filter%5BproductId%5D query string false Filter by customers product id or ids separated by comma.
filter%5BcontractStatusId%5D query string false Filter by contract status id or ids separated by comma.
filter query object false Extra fields filter. For example ?filter%5BextraField_myFieldd%5D=myValue
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Detailed descriptions

sort: Sort data by field. Default sorting order is ascending. To reverse it use "-" before field name. For sorting by extra fields use prefix "extraField_" before field name. Supported sorting fields: * name * parentUser * state * city * phone * email * nip * origins * crmStatus * id * ... and extra fields.

filter%5Bid%5D: Filter by company id.

filter%5Bname%5D: Filter by company's name or part of it.

filter%5Bcity%5D: Filter by company's city name or part of it.

filter%5Bnip%5D: Filter by company's NIP number.

filter%5Bphone%5D: Filter by company's phone number or part of it.

filter%5Bemail%5D: Filter by company's email or part of it.

filter%5BstateId%5D: Filter by company's state id or collection separated by comma.

filter%5BoriginsId%5D: Filter by company's origins id or collection separated by comma.

filter%5BparentUserId%5D: Filter by parent empoloyee's id or collection separated by comma.

filter%5BcreationDateFrom%5D: Filter by creation date from (inclusive).

filter%5BcreationDateTo%5D: Filter by creation date to (inclusive).

filter%5BtagId%5D: Filter by tag id or tag ids separated by comma.

filter%5BcrmStatusId%5D: Filter by CRM status id or CRM status ids separated by comma.

filter%5BproductCategoryId%5D: Filter by customer's product category id or ids separated by comma.

filter%5BproductProducerId%5D: Filter by customers product producer id or ids separated by comma.

filter%5BproductId%5D: Filter by customers product id or ids separated by comma.

filter%5BcontractStatusId%5D: Filter by contract status id or ids separated by comma.

Example responses

200 Response

{
  "links": {
    "self": "/customers?page%5Bpage%5D=2",
    "first": "/customers?page%5Bpage%5D=1",
    "prev": "/customers?page%5Bpage%5D=1",
    "next": "/customers?page%5Bpage%5D=3",
    "last": "/customers?page%5Bpage%5D=3"
  },
  "meta": {
    "totalItems": 4,
    "itemsPerPage": 4,
    "currentPage": 1
  },
  "data": [
    {
      "id": "/api/companies/15",
      "type": "Company",
      "attributes": {
        "_id": 12333,
        "firstname": "James",
        "lastname": "Smith",
        "parentUserId": 1,
        "path": "/1/2",
        "email": "kljkasd@o2.pl",
        "originsStatus": "1",
        "personalDataProcessingAgreement": true,
        "commercialContentAgreement": true,
        "marketingContentAgreement": false,
        "mailSmsMessagesAgreement": true,
        "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
        "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
        "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
        "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
        "visibility": "ADVISER_ONLY",
        "idCardSeries": "STM",
        "phone": "48943210675",
        "pesel": "33072308033",
        "city": "Wroclaw",
        "street": "Jaworowa",
        "houseNumber": "20A/77",
        "premisesNumber": "18",
        "postcode": "00-930",
        "state": "Krakow",
        "region": "Malopolskie",
        "gender": "male",
        "birthday": "2000-01-30",
        "driveLicenceDate": "2000-01-30",
        "invoiceCity": "Poznan",
        "invoiceEmail": "kljkasd@o2.pl",
        "invoiceStreet": "Topolowa",
        "invoiceHouseNumber": "30A/36",
        "invoicePremisesNumber": "37A",
        "invoicePostcode": "invoicePostcode",
        "invoiceNip": "2967751927",
        "invoiceName": "Faktura",
        "additionalPhone": "48475036329",
        "additionalEmail": "emilia05@sawicka.pl",
        "additionalCity": "Sieradz",
        "additionalStreet": "Orzeszkowej Elizy",
        "additionalHouseNumber": "89/11",
        "additionalPremisesNumber": "42/69",
        "additionalPostcode": "07-524",
        "officeCity": "Poznan",
        "officeStreet": "Cisowa",
        "officeHouseNumber": "32A",
        "officePremisesNumber": "11",
        "officePostcode": "26-536",
        "createdDate": "2020-09-25T00:00:00+02:00",
        "modifiedDate": "2020-09-25T00:00:00+02:00",
        "tags": [
          "VIP"
        ],
        "description": "My description",
        "linkedIn": "string",
        "facebook": "string",
        "extraFields": {
          "property1": "string",
          "property2": "string"
        },
        "extraAgreements": {
          "property1": true,
          "property2": true
        },
        "country": "Polska",
        "invoiceCountry": "Polska",
        "additionalCountry": "Polska",
        "officeCountry": "Polska",
        "name": "string",
        "nip": "string",
        "contactPerson": "string",
        "startDate": "2019-08-24",
        "pkd": "string",
        "pkdSecondary": "string",
        "regon": "string",
        "krs": "string"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of companies Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links PaginationLinks false none none
»» self string false none none
»» first string false none none
»» prev string false none none
»» next string false none none
»» last string false none none
» meta Meta false none none
»» totalItems integer false none none
»» itemsPerPage integer false none none
»» currentPage integer false none none
» data [Company] true none none
»» id string false none none
»» type string false none none
»» attributes any false none none

allOf

Name Type Required Restrictions Description
»»» anonymous any false none none

allOf

Name Type Required Restrictions Description
»»»» anonymous BaseCustomer false none none
»»»»» _id integer false read-only none
»»»»» firstname string false none none
»»»»» lastname string false none none
»»»»» parentUserId integer false none none
»»»»» path string false read-only none
»»»»» email string(email) false none none
»»»»» originsStatus string false none none
»»»»» personalDataProcessingAgreement boolean false none none
»»»»» commercialContentAgreement boolean false none none
»»»»» marketingContentAgreement boolean false none none
»»»»» mailSmsMessagesAgreement boolean false none none
»»»»» personalDataProcessingAgreementModified string(date-time) false read-only none
»»»»» commercialContentAgreementModified string(date-time) false read-only none
»»»»» marketingContentAgreementModified string(date-time) false read-only none
»»»»» mailSmsMessagesAgreementModified string(date-time) false read-only none
»»»»» visibility string false none none
»»»»» idCardSeries string false none none
»»»»» phone string false none none
»»»»» pesel string false none none
»»»»» city string false none none
»»»»» street string false none none
»»»»» houseNumber string false none none
»»»»» premisesNumber string false none none
»»»»» postcode string false none none
»»»»» state string false none none
»»»»» region string false none none
»»»»» gender string false none none
»»»»» birthday string(date) false none none
»»»»» driveLicenceDate string(date) false none none
»»»»» invoiceCity string false none none
»»»»» invoiceEmail string(email) false none none
»»»»» invoiceStreet string false none none
»»»»» invoiceHouseNumber string false none none
»»»»» invoicePremisesNumber string false none none
»»»»» invoicePostcode string false none none
»»»»» invoiceNip string false none none
»»»»» invoiceName string false none none
»»»»» additionalPhone string false none none
»»»»» additionalEmail string(email) false none none
»»»»» additionalCity string false none none
»»»»» additionalStreet string false none none
»»»»» additionalHouseNumber string false none none
»»»»» additionalPremisesNumber string false none none
»»»»» additionalPostcode string false none none
»»»»» officeCity string false none none
»»»»» officeStreet string false none none
»»»»» officeHouseNumber string false none none
»»»»» officePremisesNumber string false none none
»»»»» officePostcode string false none none
»»»»» createdDate string(date-time) false read-only none
»»»»» modifiedDate string(date-time) false read-only none
»»»»» tags [string] false none none
»»»»» description string false none none
»»»»» linkedIn string false none none
»»»»» facebook string false none none
»»»»» extraFields object false none User defined fields
»»»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»»»» extraAgreements object false none User defined agreements
»»»»»» additionalProperties boolean false none none

and

Name Type Required Restrictions Description
»»»» anonymous object false none none
»»»»» country string false none none
»»»»» invoiceCountry string false none none
»»»»» additionalCountry string false none none
»»»»» officeCountry string false none none

and

Name Type Required Restrictions Description
»»» anonymous object false none none
»»»» name string false none none
»»»» nip string¦null false none none
»»»» contactPerson string¦null false none none
»»»» startDate string(date)¦null false none none
»»»» pkd string¦null false none none
»»»» pkdSecondary string¦null false none none
»»»» regon string¦null false none none
»»»» krs string¦null false none none

Enumerated Values

Property Value
gender male
gender female

post_companies

Code samples

# You can also use wget
curl -X POST https://app.bergsystem.pl/api/companies \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

POST https://app.bergsystem.pl/api/companies HTTP/1.1
Host: app.bergsystem.pl
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
X-Tenant: string

const inputBody = '{
  "data": {
    "attributes": {
      "id": "/api/companies/15",
      "type": "Company",
      "attributes": {
        "firstname": "James",
        "lastname": "Smith",
        "parentUserId": 1,
        "email": "kljkasd@o2.pl",
        "originsStatus": "1",
        "personalDataProcessingAgreement": true,
        "commercialContentAgreement": true,
        "marketingContentAgreement": false,
        "mailSmsMessagesAgreement": true,
        "visibility": "ADVISER_ONLY",
        "idCardSeries": "STM",
        "phone": "48943210675",
        "pesel": "33072308033",
        "city": "Wroclaw",
        "street": "Jaworowa",
        "houseNumber": "20A/77",
        "premisesNumber": "18",
        "postcode": "00-930",
        "state": "Krakow",
        "region": "Malopolskie",
        "gender": "male",
        "birthday": "2000-01-30",
        "driveLicenceDate": "2000-01-30",
        "invoiceCity": "Poznan",
        "invoiceEmail": "kljkasd@o2.pl",
        "invoiceStreet": "Topolowa",
        "invoiceHouseNumber": "30A/36",
        "invoicePremisesNumber": "37A",
        "invoicePostcode": "invoicePostcode",
        "invoiceNip": "2967751927",
        "invoiceName": "Faktura",
        "additionalPhone": "48475036329",
        "additionalEmail": "emilia05@sawicka.pl",
        "additionalCity": "Sieradz",
        "additionalStreet": "Orzeszkowej Elizy",
        "additionalHouseNumber": "89/11",
        "additionalPremisesNumber": "42/69",
        "additionalPostcode": "07-524",
        "officeCity": "Poznan",
        "officeStreet": "Cisowa",
        "officeHouseNumber": "32A",
        "officePremisesNumber": "11",
        "officePostcode": "26-536",
        "tags": [
          "VIP"
        ],
        "description": "My description",
        "linkedIn": "string",
        "facebook": "string",
        "extraFields": {
          "property1": "string",
          "property2": "string"
        },
        "extraAgreements": {
          "property1": true,
          "property2": true
        },
        "country": "Polska",
        "invoiceCountry": "Polska",
        "additionalCountry": "Polska",
        "officeCountry": "Polska",
        "name": "string",
        "nip": "string",
        "contactPerson": "string",
        "startDate": "2019-08-24",
        "pkd": "string",
        "pkdSecondary": "string",
        "regon": "string",
        "krs": "string"
      }
    }
  }
}';
const headers = {
  'Content-Type':'application/vnd.api+json',
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/companies',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/vnd.api+json',
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://app.bergsystem.pl/api/companies',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/vnd.api+json',
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://app.bergsystem.pl/api/companies', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/vnd.api+json',
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://app.bergsystem.pl/api/companies', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/companies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/vnd.api+json"},
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.bergsystem.pl/api/companies", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /companies

Body parameter

{
  "data": {
    "attributes": {
      "id": "/api/companies/15",
      "type": "Company",
      "attributes": {
        "firstname": "James",
        "lastname": "Smith",
        "parentUserId": 1,
        "email": "kljkasd@o2.pl",
        "originsStatus": "1",
        "personalDataProcessingAgreement": true,
        "commercialContentAgreement": true,
        "marketingContentAgreement": false,
        "mailSmsMessagesAgreement": true,
        "visibility": "ADVISER_ONLY",
        "idCardSeries": "STM",
        "phone": "48943210675",
        "pesel": "33072308033",
        "city": "Wroclaw",
        "street": "Jaworowa",
        "houseNumber": "20A/77",
        "premisesNumber": "18",
        "postcode": "00-930",
        "state": "Krakow",
        "region": "Malopolskie",
        "gender": "male",
        "birthday": "2000-01-30",
        "driveLicenceDate": "2000-01-30",
        "invoiceCity": "Poznan",
        "invoiceEmail": "kljkasd@o2.pl",
        "invoiceStreet": "Topolowa",
        "invoiceHouseNumber": "30A/36",
        "invoicePremisesNumber": "37A",
        "invoicePostcode": "invoicePostcode",
        "invoiceNip": "2967751927",
        "invoiceName": "Faktura",
        "additionalPhone": "48475036329",
        "additionalEmail": "emilia05@sawicka.pl",
        "additionalCity": "Sieradz",
        "additionalStreet": "Orzeszkowej Elizy",
        "additionalHouseNumber": "89/11",
        "additionalPremisesNumber": "42/69",
        "additionalPostcode": "07-524",
        "officeCity": "Poznan",
        "officeStreet": "Cisowa",
        "officeHouseNumber": "32A",
        "officePremisesNumber": "11",
        "officePostcode": "26-536",
        "tags": [
          "VIP"
        ],
        "description": "My description",
        "linkedIn": "string",
        "facebook": "string",
        "extraFields": {
          "property1": "string",
          "property2": "string"
        },
        "extraAgreements": {
          "property1": true,
          "property2": true
        },
        "country": "Polska",
        "invoiceCountry": "Polska",
        "additionalCountry": "Polska",
        "officeCountry": "Polska",
        "name": "string",
        "nip": "string",
        "contactPerson": "string",
        "startDate": "2019-08-24",
        "pkd": "string",
        "pkdSecondary": "string",
        "regon": "string",
        "krs": "string"
      }
    }
  }
}

An endpoint that allows to create company with the requested data payload.

Parameters

Name In Type Required Description
body body object true none
» data body object false none
»» attributes body Company false none
»»» id body string false none
»»» type body string false none
»»» attributes body any false none
»»»» anonymous body any false none
»»»»» anonymous body BaseCustomer false none
»»»»»» _id body integer false none
»»»»»» firstname body string false none
»»»»»» lastname body string false none
»»»»»» parentUserId body integer false none
»»»»»» path body string false none
»»»»»» email body string(email) false none
»»»»»» originsStatus body string false none
»»»»»» personalDataProcessingAgreement body boolean false none
»»»»»» commercialContentAgreement body boolean false none
»»»»»» marketingContentAgreement body boolean false none
»»»»»» mailSmsMessagesAgreement body boolean false none
»»»»»» personalDataProcessingAgreementModified body string(date-time) false none
»»»»»» commercialContentAgreementModified body string(date-time) false none
»»»»»» marketingContentAgreementModified body string(date-time) false none
»»»»»» mailSmsMessagesAgreementModified body string(date-time) false none
»»»»»» visibility body string false none
»»»»»» idCardSeries body string false none
»»»»»» phone body string false none
»»»»»» pesel body string false none
»»»»»» city body string false none
»»»»»» street body string false none
»»»»»» houseNumber body string false none
»»»»»» premisesNumber body string false none
»»»»»» postcode body string false none
»»»»»» state body string false none
»»»»»» region body string false none
»»»»»» gender body string false none
»»»»»» birthday body string(date) false none
»»»»»» driveLicenceDate body string(date) false none
»»»»»» invoiceCity body string false none
»»»»»» invoiceEmail body string(email) false none
»»»»»» invoiceStreet body string false none
»»»»»» invoiceHouseNumber body string false none
»»»»»» invoicePremisesNumber body string false none
»»»»»» invoicePostcode body string false none
»»»»»» invoiceNip body string false none
»»»»»» invoiceName body string false none
»»»»»» additionalPhone body string false none
»»»»»» additionalEmail body string(email) false none
»»»»»» additionalCity body string false none
»»»»»» additionalStreet body string false none
»»»»»» additionalHouseNumber body string false none
»»»»»» additionalPremisesNumber body string false none
»»»»»» additionalPostcode body string false none
»»»»»» officeCity body string false none
»»»»»» officeStreet body string false none
»»»»»» officeHouseNumber body string false none
»»»»»» officePremisesNumber body string false none
»»»»»» officePostcode body string false none
»»»»»» createdDate body string(date-time) false none
»»»»»» modifiedDate body string(date-time) false none
»»»»»» tags body [string] false none
»»»»»» description body string false none
»»»»»» linkedIn body string false none
»»»»»» facebook body string false none
»»»»»» extraFields body object false User defined fields
»»»»»»» additionalProperties body any false none
»»»»»»»» anonymous body string false none
»»»»»»»» anonymous body integer false none
»»»»»»»» anonymous body boolean false none
»»»»»» extraAgreements body object false User defined agreements
»»»»»»» additionalProperties body boolean false none
»»»»» anonymous body object false none
»»»»»» country body string false none
»»»»»» invoiceCountry body string false none
»»»»»» additionalCountry body string false none
»»»»»» officeCountry body string false none
»»»» anonymous body object false none
»»»»» name body string false none
»»»»» nip body string¦null false none
»»»»» contactPerson body string¦null false none
»»»»» startDate body string(date)¦null false none
»»»»» pkd body string¦null false none
»»»»» pkdSecondary body string¦null false none
»»»»» regon body string¦null false none
»»»»» krs body string¦null false none
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Enumerated Values

Parameter Value
»»»»»» gender male
»»»»»» gender female

Example responses

201 Response

{
  "data": {
    "id": "/api/companies/15",
    "type": "Company",
    "attributes": {
      "_id": 12333,
      "firstname": "James",
      "lastname": "Smith",
      "parentUserId": 1,
      "path": "/1/2",
      "email": "kljkasd@o2.pl",
      "originsStatus": "1",
      "personalDataProcessingAgreement": true,
      "commercialContentAgreement": true,
      "marketingContentAgreement": false,
      "mailSmsMessagesAgreement": true,
      "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
      "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
      "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
      "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
      "visibility": "ADVISER_ONLY",
      "idCardSeries": "STM",
      "phone": "48943210675",
      "pesel": "33072308033",
      "city": "Wroclaw",
      "street": "Jaworowa",
      "houseNumber": "20A/77",
      "premisesNumber": "18",
      "postcode": "00-930",
      "state": "Krakow",
      "region": "Malopolskie",
      "gender": "male",
      "birthday": "2000-01-30",
      "driveLicenceDate": "2000-01-30",
      "invoiceCity": "Poznan",
      "invoiceEmail": "kljkasd@o2.pl",
      "invoiceStreet": "Topolowa",
      "invoiceHouseNumber": "30A/36",
      "invoicePremisesNumber": "37A",
      "invoicePostcode": "invoicePostcode",
      "invoiceNip": "2967751927",
      "invoiceName": "Faktura",
      "additionalPhone": "48475036329",
      "additionalEmail": "emilia05@sawicka.pl",
      "additionalCity": "Sieradz",
      "additionalStreet": "Orzeszkowej Elizy",
      "additionalHouseNumber": "89/11",
      "additionalPremisesNumber": "42/69",
      "additionalPostcode": "07-524",
      "officeCity": "Poznan",
      "officeStreet": "Cisowa",
      "officeHouseNumber": "32A",
      "officePremisesNumber": "11",
      "officePostcode": "26-536",
      "createdDate": "2020-09-25T00:00:00+02:00",
      "modifiedDate": "2020-09-25T00:00:00+02:00",
      "tags": [
        "VIP"
      ],
      "description": "My description",
      "linkedIn": "string",
      "facebook": "string",
      "extraFields": {
        "property1": "string",
        "property2": "string"
      },
      "extraAgreements": {
        "property1": true,
        "property2": true
      },
      "country": "Polska",
      "invoiceCountry": "Polska",
      "additionalCountry": "Polska",
      "officeCountry": "Polska",
      "name": "string",
      "nip": "string",
      "contactPerson": "string",
      "startDate": "2019-08-24",
      "pkd": "string",
      "pkdSecondary": "string",
      "regon": "string",
      "krs": "string"
    }
  }
}

Responses

Status Meaning Description Schema
201 Created Company data Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error
404 Not Found Resource not found. Error

Response Schema

Status Code 201

Name Type Required Restrictions Description
» data Company false none none
»» id string false none none
»» type string false none none
»» attributes any false none none

allOf

Name Type Required Restrictions Description
»»» anonymous any false none none

allOf

Name Type Required Restrictions Description
»»»» anonymous BaseCustomer false none none
»»»»» _id integer false read-only none
»»»»» firstname string false none none
»»»»» lastname string false none none
»»»»» parentUserId integer false none none
»»»»» path string false read-only none
»»»»» email string(email) false none none
»»»»» originsStatus string false none none
»»»»» personalDataProcessingAgreement boolean false none none
»»»»» commercialContentAgreement boolean false none none
»»»»» marketingContentAgreement boolean false none none
»»»»» mailSmsMessagesAgreement boolean false none none
»»»»» personalDataProcessingAgreementModified string(date-time) false read-only none
»»»»» commercialContentAgreementModified string(date-time) false read-only none
»»»»» marketingContentAgreementModified string(date-time) false read-only none
»»»»» mailSmsMessagesAgreementModified string(date-time) false read-only none
»»»»» visibility string false none none
»»»»» idCardSeries string false none none
»»»»» phone string false none none
»»»»» pesel string false none none
»»»»» city string false none none
»»»»» street string false none none
»»»»» houseNumber string false none none
»»»»» premisesNumber string false none none
»»»»» postcode string false none none
»»»»» state string false none none
»»»»» region string false none none
»»»»» gender string false none none
»»»»» birthday string(date) false none none
»»»»» driveLicenceDate string(date) false none none
»»»»» invoiceCity string false none none
»»»»» invoiceEmail string(email) false none none
»»»»» invoiceStreet string false none none
»»»»» invoiceHouseNumber string false none none
»»»»» invoicePremisesNumber string false none none
»»»»» invoicePostcode string false none none
»»»»» invoiceNip string false none none
»»»»» invoiceName string false none none
»»»»» additionalPhone string false none none
»»»»» additionalEmail string(email) false none none
»»»»» additionalCity string false none none
»»»»» additionalStreet string false none none
»»»»» additionalHouseNumber string false none none
»»»»» additionalPremisesNumber string false none none
»»»»» additionalPostcode string false none none
»»»»» officeCity string false none none
»»»»» officeStreet string false none none
»»»»» officeHouseNumber string false none none
»»»»» officePremisesNumber string false none none
»»»»» officePostcode string false none none
»»»»» createdDate string(date-time) false read-only none
»»»»» modifiedDate string(date-time) false read-only none
»»»»» tags [string] false none none
»»»»» description string false none none
»»»»» linkedIn string false none none
»»»»» facebook string false none none
»»»»» extraFields object false none User defined fields
»»»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»»»» extraAgreements object false none User defined agreements
»»»»»» additionalProperties boolean false none none

and

Name Type Required Restrictions Description
»»»» anonymous object false none none
»»»»» country string false none none
»»»»» invoiceCountry string false none none
»»»»» additionalCountry string false none none
»»»»» officeCountry string false none none

and

Name Type Required Restrictions Description
»»» anonymous object false none none
»»»» name string false none none
»»»» nip string¦null false none none
»»»» contactPerson string¦null false none none
»»»» startDate string(date)¦null false none none
»»»» pkd string¦null false none none
»»»» pkdSecondary string¦null false none none
»»»» regon string¦null false none none
»»»» krs string¦null false none none

Enumerated Values

Property Value
gender male
gender female

get_companies_{id}

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/companies/{id} \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/companies/{id} HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/companies/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/companies/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/companies/{id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/companies/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/companies/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/companies/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /companies/{id}

An endpoint that allows to get company data by its identifier.

Parameters

Name In Type Required Description
id path integer true Company identifier
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Example responses

200 Response

{
  "data": {
    "id": "/api/companies/15",
    "type": "Company",
    "attributes": {
      "_id": 12333,
      "firstname": "James",
      "lastname": "Smith",
      "parentUserId": 1,
      "path": "/1/2",
      "email": "kljkasd@o2.pl",
      "originsStatus": "1",
      "personalDataProcessingAgreement": true,
      "commercialContentAgreement": true,
      "marketingContentAgreement": false,
      "mailSmsMessagesAgreement": true,
      "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
      "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
      "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
      "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
      "visibility": "ADVISER_ONLY",
      "idCardSeries": "STM",
      "phone": "48943210675",
      "pesel": "33072308033",
      "city": "Wroclaw",
      "street": "Jaworowa",
      "houseNumber": "20A/77",
      "premisesNumber": "18",
      "postcode": "00-930",
      "state": "Krakow",
      "region": "Malopolskie",
      "gender": "male",
      "birthday": "2000-01-30",
      "driveLicenceDate": "2000-01-30",
      "invoiceCity": "Poznan",
      "invoiceEmail": "kljkasd@o2.pl",
      "invoiceStreet": "Topolowa",
      "invoiceHouseNumber": "30A/36",
      "invoicePremisesNumber": "37A",
      "invoicePostcode": "invoicePostcode",
      "invoiceNip": "2967751927",
      "invoiceName": "Faktura",
      "additionalPhone": "48475036329",
      "additionalEmail": "emilia05@sawicka.pl",
      "additionalCity": "Sieradz",
      "additionalStreet": "Orzeszkowej Elizy",
      "additionalHouseNumber": "89/11",
      "additionalPremisesNumber": "42/69",
      "additionalPostcode": "07-524",
      "officeCity": "Poznan",
      "officeStreet": "Cisowa",
      "officeHouseNumber": "32A",
      "officePremisesNumber": "11",
      "officePostcode": "26-536",
      "createdDate": "2020-09-25T00:00:00+02:00",
      "modifiedDate": "2020-09-25T00:00:00+02:00",
      "tags": [
        "VIP"
      ],
      "description": "My description",
      "linkedIn": "string",
      "facebook": "string",
      "extraFields": {
        "property1": "string",
        "property2": "string"
      },
      "extraAgreements": {
        "property1": true,
        "property2": true
      },
      "country": "Polska",
      "invoiceCountry": "Polska",
      "additionalCountry": "Polska",
      "officeCountry": "Polska",
      "name": "string",
      "nip": "string",
      "contactPerson": "string",
      "startDate": "2019-08-24",
      "pkd": "string",
      "pkdSecondary": "string",
      "regon": "string",
      "krs": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Company data Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» data Company false none none
»» id string false none none
»» type string false none none
»» attributes any false none none

allOf

Name Type Required Restrictions Description
»»» anonymous any false none none

allOf

Name Type Required Restrictions Description
»»»» anonymous BaseCustomer false none none
»»»»» _id integer false read-only none
»»»»» firstname string false none none
»»»»» lastname string false none none
»»»»» parentUserId integer false none none
»»»»» path string false read-only none
»»»»» email string(email) false none none
»»»»» originsStatus string false none none
»»»»» personalDataProcessingAgreement boolean false none none
»»»»» commercialContentAgreement boolean false none none
»»»»» marketingContentAgreement boolean false none none
»»»»» mailSmsMessagesAgreement boolean false none none
»»»»» personalDataProcessingAgreementModified string(date-time) false read-only none
»»»»» commercialContentAgreementModified string(date-time) false read-only none
»»»»» marketingContentAgreementModified string(date-time) false read-only none
»»»»» mailSmsMessagesAgreementModified string(date-time) false read-only none
»»»»» visibility string false none none
»»»»» idCardSeries string false none none
»»»»» phone string false none none
»»»»» pesel string false none none
»»»»» city string false none none
»»»»» street string false none none
»»»»» houseNumber string false none none
»»»»» premisesNumber string false none none
»»»»» postcode string false none none
»»»»» state string false none none
»»»»» region string false none none
»»»»» gender string false none none
»»»»» birthday string(date) false none none
»»»»» driveLicenceDate string(date) false none none
»»»»» invoiceCity string false none none
»»»»» invoiceEmail string(email) false none none
»»»»» invoiceStreet string false none none
»»»»» invoiceHouseNumber string false none none
»»»»» invoicePremisesNumber string false none none
»»»»» invoicePostcode string false none none
»»»»» invoiceNip string false none none
»»»»» invoiceName string false none none
»»»»» additionalPhone string false none none
»»»»» additionalEmail string(email) false none none
»»»»» additionalCity string false none none
»»»»» additionalStreet string false none none
»»»»» additionalHouseNumber string false none none
»»»»» additionalPremisesNumber string false none none
»»»»» additionalPostcode string false none none
»»»»» officeCity string false none none
»»»»» officeStreet string false none none
»»»»» officeHouseNumber string false none none
»»»»» officePremisesNumber string false none none
»»»»» officePostcode string false none none
»»»»» createdDate string(date-time) false read-only none
»»»»» modifiedDate string(date-time) false read-only none
»»»»» tags [string] false none none
»»»»» description string false none none
»»»»» linkedIn string false none none
»»»»» facebook string false none none
»»»»» extraFields object false none User defined fields
»»»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»»»» extraAgreements object false none User defined agreements
»»»»»» additionalProperties boolean false none none

and

Name Type Required Restrictions Description
»»»» anonymous object false none none
»»»»» country string false none none
»»»»» invoiceCountry string false none none
»»»»» additionalCountry string false none none
»»»»» officeCountry string false none none

and

Name Type Required Restrictions Description
»»» anonymous object false none none
»»»» name string false none none
»»»» nip string¦null false none none
»»»» contactPerson string¦null false none none
»»»» startDate string(date)¦null false none none
»»»» pkd string¦null false none none
»»»» pkdSecondary string¦null false none none
»»»» regon string¦null false none none
»»»» krs string¦null false none none

Enumerated Values

Property Value
gender male
gender female

Sales opportunities

get_sales_opportunities

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/sales_opportunities \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/sales_opportunities HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/sales_opportunities',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/sales_opportunities',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/sales_opportunities', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/sales_opportunities', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/sales_opportunities");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/sales_opportunities", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /sales_opportunities

An endpoint that allows to get collection of sales opportunities data.

Parameters

Name In Type Required Description
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.
page%5Bpage%5D query integer(int32) false Page number.

Example responses

200 Response

{
  "links": {
    "self": "/customers?page%5Bpage%5D=2",
    "first": "/customers?page%5Bpage%5D=1",
    "prev": "/customers?page%5Bpage%5D=1",
    "next": "/customers?page%5Bpage%5D=3",
    "last": "/customers?page%5Bpage%5D=3"
  },
  "meta": {
    "totalItems": 4,
    "itemsPerPage": 4,
    "currentPage": 1
  },
  "data": [
    {
      "id": "/api/sales_opportunities/136",
      "type": "SalesOpportunity",
      "attributes": {
        "_id": 1243,
        "customerId": 166,
        "companyId": 32,
        "employeeId": 1,
        "additionalEmployees": [
          {
            "employeeId": 10,
            "commission": 50
          }
        ],
        "title": "Title",
        "sellingProcessId": 1,
        "sellingProcessStepId": 11,
        "expectedSigningDate": "2013-07-09",
        "contractStateId": 1,
        "contractStatusId": 11,
        "abcCategory": 11,
        "description": "Description",
        "city": "Warszawa",
        "street": "Wolna",
        "houseNumber": 23,
        "flatNumber": "4A",
        "postCode": "00-509",
        "isLead": true,
        "extraFields": {
          "property1": "string",
          "property2": "string"
        },
        "items": [
          {
            "item_key": {
              "property1": "string",
              "property2": "string"
            }
          }
        ],
        "createdDate": "2013-07-09T14:09:49+02:00",
        "originSystem": "CC",
        "externalId": "EXT1",
        "startDateOfProtection": "2013-07-09"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of sales opportunities Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links PaginationLinks false none none
»» self string false none none
»» first string false none none
»» prev string false none none
»» next string false none none
»» last string false none none
» meta Meta false none none
»» totalItems integer false none none
»» itemsPerPage integer false none none
»» currentPage integer false none none
» data [SalesOpportunityData] true none none
»» id string false none none
»» type string false none none
»» attributes SalesOpportunity false none none
»»» _id integer false read-only none
»»» customerId integer false none none
»»» companyId integer false none none
»»» employeeId integer true none none
»»» additionalEmployees [object] false none Additional employees with commission percent
»»»» employeeId integer false none none
»»»» commission integer false none none
»»» title string true none none
»»» sellingProcessId integer true none none
»»» sellingProcessStepId integer true none none
»»» expectedSigningDate string(date)¦null false none none
»»» contractStateId integer false none none
»»» contractStatusId integer¦null false none none
»»» abcCategory integer false none none
»»» description string¦null false none none
»»» city string¦null false none none
»»» street string¦null false none none
»»» houseNumber string¦null false none none
»»» flatNumber string¦null false none none
»»» postCode string¦null false none none
»»» isLead boolean false none none
»»» extraFields object false none User defined fields
»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»» items [object] false none List of items
»»»» item_key object false none none
»»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»» createdDate string(date-time) false read-only none
»»» originSystem string¦null false none none
»»» externalId string¦null false none none
»»» startDateOfProtection string(date-time) false none none

post_sales_opportunities

Code samples

# You can also use wget
curl -X POST https://app.bergsystem.pl/api/sales_opportunities \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

POST https://app.bergsystem.pl/api/sales_opportunities HTTP/1.1
Host: app.bergsystem.pl
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
X-Tenant: string

const inputBody = '{
  "data": {
    "attributes": {
      "customerId": 166,
      "companyId": 32,
      "employeeId": 1,
      "additionalEmployees": [
        {
          "employeeId": 10,
          "commission": 50
        }
      ],
      "title": "Title",
      "sellingProcessId": 1,
      "sellingProcessStepId": 11,
      "expectedSigningDate": "2013-07-09",
      "contractStateId": 1,
      "contractStatusId": 11,
      "abcCategory": 11,
      "description": "Description",
      "city": "Warszawa",
      "street": "Wolna",
      "houseNumber": 23,
      "flatNumber": "4A",
      "postCode": "00-509",
      "isLead": true,
      "extraFields": {
        "property1": "string",
        "property2": "string"
      },
      "items": [
        {
          "item_key": {
            "property1": "string",
            "property2": "string"
          }
        }
      ],
      "originSystem": "CC",
      "externalId": "EXT1",
      "startDateOfProtection": "2013-07-09"
    }
  }
}';
const headers = {
  'Content-Type':'application/vnd.api+json',
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/sales_opportunities',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/vnd.api+json',
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://app.bergsystem.pl/api/sales_opportunities',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/vnd.api+json',
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://app.bergsystem.pl/api/sales_opportunities', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/vnd.api+json',
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://app.bergsystem.pl/api/sales_opportunities', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/sales_opportunities");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/vnd.api+json"},
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.bergsystem.pl/api/sales_opportunities", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /sales_opportunities

Body parameter

{
  "data": {
    "attributes": {
      "customerId": 166,
      "companyId": 32,
      "employeeId": 1,
      "additionalEmployees": [
        {
          "employeeId": 10,
          "commission": 50
        }
      ],
      "title": "Title",
      "sellingProcessId": 1,
      "sellingProcessStepId": 11,
      "expectedSigningDate": "2013-07-09",
      "contractStateId": 1,
      "contractStatusId": 11,
      "abcCategory": 11,
      "description": "Description",
      "city": "Warszawa",
      "street": "Wolna",
      "houseNumber": 23,
      "flatNumber": "4A",
      "postCode": "00-509",
      "isLead": true,
      "extraFields": {
        "property1": "string",
        "property2": "string"
      },
      "items": [
        {
          "item_key": {
            "property1": "string",
            "property2": "string"
          }
        }
      ],
      "originSystem": "CC",
      "externalId": "EXT1",
      "startDateOfProtection": "2013-07-09"
    }
  }
}

An endpoint that allows to create sales opportunity with the requested data payload.

Parameters

Name In Type Required Description
body body object true none
» data body object false none
»» attributes body SalesOpportunity false none
»»» _id body integer false none
»»» customerId body integer false none
»»» companyId body integer false none
»»» employeeId body integer true none
»»» additionalEmployees body [object] false Additional employees with commission percent
»»»» employeeId body integer false none
»»»» commission body integer false none
»»» title body string true none
»»» sellingProcessId body integer true none
»»» sellingProcessStepId body integer true none
»»» expectedSigningDate body string(date)¦null false none
»»» contractStateId body integer false none
»»» contractStatusId body integer¦null false none
»»» abcCategory body integer false none
»»» description body string¦null false none
»»» city body string¦null false none
»»» street body string¦null false none
»»» houseNumber body string¦null false none
»»» flatNumber body string¦null false none
»»» postCode body string¦null false none
»»» isLead body boolean false none
»»» extraFields body object false User defined fields
»»»» additionalProperties body any false none
»»»»» anonymous body string false none
»»»»» anonymous body integer false none
»»»»» anonymous body boolean false none
»»» items body [object] false List of items
»»»» item_key body object false none
»»»»» additionalProperties body any false none
»»»»»» anonymous body string false none
»»»»»» anonymous body integer false none
»»»»»» anonymous body boolean false none
»»» createdDate body string(date-time) false none
»»» originSystem body string¦null false none
»»» externalId body string¦null false none
»»» startDateOfProtection body string(date-time) false none
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.
page%5Bpage%5D query integer(int32) false Page number.

Example responses

201 Response

{
  "data": {
    "id": "/api/sales_opportunities/136",
    "type": "SalesOpportunity",
    "attributes": {
      "_id": 1243,
      "customerId": 166,
      "companyId": 32,
      "employeeId": 1,
      "additionalEmployees": [
        {
          "employeeId": 10,
          "commission": 50
        }
      ],
      "title": "Title",
      "sellingProcessId": 1,
      "sellingProcessStepId": 11,
      "expectedSigningDate": "2013-07-09",
      "contractStateId": 1,
      "contractStatusId": 11,
      "abcCategory": 11,
      "description": "Description",
      "city": "Warszawa",
      "street": "Wolna",
      "houseNumber": 23,
      "flatNumber": "4A",
      "postCode": "00-509",
      "isLead": true,
      "extraFields": {
        "property1": "string",
        "property2": "string"
      },
      "items": [
        {
          "item_key": {
            "property1": "string",
            "property2": "string"
          }
        }
      ],
      "createdDate": "2013-07-09T14:09:49+02:00",
      "originSystem": "CC",
      "externalId": "EXT1",
      "startDateOfProtection": "2013-07-09"
    }
  }
}

Responses

Status Meaning Description Schema
201 Created Sales opportunity data. Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error
404 Not Found Resource not found. Error

Response Schema

Status Code 201

Name Type Required Restrictions Description
» data SalesOpportunityData false none none
»» id string false none none
»» type string false none none
»» attributes SalesOpportunity false none none
»»» _id integer false read-only none
»»» customerId integer false none none
»»» companyId integer false none none
»»» employeeId integer true none none
»»» additionalEmployees [object] false none Additional employees with commission percent
»»»» employeeId integer false none none
»»»» commission integer false none none
»»» title string true none none
»»» sellingProcessId integer true none none
»»» sellingProcessStepId integer true none none
»»» expectedSigningDate string(date)¦null false none none
»»» contractStateId integer false none none
»»» contractStatusId integer¦null false none none
»»» abcCategory integer false none none
»»» description string¦null false none none
»»» city string¦null false none none
»»» street string¦null false none none
»»» houseNumber string¦null false none none
»»» flatNumber string¦null false none none
»»» postCode string¦null false none none
»»» isLead boolean false none none
»»» extraFields object false none User defined fields
»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»» items [object] false none List of items
»»»» item_key object false none none
»»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»» createdDate string(date-time) false read-only none
»»» originSystem string¦null false none none
»»» externalId string¦null false none none
»»» startDateOfProtection string(date-time) false none none

get_sales_opportunities_{id}

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/sales_opportunities/{id} \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/sales_opportunities/{id} HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/sales_opportunities/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/sales_opportunities/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/sales_opportunities/{id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/sales_opportunities/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/sales_opportunities/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/sales_opportunities/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /sales_opportunities/{id}

An endpoint that allows to get sales opportunity data by its identifier.

Parameters

Name In Type Required Description
id path integer true Sale opportunity identifier
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Example responses

200 Response

{
  "data": {
    "id": "/api/sales_opportunities/136",
    "type": "SalesOpportunity",
    "attributes": {
      "_id": 1243,
      "customerId": 166,
      "companyId": 32,
      "employeeId": 1,
      "additionalEmployees": [
        {
          "employeeId": 10,
          "commission": 50
        }
      ],
      "title": "Title",
      "sellingProcessId": 1,
      "sellingProcessStepId": 11,
      "expectedSigningDate": "2013-07-09",
      "contractStateId": 1,
      "contractStatusId": 11,
      "abcCategory": 11,
      "description": "Description",
      "city": "Warszawa",
      "street": "Wolna",
      "houseNumber": 23,
      "flatNumber": "4A",
      "postCode": "00-509",
      "isLead": true,
      "extraFields": {
        "property1": "string",
        "property2": "string"
      },
      "items": [
        {
          "item_key": {
            "property1": "string",
            "property2": "string"
          }
        }
      ],
      "createdDate": "2013-07-09T14:09:49+02:00",
      "originSystem": "CC",
      "externalId": "EXT1",
      "startDateOfProtection": "2013-07-09"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Sales opportunity data. Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» data SalesOpportunityData false none none
»» id string false none none
»» type string false none none
»» attributes SalesOpportunity false none none
»»» _id integer false read-only none
»»» customerId integer false none none
»»» companyId integer false none none
»»» employeeId integer true none none
»»» additionalEmployees [object] false none Additional employees with commission percent
»»»» employeeId integer false none none
»»»» commission integer false none none
»»» title string true none none
»»» sellingProcessId integer true none none
»»» sellingProcessStepId integer true none none
»»» expectedSigningDate string(date)¦null false none none
»»» contractStateId integer false none none
»»» contractStatusId integer¦null false none none
»»» abcCategory integer false none none
»»» description string¦null false none none
»»» city string¦null false none none
»»» street string¦null false none none
»»» houseNumber string¦null false none none
»»» flatNumber string¦null false none none
»»» postCode string¦null false none none
»»» isLead boolean false none none
»»» extraFields object false none User defined fields
»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»» items [object] false none List of items
»»»» item_key object false none none
»»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»» createdDate string(date-time) false read-only none
»»» originSystem string¦null false none none
»»» externalId string¦null false none none
»»» startDateOfProtection string(date-time) false none none

Selling Processes

get_selling_processes

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/selling_processes \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/selling_processes HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/selling_processes',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/selling_processes',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/selling_processes', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/selling_processes', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/selling_processes");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/selling_processes", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /selling_processes

An endpoint that allows to get collection of selling processes data.

Parameters

Name In Type Required Description
page%5Bpage%5D query integer(int32) false Page number.
sort query string false Sort data by field. Default sorting order is ascending. To reverse it use "-" before field name.
filter%5Bid%5D query integer false Filter by selling process id.
filter%5Bname%5D query string false Filter by selling process name.
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Detailed descriptions

sort: Sort data by field. Default sorting order is ascending. To reverse it use "-" before field name. Supported sorting fields: * id * name

filter%5Bid%5D: Filter by selling process id.

filter%5Bname%5D: Filter by selling process name.

Example responses

200 Response

{
  "links": {
    "self": "/customers?page%5Bpage%5D=2",
    "first": "/customers?page%5Bpage%5D=1",
    "prev": "/customers?page%5Bpage%5D=1",
    "next": "/customers?page%5Bpage%5D=3",
    "last": "/customers?page%5Bpage%5D=3"
  },
  "meta": {
    "totalItems": 4,
    "itemsPerPage": 4,
    "currentPage": 1
  },
  "data": [
    {
      "id": "/api/selling_processes/1",
      "type": "SellingProcess",
      "attributes": {
        "_id": 1243,
        "name": "Proces sprzedaży"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of selling processes. Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links PaginationLinks false none none
»» self string false none none
»» first string false none none
»» prev string false none none
»» next string false none none
»» last string false none none
» meta Meta false none none
»» totalItems integer false none none
»» itemsPerPage integer false none none
»» currentPage integer false none none
» data [SellingProcessData] true none none
»» id string false none none
»» type string false none none
»» attributes SellingProcess false none none
»»» _id integer false read-only none
»»» name string false none none

get_selling_processes_{id}

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/selling_processes/{id} \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/selling_processes/{id} HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/selling_processes/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/selling_processes/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/selling_processes/{id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/selling_processes/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/selling_processes/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/selling_processes/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /selling_processes/{id}

An endpoint that allows to get selling process by its identifier.

Parameters

Name In Type Required Description
id path integer true Selling process identifier
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Example responses

200 Response

{
  "data": {
    "id": "/api/selling_processes/1",
    "type": "SellingProcess",
    "attributes": {
      "_id": 1243,
      "name": "Proces sprzedaży"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Selling process data. Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» data SellingProcessData false none none
»» id string false none none
»» type string false none none
»» attributes SellingProcess false none none
»»» _id integer false read-only none
»»» name string false none none

get_selling_processes_{id}_steps

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/selling_processes/{id}/steps \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/selling_processes/{id}/steps HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/selling_processes/{id}/steps',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/selling_processes/{id}/steps',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/selling_processes/{id}/steps', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/selling_processes/{id}/steps', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/selling_processes/{id}/steps");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/selling_processes/{id}/steps", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /selling_processes/{id}/steps

An endpoint that allows to get all steps for selling process identifier.

Parameters

Name In Type Required Description
page%5Bpage%5D query integer(int32) false Page number.
sort query string false Sort data by field. Default sorting order is ascending. To reverse it use "-" before field name.
filter%5Bid%5D query integer false Filter by selling process step id.
filter%5Bname%5D query string false Filter by selling process step name.
filter%5Borders%5D query integer false Filter by selling process step order.
filter%5Bcolor%5D query string false Filter by selling process step color.
id path integer true Selling process step identifier
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Detailed descriptions

sort: Sort data by field. Default sorting order is ascending. To reverse it use "-" before field name. Supported sorting fields: * id * name * orders * color

filter%5Bid%5D: Filter by selling process step id.

filter%5Bname%5D: Filter by selling process step name.

filter%5Borders%5D: Filter by selling process step order.

filter%5Bcolor%5D: Filter by selling process step color.

Example responses

200 Response

{
  "links": {
    "self": "/customers?page%5Bpage%5D=2",
    "first": "/customers?page%5Bpage%5D=1",
    "prev": "/customers?page%5Bpage%5D=1",
    "next": "/customers?page%5Bpage%5D=3",
    "last": "/customers?page%5Bpage%5D=3"
  },
  "meta": {
    "totalItems": 4,
    "itemsPerPage": 4,
    "currentPage": 1
  },
  "data": [
    {
      "id": "/api/selling_process_steps/11",
      "type": "SellingProcessStep",
      "attributes": {
        "_id": 1243,
        "name": "Lead",
        "orders": 1,
        "color": "#fa573c"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of steps of selling process. Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links PaginationLinks false none none
»» self string false none none
»» first string false none none
»» prev string false none none
»» next string false none none
»» last string false none none
» meta Meta false none none
»» totalItems integer false none none
»» itemsPerPage integer false none none
»» currentPage integer false none none
» data [SellingProcessStepData] true none none
»» id string false none none
»» type string false none none
»» attributes SellingProcessStep false none none
»»» _id integer false read-only none
»»» name string false none none
»»» orders integer false none none
»»» color string false none none

Sales

get_sales

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/sales \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/sales HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/sales',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/sales',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/sales', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/sales', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/sales");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/sales", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /sales

An endpoint that allows to get collection of sales data.

Parameters

Name In Type Required Description
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.
page%5Bpage%5D query integer(int32) false Page number.

Example responses

200 Response

{
  "links": {
    "self": "/customers?page%5Bpage%5D=2",
    "first": "/customers?page%5Bpage%5D=1",
    "prev": "/customers?page%5Bpage%5D=1",
    "next": "/customers?page%5Bpage%5D=3",
    "last": "/customers?page%5Bpage%5D=3"
  },
  "meta": {
    "totalItems": 4,
    "itemsPerPage": 4,
    "currentPage": 1
  },
  "data": [
    {
      "id": "/api/sales/1",
      "type": "Sales",
      "attributes": {
        "_id": 1243,
        "customerId": 166,
        "companyId": 32,
        "employeeId": 1,
        "additionalEmployees": [
          {
            "employeeId": 10,
            "commission": 50
          }
        ],
        "title": "Title",
        "sellingProcessId": 1,
        "sellingProcessStepId": 11,
        "expectedSigningDate": "2013-07-09",
        "contractStateId": 1,
        "contractStatusId": 1,
        "abcCategory": 11,
        "description": "Description",
        "city": "Warszawa",
        "street": "Wolna",
        "houseNumber": 23,
        "flatNumber": "4A",
        "postCode": "00-509",
        "extraFields": {
          "property1": "string",
          "property2": "string"
        },
        "createdDate": "2013-07-09T14:09:49+02:00",
        "originSystem": "CC",
        "externalId": "EXT1",
        "startDateOfProtection": "2013-07-09"
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of sales Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links PaginationLinks false none none
»» self string false none none
»» first string false none none
»» prev string false none none
»» next string false none none
»» last string false none none
» meta Meta false none none
»» totalItems integer false none none
»» itemsPerPage integer false none none
»» currentPage integer false none none
» data [SalesData] true none none
»» id string false none none
»» type string false none none
»» attributes Sales false none none
»»» _id integer false read-only none
»»» customerId integer¦null false none none
»»» companyId integer¦null false none none
»»» employeeId integer true none none
»»» additionalEmployees [object] false none Additional employees with commission percent
»»»» employeeId integer false none none
»»»» commission integer false none none
»»» title string true none none
»»» sellingProcessId integer¦null false none none
»»» sellingProcessStepId integer¦null false none none
»»» expectedSigningDate string(date)¦null false none none
»»» contractStateId integer false none none
»»» contractStatusId integer false none none
»»» abcCategory integer false none none
»»» description string¦null false none none
»»» city string¦null false none none
»»» street string¦null false none none
»»» houseNumber string¦null false none none
»»» flatNumber string¦null false none none
»»» postCode string¦null false none none
»»» extraFields object false none User defined fields
»»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»»» createdDate string(date-time) false read-only none
»»» originSystem string¦null false none none
»»» externalId string¦null false none none
»»» startDateOfProtection string(date-time) false none none

post_sales

Code samples

# You can also use wget
curl -X POST https://app.bergsystem.pl/api/sales \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Accept: application/json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

POST https://app.bergsystem.pl/api/sales HTTP/1.1
Host: app.bergsystem.pl
Content-Type: application/vnd.api+json
Accept: application/json
X-Tenant: string

const inputBody = '{
  "data": {
    "attributes": {
      "customerId": 166,
      "companyId": 32,
      "employeeId": 1,
      "additionalEmployees": [
        {
          "employeeId": 10,
          "commission": 50
        }
      ],
      "title": "Title",
      "sellingProcessId": 1,
      "sellingProcessStepId": 11,
      "expectedSigningDate": "2013-07-09",
      "contractStateId": 1,
      "contractStatusId": 1,
      "abcCategory": 11,
      "description": "Description",
      "city": "Warszawa",
      "street": "Wolna",
      "houseNumber": 23,
      "flatNumber": "4A",
      "postCode": "00-509",
      "extraFields": {
        "property1": "string",
        "property2": "string"
      },
      "originSystem": "CC",
      "externalId": "EXT1",
      "startDateOfProtection": "2013-07-09"
    }
  }
}';
const headers = {
  'Content-Type':'application/vnd.api+json',
  'Accept':'application/json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/sales',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/vnd.api+json',
  'Accept' => 'application/json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://app.bergsystem.pl/api/sales',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/vnd.api+json',
  'Accept': 'application/json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://app.bergsystem.pl/api/sales', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/vnd.api+json',
    'Accept' => 'application/json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://app.bergsystem.pl/api/sales', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/sales");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/vnd.api+json"},
        "Accept": []string{"application/json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://app.bergsystem.pl/api/sales", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /sales

Body parameter

{
  "data": {
    "attributes": {
      "customerId": 166,
      "companyId": 32,
      "employeeId": 1,
      "additionalEmployees": [
        {
          "employeeId": 10,
          "commission": 50
        }
      ],
      "title": "Title",
      "sellingProcessId": 1,
      "sellingProcessStepId": 11,
      "expectedSigningDate": "2013-07-09",
      "contractStateId": 1,
      "contractStatusId": 1,
      "abcCategory": 11,
      "description": "Description",
      "city": "Warszawa",
      "street": "Wolna",
      "houseNumber": 23,
      "flatNumber": "4A",
      "postCode": "00-509",
      "extraFields": {
        "property1": "string",
        "property2": "string"
      },
      "originSystem": "CC",
      "externalId": "EXT1",
      "startDateOfProtection": "2013-07-09"
    }
  }
}

An endpoint that allows to create sale with the requested data payload.

Parameters

Name In Type Required Description
body body object true none
» data body object false none
»» attributes body Sales false none
»»» _id body integer false none
»»» customerId body integer¦null false none
»»» companyId body integer¦null false none
»»» employeeId body integer true none
»»» additionalEmployees body [object] false Additional employees with commission percent
»»»» employeeId body integer false none
»»»» commission body integer false none
»»» title body string true none
»»» sellingProcessId body integer¦null false none
»»» sellingProcessStepId body integer¦null false none
»»» expectedSigningDate body string(date)¦null false none
»»» contractStateId body integer false none
»»» contractStatusId body integer false none
»»» abcCategory body integer false none
»»» description body string¦null false none
»»» city body string¦null false none
»»» street body string¦null false none
»»» houseNumber body string¦null false none
»»» flatNumber body string¦null false none
»»» postCode body string¦null false none
»»» extraFields body object false User defined fields
»»»» additionalProperties body any false none
»»»»» anonymous body string false none
»»»»» anonymous body integer false none
»»»»» anonymous body boolean false none
»»» createdDate body string(date-time) false none
»»» originSystem body string¦null false none
»»» externalId body string¦null false none
»»» startDateOfProtection body string(date-time) false none
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.
page%5Bpage%5D query integer(int32) false Page number.

Example responses

201 Response

{
  "data": {
    "_id": 1243,
    "customerId": 166,
    "companyId": 32,
    "employeeId": 1,
    "additionalEmployees": [
      {
        "employeeId": 10,
        "commission": 50
      }
    ],
    "title": "Title",
    "sellingProcessId": 1,
    "sellingProcessStepId": 11,
    "expectedSigningDate": "2013-07-09",
    "contractStateId": 1,
    "contractStatusId": 1,
    "abcCategory": 11,
    "description": "Description",
    "city": "Warszawa",
    "street": "Wolna",
    "houseNumber": 23,
    "flatNumber": "4A",
    "postCode": "00-509",
    "extraFields": {
      "property1": "string",
      "property2": "string"
    },
    "createdDate": "2013-07-09T14:09:49+02:00",
    "originSystem": "CC",
    "externalId": "EXT1",
    "startDateOfProtection": "2013-07-09"
  }
}

Responses

Status Meaning Description Schema
201 Created Sales data Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error
404 Not Found Resource not found. Error

Response Schema

Status Code 201

Name Type Required Restrictions Description
» data Sales false none none
»» _id integer false read-only none
»» customerId integer¦null false none none
»» companyId integer¦null false none none
»» employeeId integer true none none
»» additionalEmployees [object] false none Additional employees with commission percent
»»» employeeId integer false none none
»»» commission integer false none none
»» title string true none none
»» sellingProcessId integer¦null false none none
»» sellingProcessStepId integer¦null false none none
»» expectedSigningDate string(date)¦null false none none
»» contractStateId integer false none none
»» contractStatusId integer false none none
»» abcCategory integer false none none
»» description string¦null false none none
»» city string¦null false none none
»» street string¦null false none none
»» houseNumber string¦null false none none
»» flatNumber string¦null false none none
»» postCode string¦null false none none
»» extraFields object false none User defined fields
»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»» createdDate string(date-time) false read-only none
»» originSystem string¦null false none none
»» externalId string¦null false none none
»» startDateOfProtection string(date-time) false none none

get_sales_{id}

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/sales/{id} \
  -H 'Accept: application/json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/sales/{id} HTTP/1.1
Host: app.bergsystem.pl
Accept: application/json
X-Tenant: string


const headers = {
  'Accept':'application/json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/sales/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/sales/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/sales/{id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/sales/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/sales/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/sales/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /sales/{id}

An endpoint that allows to get sale data by its identifier.

Parameters

Name In Type Required Description
id path integer true Sale identifier
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Example responses

200 Response

{
  "data": {
    "_id": 1243,
    "customerId": 166,
    "companyId": 32,
    "employeeId": 1,
    "additionalEmployees": [
      {
        "employeeId": 10,
        "commission": 50
      }
    ],
    "title": "Title",
    "sellingProcessId": 1,
    "sellingProcessStepId": 11,
    "expectedSigningDate": "2013-07-09",
    "contractStateId": 1,
    "contractStatusId": 1,
    "abcCategory": 11,
    "description": "Description",
    "city": "Warszawa",
    "street": "Wolna",
    "houseNumber": 23,
    "flatNumber": "4A",
    "postCode": "00-509",
    "extraFields": {
      "property1": "string",
      "property2": "string"
    },
    "createdDate": "2013-07-09T14:09:49+02:00",
    "originSystem": "CC",
    "externalId": "EXT1",
    "startDateOfProtection": "2013-07-09"
  }
}

Responses

Status Meaning Description Schema
200 OK Sales data Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» data Sales false none none
»» _id integer false read-only none
»» customerId integer¦null false none none
»» companyId integer¦null false none none
»» employeeId integer true none none
»» additionalEmployees [object] false none Additional employees with commission percent
»»» employeeId integer false none none
»»» commission integer false none none
»» title string true none none
»» sellingProcessId integer¦null false none none
»» sellingProcessStepId integer¦null false none none
»» expectedSigningDate string(date)¦null false none none
»» contractStateId integer false none none
»» contractStatusId integer false none none
»» abcCategory integer false none none
»» description string¦null false none none
»» city string¦null false none none
»» street string¦null false none none
»» houseNumber string¦null false none none
»» flatNumber string¦null false none none
»» postCode string¦null false none none
»» extraFields object false none User defined fields
»»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
»» createdDate string(date-time) false read-only none
»» originSystem string¦null false none none
»» externalId string¦null false none none
»» startDateOfProtection string(date-time) false none none

Contract Extra Fields

get_contract_extra_fields

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/contract_extra_fields \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/contract_extra_fields HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json


const headers = {
  'Accept':'application/vnd.api+json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/contract_extra_fields',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/contract_extra_fields',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/contract_extra_fields', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/contract_extra_fields', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/contract_extra_fields");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/contract_extra_fields", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /contract_extra_fields

Example responses

200 Response

{
  "links": {
    "self": "/api/contract_extra_fields"
  },
  "meta": {
    "totalItems": 4
  },
  "data": [
    {
      "id": "/api/contract_extra_fields/1243",
      "type": "ContractExtraField",
      "attributes": {
        "_id": 1243,
        "label": "Product name",
        "key": "ProductName1"
      }
    }
  ]
}

An endpoint that allows to get collection of all active extra fields for sales and sales opportunities.

Responses

Status Meaning Description Schema
200 OK List of contract extra fields. Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links object false none none
»» self string false none none
» meta object false none none
»» totalItems integer false none none
» data [ContractExtraFieldData] true none none
»» id string false none none
»» type string false none none
»» attributes ExtraField false none none
»»» _id integer false read-only none
»»» label string false none none
»»» key string false none none

Settlements

get_settlement_package

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/settlement_package \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/settlement_package HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/settlement_package',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/settlement_package',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/settlement_package', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/settlement_package', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/settlement_package");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/settlement_package", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /settlement_package

Parameters

Name In Type Required Description
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.
settlementType query integer false Filter by settlementType type
title query string false Filter by title

Detailed descriptions

settlementType: Filter by settlementType type

title: Filter by title

Example responses

200 Response

{
  "links": {
    "self": "/customers?page%5Bpage%5D=2",
    "first": "/customers?page%5Bpage%5D=1",
    "prev": "/customers?page%5Bpage%5D=1",
    "next": "/customers?page%5Bpage%5D=3",
    "last": "/customers?page%5Bpage%5D=3"
  },
  "meta": {
    "totalItems": 4,
    "itemsPerPage": 4,
    "currentPage": 1
  },
  "data": [
    {
      "_id": 0,
      "created": "2019-08-24",
      "updated": "2019-08-24",
      "dateCreated": "2019-08-24",
      "dateSentAmount": "2019-08-24",
      "postingDate": "2019-08-24",
      "status": 0,
      "title": "string",
      "commentAcceptPackage": "string",
      "amount": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of settlements package Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links PaginationLinks false none none
»» self string false none none
»» first string false none none
»» prev string false none none
»» next string false none none
»» last string false none none
» meta Meta false none none
»» totalItems integer false none none
»» itemsPerPage integer false none none
»» currentPage integer false none none
» data [SettlementPackage] true none none
»» _id integer false none none
»» created string(date) false none none
»» updated string(date) false none none
»» dateCreated string(date)¦null false none none
»» dateSentAmount string(date)¦null false none none
»» postingDate string(date)¦null false none none
»» status integer false none none
»» title string false none none
»» commentAcceptPackage string false none none
»» amount integer false none none

get_settlement_package_{settlement_package_id}

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/settlement_package/{settlement_package_id} \
  -H 'Accept: application/json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/settlement_package/{settlement_package_id} HTTP/1.1
Host: app.bergsystem.pl
Accept: application/json
X-Tenant: string


const headers = {
  'Accept':'application/json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /settlement_package/{settlement_package_id}

Parameters

Name In Type Required Description
settlement_package_id path integer true settlement package id
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Example responses

200 Response

{
  "data": {
    "_id": 0,
    "created": "2019-08-24",
    "updated": "2019-08-24",
    "dateCreated": "2019-08-24",
    "dateSentAmount": "2019-08-24",
    "postingDate": "2019-08-24",
    "status": 0,
    "title": "string",
    "commentAcceptPackage": "string",
    "amount": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Settlement package data Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» data SettlementPackage false none none
»» _id integer false none none
»» created string(date) false none none
»» updated string(date) false none none
»» dateCreated string(date)¦null false none none
»» dateSentAmount string(date)¦null false none none
»» postingDate string(date)¦null false none none
»» status integer false none none
»» title string false none none
»» commentAcceptPackage string false none none
»» amount integer false none none

patch_settlement_package_{settlement_package_id}

Code samples

# You can also use wget
curl -X PATCH https://app.bergsystem.pl/api/settlement_package/{settlement_package_id} \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Accept: application/json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

PATCH https://app.bergsystem.pl/api/settlement_package/{settlement_package_id} HTTP/1.1
Host: app.bergsystem.pl
Content-Type: application/vnd.api+json
Accept: application/json
X-Tenant: string

const inputBody = '{
  "data": {
    "attributes": {
      "status": 1
    }
  }
}';
const headers = {
  'Content-Type':'application/vnd.api+json',
  'Accept':'application/json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/vnd.api+json',
  'Accept' => 'application/json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.patch 'https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/vnd.api+json',
  'Accept': 'application/json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/vnd.api+json',
    'Accept' => 'application/json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/vnd.api+json"},
        "Accept": []string{"application/json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.bergsystem.pl/api/settlement_package/{settlement_package_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /settlement_package/{settlement_package_id}

Body parameter

{
  "data": {
    "attributes": {
      "status": 1
    }
  }
}

Parameters

Name In Type Required Description
settlement_package_id path integer true settlement package id
body body object true none
» data body object false none
»» attributes body object false none
»»» status body integer false 0 - new
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Example responses

200 Response

{
  "data": {
    "_id": 0,
    "created": "2019-08-24",
    "updated": "2019-08-24",
    "dateCreated": "2019-08-24",
    "dateSentAmount": "2019-08-24",
    "postingDate": "2019-08-24",
    "status": 0,
    "title": "string",
    "commentAcceptPackage": "string",
    "amount": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Settlement package data Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» data SettlementPackage false none none
»» _id integer false none none
»» created string(date) false none none
»» updated string(date) false none none
»» dateCreated string(date)¦null false none none
»» dateSentAmount string(date)¦null false none none
»» postingDate string(date)¦null false none none
»» status integer false none none
»» title string false none none
»» commentAcceptPackage string false none none
»» amount integer false none none

get_settlement

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/settlement \
  -H 'Accept: application/vnd.api+json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/settlement HTTP/1.1
Host: app.bergsystem.pl
Accept: application/vnd.api+json
X-Tenant: string


const headers = {
  'Accept':'application/vnd.api+json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/settlement',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/vnd.api+json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/settlement',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/vnd.api+json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/settlement', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/vnd.api+json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/settlement', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/settlement");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/vnd.api+json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/settlement", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /settlement

Parameters

Name In Type Required Description
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.
package query integer false Filter by package id

Detailed descriptions

package: Filter by package id

Example responses

200 Response

{
  "links": {
    "self": "/customers?page%5Bpage%5D=2",
    "first": "/customers?page%5Bpage%5D=1",
    "prev": "/customers?page%5Bpage%5D=1",
    "next": "/customers?page%5Bpage%5D=3",
    "last": "/customers?page%5Bpage%5D=3"
  },
  "meta": {
    "totalItems": 4,
    "itemsPerPage": 4,
    "currentPage": 1
  },
  "data": [
    {
      "_id": 0,
      "created": "2019-08-24",
      "updated": "2019-08-24",
      "dateCreated": "2019-08-24",
      "dateSentAmount": "2019-08-24",
      "postingDate": "2019-08-24",
      "status": 0,
      "title": "string",
      "sendType": "string",
      "amount": 0,
      "contract": {
        "id": 0
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of settlements Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» links PaginationLinks false none none
»» self string false none none
»» first string false none none
»» prev string false none none
»» next string false none none
»» last string false none none
» meta Meta false none none
»» totalItems integer false none none
»» itemsPerPage integer false none none
»» currentPage integer false none none
» data [Settlement] true none none
»» _id integer false none none
»» created string(date) false none none
»» updated string(date) false none none
»» dateCreated string(date)¦null false none none
»» dateSentAmount string(date)¦null false none none
»» postingDate string(date)¦null false none none
»» status integer false none none
»» title string false none none
»» sendType string false none none
»» amount integer false none none
»» contract object false none none
»»» id integer false none none

get_settlement_{settlement_id}

Code samples

# You can also use wget
curl -X GET https://app.bergsystem.pl/api/settlement/{settlement_id} \
  -H 'Accept: application/json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

GET https://app.bergsystem.pl/api/settlement/{settlement_id} HTTP/1.1
Host: app.bergsystem.pl
Accept: application/json
X-Tenant: string


const headers = {
  'Accept':'application/json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/settlement/{settlement_id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://app.bergsystem.pl/api/settlement/{settlement_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://app.bergsystem.pl/api/settlement/{settlement_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://app.bergsystem.pl/api/settlement/{settlement_id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/settlement/{settlement_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://app.bergsystem.pl/api/settlement/{settlement_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /settlement/{settlement_id}

Parameters

Name In Type Required Description
settlement_id path integer true settlement id
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Example responses

200 Response

{
  "data": {
    "_id": 0,
    "created": "2019-08-24",
    "updated": "2019-08-24",
    "dateCreated": "2019-08-24",
    "dateSentAmount": "2019-08-24",
    "postingDate": "2019-08-24",
    "status": 0,
    "title": "string",
    "sendType": "string",
    "amount": 0,
    "contract": {
      "id": 0
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Settlement data Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» data Settlement false none none
»» _id integer false none none
»» created string(date) false none none
»» updated string(date) false none none
»» dateCreated string(date)¦null false none none
»» dateSentAmount string(date)¦null false none none
»» postingDate string(date)¦null false none none
»» status integer false none none
»» title string false none none
»» sendType string false none none
»» amount integer false none none
»» contract object false none none
»»» id integer false none none

patch_settlement_{settlement_id}

Code samples

# You can also use wget
curl -X PATCH https://app.bergsystem.pl/api/settlement/{settlement_id} \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Accept: application/json' \
  -H 'X-Tenant: string' \
  -H 'Authorization: Bearer {access-token}'

PATCH https://app.bergsystem.pl/api/settlement/{settlement_id} HTTP/1.1
Host: app.bergsystem.pl
Content-Type: application/vnd.api+json
Accept: application/json
X-Tenant: string

const inputBody = '{
  "data": {
    "attributes": {
      "status": 1
    }
  }
}';
const headers = {
  'Content-Type':'application/vnd.api+json',
  'Accept':'application/json',
  'X-Tenant':'string',
  'Authorization':'Bearer {access-token}'
};

fetch('https://app.bergsystem.pl/api/settlement/{settlement_id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/vnd.api+json',
  'Accept' => 'application/json',
  'X-Tenant' => 'string',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.patch 'https://app.bergsystem.pl/api/settlement/{settlement_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/vnd.api+json',
  'Accept': 'application/json',
  'X-Tenant': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('https://app.bergsystem.pl/api/settlement/{settlement_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/vnd.api+json',
    'Accept' => 'application/json',
    'X-Tenant' => 'string',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','https://app.bergsystem.pl/api/settlement/{settlement_id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://app.bergsystem.pl/api/settlement/{settlement_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/vnd.api+json"},
        "Accept": []string{"application/json"},
        "X-Tenant": []string{"string"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://app.bergsystem.pl/api/settlement/{settlement_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /settlement/{settlement_id}

Body parameter

{
  "data": {
    "attributes": {
      "status": 1
    }
  }
}

Parameters

Name In Type Required Description
settlement_id path integer true settlement id
body body object true none
» data body object false none
»» attributes body object false none
»»» status body integer false 0 - new
X-Tenant header string false "Tenant" field value from GET /token response. Required only for cloud version API.

Example responses

200 Response

{
  "data": {
    "_id": 0,
    "created": "2019-08-24",
    "updated": "2019-08-24",
    "dateCreated": "2019-08-24",
    "dateSentAmount": "2019-08-24",
    "postingDate": "2019-08-24",
    "status": 0,
    "title": "string",
    "sendType": "string",
    "amount": 0,
    "contract": {
      "id": 0
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Settlement data Inline
400 Bad Request Error. Error
401 Unauthorized Unauthorized. Error
403 Forbidden Not enough privellages for this resource. Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
» data Settlement false none none
»» _id integer false none none
»» created string(date) false none none
»» updated string(date) false none none
»» dateCreated string(date)¦null false none none
»» dateSentAmount string(date)¦null false none none
»» postingDate string(date)¦null false none none
»» status integer false none none
»» title string false none none
»» sendType string false none none
»» amount integer false none none
»» contract object false none none
»»» id integer false none none

Schemas

BaseCustomer

{
  "_id": 12333,
  "firstname": "James",
  "lastname": "Smith",
  "parentUserId": 1,
  "path": "/1/2",
  "email": "kljkasd@o2.pl",
  "originsStatus": "1",
  "personalDataProcessingAgreement": true,
  "commercialContentAgreement": true,
  "marketingContentAgreement": false,
  "mailSmsMessagesAgreement": true,
  "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
  "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
  "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
  "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
  "visibility": "ADVISER_ONLY",
  "idCardSeries": "STM",
  "phone": "48943210675",
  "pesel": "33072308033",
  "city": "Wroclaw",
  "street": "Jaworowa",
  "houseNumber": "20A/77",
  "premisesNumber": "18",
  "postcode": "00-930",
  "state": "Krakow",
  "region": "Malopolskie",
  "gender": "male",
  "birthday": "2000-01-30",
  "driveLicenceDate": "2000-01-30",
  "invoiceCity": "Poznan",
  "invoiceEmail": "kljkasd@o2.pl",
  "invoiceStreet": "Topolowa",
  "invoiceHouseNumber": "30A/36",
  "invoicePremisesNumber": "37A",
  "invoicePostcode": "invoicePostcode",
  "invoiceNip": "2967751927",
  "invoiceName": "Faktura",
  "additionalPhone": "48475036329",
  "additionalEmail": "emilia05@sawicka.pl",
  "additionalCity": "Sieradz",
  "additionalStreet": "Orzeszkowej Elizy",
  "additionalHouseNumber": "89/11",
  "additionalPremisesNumber": "42/69",
  "additionalPostcode": "07-524",
  "officeCity": "Poznan",
  "officeStreet": "Cisowa",
  "officeHouseNumber": "32A",
  "officePremisesNumber": "11",
  "officePostcode": "26-536",
  "createdDate": "2020-09-25T00:00:00+02:00",
  "modifiedDate": "2020-09-25T00:00:00+02:00",
  "tags": [
    "VIP"
  ],
  "description": "My description",
  "linkedIn": "string",
  "facebook": "string",
  "extraFields": {
    "property1": "string",
    "property2": "string"
  },
  "extraAgreements": {
    "property1": true,
    "property2": true
  }
}

Properties

Name Type Required Restrictions Description
_id integer false read-only none
firstname string false none none
lastname string false none none
parentUserId integer false none none
path string false read-only none
email string(email) false none none
originsStatus string false none none
personalDataProcessingAgreement boolean false none none
commercialContentAgreement boolean false none none
marketingContentAgreement boolean false none none
mailSmsMessagesAgreement boolean false none none
personalDataProcessingAgreementModified string(date-time) false read-only none
commercialContentAgreementModified string(date-time) false read-only none
marketingContentAgreementModified string(date-time) false read-only none
mailSmsMessagesAgreementModified string(date-time) false read-only none
visibility string false none none
idCardSeries string false none none
phone string false none none
pesel string false none none
city string false none none
street string false none none
houseNumber string false none none
premisesNumber string false none none
postcode string false none none
state string false none none
region string false none none
gender string false none none
birthday string(date) false none none
driveLicenceDate string(date) false none none
invoiceCity string false none none
invoiceEmail string(email) false none none
invoiceStreet string false none none
invoiceHouseNumber string false none none
invoicePremisesNumber string false none none
invoicePostcode string false none none
invoiceNip string false none none
invoiceName string false none none
additionalPhone string false none none
additionalEmail string(email) false none none
additionalCity string false none none
additionalStreet string false none none
additionalHouseNumber string false none none
additionalPremisesNumber string false none none
additionalPostcode string false none none
officeCity string false none none
officeStreet string false none none
officeHouseNumber string false none none
officePremisesNumber string false none none
officePostcode string false none none
createdDate string(date-time) false read-only none
modifiedDate string(date-time) false read-only none
tags [string] false none none
description string false none none
linkedIn string false none none
facebook string false none none
extraFields object false none User defined fields
» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»» anonymous string false none none

or

Name Type Required Restrictions Description
»» anonymous integer false none none

or

Name Type Required Restrictions Description
»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
extraAgreements object false none User defined agreements
» additionalProperties boolean false none none

Enumerated Values

Property Value
gender male
gender female

Customer

{
  "_id": 12333,
  "firstname": "James",
  "lastname": "Smith",
  "parentUserId": 1,
  "path": "/1/2",
  "email": "kljkasd@o2.pl",
  "originsStatus": "1",
  "personalDataProcessingAgreement": true,
  "commercialContentAgreement": true,
  "marketingContentAgreement": false,
  "mailSmsMessagesAgreement": true,
  "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
  "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
  "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
  "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
  "visibility": "ADVISER_ONLY",
  "idCardSeries": "STM",
  "phone": "48943210675",
  "pesel": "33072308033",
  "city": "Wroclaw",
  "street": "Jaworowa",
  "houseNumber": "20A/77",
  "premisesNumber": "18",
  "postcode": "00-930",
  "state": "Krakow",
  "region": "Malopolskie",
  "gender": "male",
  "birthday": "2000-01-30",
  "driveLicenceDate": "2000-01-30",
  "invoiceCity": "Poznan",
  "invoiceEmail": "kljkasd@o2.pl",
  "invoiceStreet": "Topolowa",
  "invoiceHouseNumber": "30A/36",
  "invoicePremisesNumber": "37A",
  "invoicePostcode": "invoicePostcode",
  "invoiceNip": "2967751927",
  "invoiceName": "Faktura",
  "additionalPhone": "48475036329",
  "additionalEmail": "emilia05@sawicka.pl",
  "additionalCity": "Sieradz",
  "additionalStreet": "Orzeszkowej Elizy",
  "additionalHouseNumber": "89/11",
  "additionalPremisesNumber": "42/69",
  "additionalPostcode": "07-524",
  "officeCity": "Poznan",
  "officeStreet": "Cisowa",
  "officeHouseNumber": "32A",
  "officePremisesNumber": "11",
  "officePostcode": "26-536",
  "createdDate": "2020-09-25T00:00:00+02:00",
  "modifiedDate": "2020-09-25T00:00:00+02:00",
  "tags": [
    "VIP"
  ],
  "description": "My description",
  "linkedIn": "string",
  "facebook": "string",
  "extraFields": {
    "property1": "string",
    "property2": "string"
  },
  "extraAgreements": {
    "property1": true,
    "property2": true
  },
  "country": "Polska",
  "invoiceCountry": "Polska",
  "additionalCountry": "Polska",
  "officeCountry": "Polska"
}

Properties

allOf

Name Type Required Restrictions Description
anonymous BaseCustomer false none none

and

Name Type Required Restrictions Description
anonymous object false none none
» country string false none none
» invoiceCountry string false none none
» additionalCountry string false none none
» officeCountry string false none none

CustomerData

{
  "id": "/api/customers/15",
  "type": "Customer",
  "attributes": {
    "_id": 12333,
    "firstname": "James",
    "lastname": "Smith",
    "parentUserId": 1,
    "path": "/1/2",
    "email": "kljkasd@o2.pl",
    "originsStatus": "1",
    "personalDataProcessingAgreement": true,
    "commercialContentAgreement": true,
    "marketingContentAgreement": false,
    "mailSmsMessagesAgreement": true,
    "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
    "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
    "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
    "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
    "visibility": "ADVISER_ONLY",
    "idCardSeries": "STM",
    "phone": "48943210675",
    "pesel": "33072308033",
    "city": "Wroclaw",
    "street": "Jaworowa",
    "houseNumber": "20A/77",
    "premisesNumber": "18",
    "postcode": "00-930",
    "state": "Krakow",
    "region": "Malopolskie",
    "gender": "male",
    "birthday": "2000-01-30",
    "driveLicenceDate": "2000-01-30",
    "invoiceCity": "Poznan",
    "invoiceEmail": "kljkasd@o2.pl",
    "invoiceStreet": "Topolowa",
    "invoiceHouseNumber": "30A/36",
    "invoicePremisesNumber": "37A",
    "invoicePostcode": "invoicePostcode",
    "invoiceNip": "2967751927",
    "invoiceName": "Faktura",
    "additionalPhone": "48475036329",
    "additionalEmail": "emilia05@sawicka.pl",
    "additionalCity": "Sieradz",
    "additionalStreet": "Orzeszkowej Elizy",
    "additionalHouseNumber": "89/11",
    "additionalPremisesNumber": "42/69",
    "additionalPostcode": "07-524",
    "officeCity": "Poznan",
    "officeStreet": "Cisowa",
    "officeHouseNumber": "32A",
    "officePremisesNumber": "11",
    "officePostcode": "26-536",
    "createdDate": "2020-09-25T00:00:00+02:00",
    "modifiedDate": "2020-09-25T00:00:00+02:00",
    "tags": [
      "VIP"
    ],
    "description": "My description",
    "linkedIn": "string",
    "facebook": "string",
    "extraFields": {
      "property1": "string",
      "property2": "string"
    },
    "extraAgreements": {
      "property1": true,
      "property2": true
    },
    "country": "Polska",
    "invoiceCountry": "Polska",
    "additionalCountry": "Polska",
    "officeCountry": "Polska",
    "origins": "Lead"
  }
}

Properties

Name Type Required Restrictions Description
id string false none none
type string false none none
attributes any false none none

allOf

Name Type Required Restrictions Description
» anonymous Customer false none none

and

Name Type Required Restrictions Description
» anonymous object false none none
»» origins string false none none

CustomerExtraFieldData

{
  "id": "/api/customer_extra_fields/1243",
  "type": "CustomerExtraField",
  "attributes": {
    "_id": 1243,
    "label": "Product name",
    "key": "ProductName1"
  }
}

Properties

Name Type Required Restrictions Description
id string false none none
type string false none none
attributes ExtraField false none none

ExtraField

{
  "_id": 1243,
  "label": "Product name",
  "key": "ProductName1"
}

Properties

Name Type Required Restrictions Description
_id integer false read-only none
label string false none none
key string false none none

CustomerExtraAgreementsData

{
  "id": "/api/customer_extra_agreements/1243",
  "type": "CustomerExtraAgreement",
  "attributes": {
    "_id": 1243,
    "label": "Agreement name",
    "key": "smsAgreement",
    "active": true
  }
}

Properties

Name Type Required Restrictions Description
id string false none none
type string false none none
attributes ExtraAgreement false none none

Employee

{
  "id": "/api/employees/15",
  "type": "Employee",
  "attributtes": {
    "_id": 12333,
    "firstname": "James",
    "lastname": "Smith",
    "parentUserId": 1,
    "path": "/1/2",
    "email": "kljkasd@o2.pl",
    "originsStatus": "1",
    "personalDataProcessingAgreement": true,
    "commercialContentAgreement": true,
    "marketingContentAgreement": false,
    "mailSmsMessagesAgreement": true,
    "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
    "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
    "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
    "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
    "visibility": "ADVISER_ONLY",
    "idCardSeries": "STM",
    "phone": "48943210675",
    "pesel": "string",
    "city": "Wroclaw",
    "street": "Jaworowa",
    "houseNumber": "20A/77",
    "premisesNumber": "18",
    "postcode": "00-930",
    "state": "Krakow",
    "region": "Malopolskie",
    "gender": "string",
    "birthday": "string",
    "driveLicenceDate": "2000-01-30",
    "invoiceCity": "Poznan",
    "invoiceEmail": "kljkasd@o2.pl",
    "invoiceStreet": "Topolowa",
    "invoiceHouseNumber": "30A/36",
    "invoicePremisesNumber": "37A",
    "invoicePostcode": "invoicePostcode",
    "invoiceNip": "2967751927",
    "invoiceName": "Faktura",
    "additionalPhone": "48475036329",
    "additionalEmail": "emilia05@sawicka.pl",
    "additionalCity": "Sieradz",
    "additionalStreet": "Orzeszkowej Elizy",
    "additionalHouseNumber": "89/11",
    "additionalPremisesNumber": "42/69",
    "additionalPostcode": "07-524",
    "officeCity": "Poznan",
    "officeStreet": "Cisowa",
    "officeHouseNumber": "32A",
    "officePremisesNumber": "11",
    "officePostcode": "26-536",
    "createdDate": "2020-09-25T00:00:00+02:00",
    "modifiedDate": "2020-09-25T00:00:00+02:00",
    "tags": [
      "VIP"
    ],
    "description": "My description",
    "linkedIn": "string",
    "facebook": "string",
    "extraFields": {
      "property1": "string",
      "property2": "string"
    },
    "extraAgreements": {
      "property1": true,
      "property2": true
    },
    "country": "Polska",
    "invoiceCountry": "Polska",
    "additionalCountry": "Polska",
    "officeCountry": "Polska",
    "firstName": "string",
    "lastName": "string",
    "driveLicenseDate": "string"
  }
}

Properties

Name Type Required Restrictions Description
id string false none none
type string false none none
attributtes any false none none

allOf

Name Type Required Restrictions Description
» anonymous Customer false none none

and

Name Type Required Restrictions Description
» anonymous object false none none
»» firstName string¦null false none none
»» lastName string¦null false none none
»» pesel string¦null false none none
»» gender string¦null false none none
»» driveLicenseDate string¦null false none none
»» birthday string¦null false none none
»» extraFields object false none none

Company

{
  "id": "/api/companies/15",
  "type": "Company",
  "attributes": {
    "_id": 12333,
    "firstname": "James",
    "lastname": "Smith",
    "parentUserId": 1,
    "path": "/1/2",
    "email": "kljkasd@o2.pl",
    "originsStatus": "1",
    "personalDataProcessingAgreement": true,
    "commercialContentAgreement": true,
    "marketingContentAgreement": false,
    "mailSmsMessagesAgreement": true,
    "personalDataProcessingAgreementModified": "2013-07-09T14:09:49+02:00",
    "commercialContentAgreementModified": "2013-07-09T14:09:49+02:00",
    "marketingContentAgreementModified": "2013-07-09T14:09:49+02:00",
    "mailSmsMessagesAgreementModified": "2013-07-09T14:09:49+02:00",
    "visibility": "ADVISER_ONLY",
    "idCardSeries": "STM",
    "phone": "48943210675",
    "pesel": "33072308033",
    "city": "Wroclaw",
    "street": "Jaworowa",
    "houseNumber": "20A/77",
    "premisesNumber": "18",
    "postcode": "00-930",
    "state": "Krakow",
    "region": "Malopolskie",
    "gender": "male",
    "birthday": "2000-01-30",
    "driveLicenceDate": "2000-01-30",
    "invoiceCity": "Poznan",
    "invoiceEmail": "kljkasd@o2.pl",
    "invoiceStreet": "Topolowa",
    "invoiceHouseNumber": "30A/36",
    "invoicePremisesNumber": "37A",
    "invoicePostcode": "invoicePostcode",
    "invoiceNip": "2967751927",
    "invoiceName": "Faktura",
    "additionalPhone": "48475036329",
    "additionalEmail": "emilia05@sawicka.pl",
    "additionalCity": "Sieradz",
    "additionalStreet": "Orzeszkowej Elizy",
    "additionalHouseNumber": "89/11",
    "additionalPremisesNumber": "42/69",
    "additionalPostcode": "07-524",
    "officeCity": "Poznan",
    "officeStreet": "Cisowa",
    "officeHouseNumber": "32A",
    "officePremisesNumber": "11",
    "officePostcode": "26-536",
    "createdDate": "2020-09-25T00:00:00+02:00",
    "modifiedDate": "2020-09-25T00:00:00+02:00",
    "tags": [
      "VIP"
    ],
    "description": "My description",
    "linkedIn": "string",
    "facebook": "string",
    "extraFields": {
      "property1": "string",
      "property2": "string"
    },
    "extraAgreements": {
      "property1": true,
      "property2": true
    },
    "country": "Polska",
    "invoiceCountry": "Polska",
    "additionalCountry": "Polska",
    "officeCountry": "Polska",
    "name": "string",
    "nip": "string",
    "contactPerson": "string",
    "startDate": "2019-08-24",
    "pkd": "string",
    "pkdSecondary": "string",
    "regon": "string",
    "krs": "string"
  }
}

Properties

Name Type Required Restrictions Description
id string false none none
type string false none none
attributes any false none none

allOf

Name Type Required Restrictions Description
» anonymous Customer false none none

and

Name Type Required Restrictions Description
» anonymous object false none none
»» name string false none none
»» nip string¦null false none none
»» contactPerson string¦null false none none
»» startDate string(date)¦null false none none
»» pkd string¦null false none none
»» pkdSecondary string¦null false none none
»» regon string¦null false none none
»» krs string¦null false none none

ExtraAgreement

{
  "_id": 1243,
  "label": "Agreement name",
  "key": "smsAgreement",
  "active": true
}

Properties

Name Type Required Restrictions Description
_id integer false read-only none
label string false none none
key string false none Dynamic api key like rodo_{id} or static like smsAgreement
active boolean false none none

SalesOpportunity

{
  "_id": 1243,
  "customerId": 166,
  "companyId": 32,
  "employeeId": 1,
  "additionalEmployees": [
    {
      "employeeId": 10,
      "commission": 50
    }
  ],
  "title": "Title",
  "sellingProcessId": 1,
  "sellingProcessStepId": 11,
  "expectedSigningDate": "2013-07-09",
  "contractStateId": 1,
  "contractStatusId": 11,
  "abcCategory": 11,
  "description": "Description",
  "city": "Warszawa",
  "street": "Wolna",
  "houseNumber": 23,
  "flatNumber": "4A",
  "postCode": "00-509",
  "isLead": true,
  "extraFields": {
    "property1": "string",
    "property2": "string"
  },
  "items": [
    {
      "item_key": {
        "property1": "string",
        "property2": "string"
      }
    }
  ],
  "createdDate": "2013-07-09T14:09:49+02:00",
  "originSystem": "CC",
  "externalId": "EXT1",
  "startDateOfProtection": "2013-07-09"
}

Properties

Name Type Required Restrictions Description
_id integer false read-only none
customerId integer false none none
companyId integer false none none
employeeId integer true none none
additionalEmployees [object] false none Additional employees with commission percent
» employeeId integer false none none
» commission integer false none none
title string true none none
sellingProcessId integer true none none
sellingProcessStepId integer true none none
expectedSigningDate string(date)¦null false none none
contractStateId integer false none none
contractStatusId integer¦null false none none
abcCategory integer false none none
description string¦null false none none
city string¦null false none none
street string¦null false none none
houseNumber string¦null false none none
flatNumber string¦null false none none
postCode string¦null false none none
isLead boolean false none none
extraFields object false none User defined fields
» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»» anonymous string false none none

or

Name Type Required Restrictions Description
»» anonymous integer false none none

or

Name Type Required Restrictions Description
»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
items [object] false none List of items
» item_key object false none none
»» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»»» anonymous string false none none

or

Name Type Required Restrictions Description
»»» anonymous integer false none none

or

Name Type Required Restrictions Description
»»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
createdDate string(date-time) false read-only none
originSystem string¦null false none none
externalId string¦null false none none
startDateOfProtection string(date-time) false none none

SalesOpportunityData

{
  "id": "/api/sales_opportunities/136",
  "type": "SalesOpportunity",
  "attributes": {
    "_id": 1243,
    "customerId": 166,
    "companyId": 32,
    "employeeId": 1,
    "additionalEmployees": [
      {
        "employeeId": 10,
        "commission": 50
      }
    ],
    "title": "Title",
    "sellingProcessId": 1,
    "sellingProcessStepId": 11,
    "expectedSigningDate": "2013-07-09",
    "contractStateId": 1,
    "contractStatusId": 11,
    "abcCategory": 11,
    "description": "Description",
    "city": "Warszawa",
    "street": "Wolna",
    "houseNumber": 23,
    "flatNumber": "4A",
    "postCode": "00-509",
    "isLead": true,
    "extraFields": {
      "property1": "string",
      "property2": "string"
    },
    "items": [
      {
        "item_key": {
          "property1": "string",
          "property2": "string"
        }
      }
    ],
    "createdDate": "2013-07-09T14:09:49+02:00",
    "originSystem": "CC",
    "externalId": "EXT1",
    "startDateOfProtection": "2013-07-09"
  }
}

Properties

Name Type Required Restrictions Description
id string false none none
type string false none none
attributes SalesOpportunity false none none

SellingProcessData

{
  "id": "/api/selling_processes/1",
  "type": "SellingProcess",
  "attributes": {
    "_id": 1243,
    "name": "Proces sprzedaży"
  }
}

Properties

Name Type Required Restrictions Description
id string false none none
type string false none none
attributes SellingProcess false none none

SellingProcess

{
  "_id": 1243,
  "name": "Proces sprzedaży"
}

Properties

Name Type Required Restrictions Description
_id integer false read-only none
name string false none none

SellingProcessStepData

{
  "id": "/api/selling_process_steps/11",
  "type": "SellingProcessStep",
  "attributes": {
    "_id": 1243,
    "name": "Lead",
    "orders": 1,
    "color": "#fa573c"
  }
}

Properties

Name Type Required Restrictions Description
id string false none none
type string false none none
attributes SellingProcessStep false none none

SellingProcessStep

{
  "_id": 1243,
  "name": "Lead",
  "orders": 1,
  "color": "#fa573c"
}

Properties

Name Type Required Restrictions Description
_id integer false read-only none
name string false none none
orders integer false none none
color string false none none

Sales

{
  "_id": 1243,
  "customerId": 166,
  "companyId": 32,
  "employeeId": 1,
  "additionalEmployees": [
    {
      "employeeId": 10,
      "commission": 50
    }
  ],
  "title": "Title",
  "sellingProcessId": 1,
  "sellingProcessStepId": 11,
  "expectedSigningDate": "2013-07-09",
  "contractStateId": 1,
  "contractStatusId": 1,
  "abcCategory": 11,
  "description": "Description",
  "city": "Warszawa",
  "street": "Wolna",
  "houseNumber": 23,
  "flatNumber": "4A",
  "postCode": "00-509",
  "extraFields": {
    "property1": "string",
    "property2": "string"
  },
  "createdDate": "2013-07-09T14:09:49+02:00",
  "originSystem": "CC",
  "externalId": "EXT1",
  "startDateOfProtection": "2013-07-09"
}

Properties

Name Type Required Restrictions Description
_id integer false read-only none
customerId integer¦null false none none
companyId integer¦null false none none
employeeId integer true none none
additionalEmployees [object] false none Additional employees with commission percent
» employeeId integer false none none
» commission integer false none none
title string true none none
sellingProcessId integer¦null false none none
sellingProcessStepId integer¦null false none none
expectedSigningDate string(date)¦null false none none
contractStateId integer false none none
contractStatusId integer false none none
abcCategory integer false none none
description string¦null false none none
city string¦null false none none
street string¦null false none none
houseNumber string¦null false none none
flatNumber string¦null false none none
postCode string¦null false none none
extraFields object false none User defined fields
» additionalProperties any false none none

anyOf

Name Type Required Restrictions Description
»» anonymous string false none none

or

Name Type Required Restrictions Description
»» anonymous integer false none none

or

Name Type Required Restrictions Description
»» anonymous boolean false none none

continued

Name Type Required Restrictions Description
createdDate string(date-time) false read-only none
originSystem string¦null false none none
externalId string¦null false none none
startDateOfProtection string(date-time) false none none

SalesData

{
  "id": "/api/sales/1",
  "type": "Sales",
  "attributes": {
    "_id": 1243,
    "customerId": 166,
    "companyId": 32,
    "employeeId": 1,
    "additionalEmployees": [
      {
        "employeeId": 10,
        "commission": 50
      }
    ],
    "title": "Title",
    "sellingProcessId": 1,
    "sellingProcessStepId": 11,
    "expectedSigningDate": "2013-07-09",
    "contractStateId": 1,
    "contractStatusId": 1,
    "abcCategory": 11,
    "description": "Description",
    "city": "Warszawa",
    "street": "Wolna",
    "houseNumber": 23,
    "flatNumber": "4A",
    "postCode": "00-509",
    "extraFields": {
      "property1": "string",
      "property2": "string"
    },
    "createdDate": "2013-07-09T14:09:49+02:00",
    "originSystem": "CC",
    "externalId": "EXT1",
    "startDateOfProtection": "2013-07-09"
  }
}

Properties

Name Type Required Restrictions Description
id string false none none
type string false none none
attributes Sales false none none

ContractExtraFieldData

{
  "id": "/api/contract_extra_fields/1243",
  "type": "ContractExtraField",
  "attributes": {
    "_id": 1243,
    "label": "Product name",
    "key": "ProductName1"
  }
}

Properties

Name Type Required Restrictions Description
id string false none none
type string false none none
attributes ExtraField false none none

SettlementPackage

{
  "_id": 0,
  "created": "2019-08-24",
  "updated": "2019-08-24",
  "dateCreated": "2019-08-24",
  "dateSentAmount": "2019-08-24",
  "postingDate": "2019-08-24",
  "status": 0,
  "title": "string",
  "commentAcceptPackage": "string",
  "amount": 0
}

Properties

Name Type Required Restrictions Description
_id integer false none none
created string(date) false none none
updated string(date) false none none
dateCreated string(date)¦null false none none
dateSentAmount string(date)¦null false none none
postingDate string(date)¦null false none none
status integer false none none
title string false none none
commentAcceptPackage string false none none
amount integer false none none

Settlement

{
  "_id": 0,
  "created": "2019-08-24",
  "updated": "2019-08-24",
  "dateCreated": "2019-08-24",
  "dateSentAmount": "2019-08-24",
  "postingDate": "2019-08-24",
  "status": 0,
  "title": "string",
  "sendType": "string",
  "amount": 0,
  "contract": {
    "id": 0
  }
}

Properties

Name Type Required Restrictions Description
_id integer false none none
created string(date) false none none
updated string(date) false none none
dateCreated string(date)¦null false none none
dateSentAmount string(date)¦null false none none
postingDate string(date)¦null false none none
status integer false none none
title string false none none
sendType string false none none
amount integer false none none
contract object false none none
» id integer false none none

Meta

{
  "totalItems": 4,
  "itemsPerPage": 4,
  "currentPage": 1
}

Properties

Name Type Required Restrictions Description
totalItems integer false none none
itemsPerPage integer false none none
currentPage integer false none none

{
  "self": "/customers?page%5Bpage%5D=2",
  "first": "/customers?page%5Bpage%5D=1",
  "prev": "/customers?page%5Bpage%5D=1",
  "next": "/customers?page%5Bpage%5D=3",
  "last": "/customers?page%5Bpage%5D=3"
}

Properties

Name Type Required Restrictions Description
self string false none none
first string false none none
prev string false none none
next string false none none
last string false none none

Error

{
  "errors": [
    {
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string"
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
errors [object] false none none
» title string false none none
» detail string false none none
» source object false none none
»» pointer string false none none