Versions Compared

Key

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


Info
title

Warning!

Resource is available only in: PL, IT

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..

PanelbgColor#f0f0f0titleBGColor#f0f0f0title


On this page

Table of Contents
minLevel2
 



Structure

Resource MPK

  has attribiutes

  has attributes:

Attribute

Type

Description

Availability

id

Integer

Unique id.

PL, IT

name

String

Place of cost creation name.

PL, IT

description

String

Place of cost creation description.

PL, IT

updated_at

DateTime

Last update.

PL, IT

created_at

DateTime

Creation date.

PL, IT

Example:

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

Authorization

Access to resource requires correct and

valid 

valid access token.

List of MPK

Info
(info)

 Resource is paged.

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

Sorting

Parameter

Description

Availability

sort_by

Attribute by which list will be sorted

PL, IT

sort_order

Default: asc
Available: asc, desc

PL, IT

Request example

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

Response

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"
        }
    ]
}

Details of MPK

Code Block
languagejson
GET /v1/mpks/:id

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/v1/mpks/1",
    "id": 1,
    "name": "Nowa nazwa miejsca powstania kosztów",
    "description": "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"
}

Details of MPK

Code Block
languagejson
GET /v1/mpks/:id

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/v1/mpks/1",
    "id": 1,
    "name": "Nowa nazwa miejsca powstania kosztów",
    "description": "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"
}

Creation of MPK

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

Parameters

Parameter

Type

Description

Requirements

Availability

name

String

MPK name

  • Attribute is required

  • Attribute is unique within organization

  • Max length 255 characters

PL, IT

description

String

MPK description

  • Attribute is required

PL, IT

Request example

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

Response

Code Block
languagejson
HTTP/1.1 201 Created
Content-Type: application/json
 {
    "href": "https://api-shipx-pl.easypack24.net/v1/mpks/3",
    "id": 3,
    "name": "MPK name",
    "description": "MPK description",
    "created_at": "2018-05-16T13:36:28.332+02:00",
    "updated_at": "2018-05-16T13:36:28.332+02:00"
}

Warning

List

of

error

keys

that

may

occur:

  • resource_not_found - organization with this ID does not exist


Updating of MPK

Code Block
PUT /v1/mpks/:id

Parameters

Parameter

Type

Description

Requirements

Availability

name

String

MPK name

  • Attribute is required

  • Attribute is unique within organization

  • Max length 255 characters

PL, IT

description

String

MPK description

  • Attribute is required

PL, IT

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' -d '{
  "name": "MPK name", 
  "description": "MPK description"
}'

Response

Code Block
languagejson
HTTP/1.1 200 OK
Content-Type: application/json
 {
    "href": "https://api-shipx-pl.easypack24.net/v1/mpks/1",
    "id": 1,
    "name": "MPK name",
    "description": "MPK description",
    "created_at": "2018-05-15T21:58:49.427+02:00",
    "updated_at": "2018-05-17T10:35:59.644+02:00"
}

Warning

List

of

error

keys

that

may

occur:

  • resource_not_found -

organization

  • webhook with

this

  • the given ID does not exist