Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Parameters

ParameterTypeDescription

Requirements

nameString

Name of cost cente

• The attribute is required

• The attribute value is unique within the organization

• Maximum length 255 characters

descriptionString

Cost center description

• The attribute is required

MPK resource - cost center - user-defined dictionary value, principally refers e.g. to the department which has generated the cost (e.g. sent the shipment) - Marketing Department, Logistics Department etc. The values may be freely defined. MPK (cost center) number should be unique. MPK (cost center) number to be assigned to the shipment so that it does not change after changing the cost center name in the historical data.

For the purposes of settlements of cost centers, COD Report can be used..

PanelbgColor#f0f0f0titleBGColor#f0f0f0title


For the purposes of cost settlements, you can use the COD Report. MPK Resource - place of cost creation - dictionary value defined by user means, e.g: organization department which generated the cost (sent the parcel) - marketing department, logistics department, etc.

It could be freely defined, but should be unique. MPK is assigned to a parcel and even after the change of the MPK name, it cannot change in the historical data.


On this page

Table of Contents
minLevel2
 
The MPK (cost center) resource has the following

Structure

Resource MPK  has attributes:

Attribute

Type

Description

id

Integer

Unique id.

name

String

Name

Place of cost

center

creation name.

description

String

Cost center description

Sample MPK resource in the JSON format

Place of cost creation description.

updated_at

DateTime

Last update.

created_at

DateTime

Creation date.

Example:

Code Block
languagejson
{
    "href": "https://api-shipx-pl.easypack24.net/v1/mpks/1",
    "id": 1,
    "name": "
Nazwa
Place of 
miejsca
cost 
powstania
creation 
kosztów
name.",
    "description": "
Opis
Place of 
miejsca
cost 
powstania
creation 
kosztów
description",
    "created_at": "2018-05-15T21:58:49.427+02:00",
    "updated_at": "2018-05-17T10:35:59.644+02:00"
}
Authentication

Authorization

Access to

the

resource requires

provision of the

correct and

valid for the Organization

.

Downloading the collection of cost centers

Collecting lists of all cost centers for the selected organization

Parameters

List of MPK

Info

 Resource is paged.

Code Block
GET /v1/organizations/:organization_id/mpks

(info) The resource is paged.

Sorting

Parameter

Description

sort_by

Determines the attribute on which the results are to

Attribute by which list will be sorted

.

sort_order

Determines the sorting type - descending(desc) or ascending (asc).

Sample request

Code BlockGET

Default: asc
Available: ascdesc

Request example

Code Block
languagejson
curl -X GET https://api-shipx-pl.easypack24.net/v1/organizations/
:organization_id
1/mpks 
HTTP/1.1 Host: api-shipx-pl.easypack24.net code
-H 'Authorization: Bearer token' -H 'Content-Type: application/json'

Response

In the response the server will return collections with the MPK (cost center) list and HTTP 200 OK code

Code Block
languagejson
HTTP/1.1 200 OK
Content-Type: application/json
 
{
    "href": "http://api-shipx-pl.easypack24.net:3000/v1/organizations/1/mpks",
    "count": 3,
    "page": 1,
    "per_page": 30,
    "items": [
        {
            "href": "https://api-shipx-pl.easypack24.net/v1/mpks/3",
            "id": 3,
            "name": "First",
            "description": "Some New Description 1",
            "created_at": "2018-05-16T13:36:28.332+02:00",
            "updated_at": "2018-05-16T13:36:28.332+02:00"
        },
        {
            "href": "https://api-shipx-pl.easypack24.net/v1/mpks/2",
            "id": 2,
            "name": "Second",
            "description": "Some New Description 2",
            "created_at": "2018-05-16T13:33:03.745+02:00",
            "updated_at": "2018-05-17T09:56:11.500+02:00"
        },
        {
            "href": "https://api-shipx-pl.easypack24.net/v1/mpks/1",
            "id": 1,
            "name": "Third",
            "description": "Some New Description 3",
            "created_at": "2018-05-15T21:58:49.427+02:00",
            "updated_at": "2018-05-15T22:31:04.316+02:00"
        }
    ]
}
Creating a cost center

Details of MPK

Code Block
language
POST
json
GET /
admin/
v1/
organizations
mpks/
organization_
:id
/mpks

The server will return a HTTP response with the 201 Created status.

Parameters

ParameterTypeDescriptionRequirementsnameString

Name of cost center

• The attribute is required           

• The attribute value is unique within the organization     

• Maximum length 255 characters

descriptionString

Cost center description

• The attribute is required

Sample request 

Code BlockPOST /v1/organizations/:organization_id/mpks HTTP/1.1 Host:

Request example

Code Block
languagejson
curl -X GET https://api-shipx-pl.easypack24.net/v1/mpks/1 -H 'Authorization: Bearer token' -H 'Content-Type: application/json'

Response

Code Block
languagejson
HTTP/1.1 200 OK
Content-Type: application/json
 {
    "href": "https://api-shipx-pl.easypack24.net
Content-Type: application/json   {
/v1/mpks/1",
    "id": 1,
    "name": "
Nazwa
Nowa nazwa miejsca powstania kosztów",
    "description": "
Opis
Nowy opis miejsca powstania kosztów",
    "created_at": "2018-05-15T21:58:49.427+02:00",
    "updated_at": "2018-05-15T22:31:04.316+02:00"
}
Sample response

Details of MPK

Code Block
HTTP/1.1 201 Created Location:
languagejson
GET /v1/mpks/:id

Request example

Code Block
languagejson
curl -X GET https://api-shipx-pl.easypack24.net/v1/mpks/
3
1 -H 'Authorization: Bearer token' -H 'Content-Type: application/json'

Response

Code Block
languagejson
HTTP/1.1 200 OK
Content-Type: application/json
 
{
    "href": "https://api-shipx-pl.easypack24.net/v1/mpks/
3
1",
    "id": 
3
1,
    "name": "
Nazwa
Nowa nazwa miejsca powstania kosztów",
    "description": "
Opis
Nowy opis miejsca powstania kosztów",
    "created_at": "2018-05-
16T13
15T21:
36
58:
28
49.
332
427+02:00",
    "updated_at": "2018-05-
16T13
15T22:
36
31:
28
04.
332
316+02:00"
}

Errors:

  • resource_not_found - the organization with the stated ID does not exist

Updating the place of collection order

Code BlockPUT

Creation of MPK

Code Block
languagejson
POST /v1/
mpks
organizations/:
mpk

• The attribute is required           

• The attribute value
organization_id/mpks

Parameters

Parameter

Type

Description

Requirements

name

String

Name of cost center

MPK name

  • Attribute is required

  • Attribute is unique within

the organization     
  • organization

• Maximum
  • Max length 255 characters

description

String

Cost center

MPK description

• The attribute
  • Attribute is required

Sample request

Request example

Code Block
languagejson
curl -X PUT https:/
v1/mpks
/
:mpk_id HTTP/1.1 Host:
api-shipx-pl.easypack24.net/v1/organizations/1/mpks -H 'Authorization: Bearer token' -H 'Content-Type: application/json' 
 
-d '{
  "name": "
Nazwa miejsca powstania kosztów
MPK name", 
  "description": "
Opis miejsca powstania kosztów",code
MPK description"
}'

Response

After completing the request correctly, the server will return a response containing the mpk object with the changed data, with HTTP 200 OK code.

Code Block
languagejson
HTTP/1.1 
200
201 
OK
Created
Content-Type: application/json
 {
    "href": "https://api-shipx-pl.easypack24.net
/admin
/v1/mpks/
1
3",
    "id": 
1
3,
    "name": "
Nazwa miejsca powstania kosztów
MPK name",
    "description": "
Opis miejsca powstania kosztów
MPK description",
    "created_at": "2018-05-
15T21
16T13:
58
36:
49
28.
427
332+02:00",
    "updated_at": "2018-05-
17T10
16T13:
35
36:
59
28.
644
332+02:00"
}
Errors

Warning

List of error keys that may occur:

  • resource_not_found

 

  • -

 webhook

  • organization with

the stated

  • this ID does not exist

,Downloading a single object


Updating of MPK

Code Block
GET
PUT /v1/mpks/
1

Sample request

Code BlockGET /v1/mpks/1 HTTP/1.1 Host:
:id

Parameters

Parameter

Type

Description

Requirements

name

String

MPK name

  • Attribute is required

  • Attribute is unique within organization

  • Max length 255 characters

description

String

MPK description

  • Attribute is required

Request example

Code Block
languagejson
curl -X PUT https://api-shipx-pl.easypack24.net/v1/mpks/1 -H 'Authorization: Bearer token' -H 'Content-Type: application/json' 
X-ShipX-OrganizationId: 1
-d '{
  "name": "MPK name", 
  "description": "MPK description"
}'

Response

Code Block
languagejson
HTTP/1.1 200 
No
OK
Content
Content
-Type: application/json
 
 {
    "href": "https://api-shipx-pl.easypack24.net/v1/mpks/1",
    "id": 1,
    "name": "
Nowa nazwa miejsca powstania kosztów
MPK name",
    "description": "
Nowy opis miejsca powstania kosztów
MPK description",
    "created_at": "2018-05-15T21:58:49.427+02:00",
    "updated_at": "2018-05-
15T22
17T10:
31
35:
04
59.
316
644+02:00"
}

Warning

List of error keys that may occur:

  • resource_not_found - webhook with the given ID does not exist