Versions Compared

Key

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

The Organization resource   resource represents a company that has a signed agreement for 

provision of services with specific companies (InPost S.A., InPost Paczkomaty Sp. z o.o.
or InPost Express Sp. z o.o.) within Integer.pl Group of Companies

The Organization is created on the basis of the signed agreement, by the persons appointed on the part of Integer.pl Group of Companies Changes in the organization can be made only by an Integer GC employee

for provision of services.

Within the organization the user can manage shipments.

.

PanelbgColor#f0f0f0titleBGColor#f0f0f0title


On this page

:

Table of Contents
maxLevel2
minLevel2
 

Authentication

Access to the resource requires provision of the correct and valid access token.

Getting information about the Organization

Collecting information about a particular organization the user has access to:

Code Block
GET /v1/organizations/:id
The

Structure

Organization resource has the following attributes:

Organization Attribute:

Attribute

Type

Description

hrefstringAbsolute URL address to the resource

id

integer

Integer

Organization's ID

owner_id

integer

Integer

Organization

Owner

owner's ID

name

string

String

Organization name (company name)

tax_id

string

String

NIP

Tax identification number

created_at

datetime

DateTime

Organization's creation date

updated_at

datetimeOrganization's bank

DateTime

Date of the last update of the organization

services

Array[String]

List of services available for the organization

bank_account_number 

string

String

Bank account number

address

Address

Object containing the organization's address. Address object structure

Organization address

Structure of the address object:

Attribute

Type

Description

id 

string

String

Address object

ID

identifier

line1 

string

String

Street

line2 

string

String

Building number

street 

string

String

Street name

building_number 

string

String

Building

House number

city 

string

String

City

post_code 

string

String

Postal code

country_code 

string

String

Country code

(2-3 characters)

Sample

Organization resource

in the

example JSON format:

Code Block
languagejson
{
  "href": "https://api.shipx.pl.easypack24.net/v1/organizations/34",
  "id": 34,
  "owner_id": 1,
  "tax_id": "3973902075",
  "name": "Random org name39739020755741",
  "created_at": "2016-10-04T10:36:49.631+02:00",
  "updated_at": "2016-10-04T10:36:49.631+02:00",
  "services": [
    "inpost_locker_standard",
    "inpost_courier_standard"
  ],
  "address": {
    "id": 808,
    "line1": null,
    "line2": null,
	"street": "Ulica jakaś39739020755741",
	"building_number": "Budynek39739020755741",
    "city": "Szczecin39739020755741",
    "post_code": "22-100",
    "country_code": "PL"
  }
}

Information about errors

 The server may return the following errors

  • resource_not_found - if the organization does not exist
  • token_invalidthe user does not have access rights to a specific organization

List all organizations

List of all organizations which the user has access to


code

Authentication

Resource access requires an active access token.


Organization list

Organization list within the given organization:

Info

The resource is paged. More information on the [1.3.0] API General Information

Code Block
languagejson
GET /v1/organizations

(info) Resource is paged. 

Parameters

Parameter

Description

sort_by

Determines the attribute by which the results are to be sorted.

Default: id

Possible:

- id

- name

- tax_id

- address

- created_at

sort_order

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

By default: ascending (asc)

Request example

Code Block
languagejson
$ curl -X GET https://api-shipx-pl.easypack24.net/v1/organizations -H "Authorization: Bearer
lkfjasd9f70y43ohriw...[ommited for brevity]..."

Response

In response, the server returns collections with the response code  200 OK:

Code Block
 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/organizations",
	"count": 100,
	"page": 1,
	"per_page": 30,
	"items": [
		{
			"href": "https://api-shipx-pl.easypack24.net/v1/organizations/1",
			"id": 1,
			... other organization's attributes omitted for brevity ...
		},
		... other collection's items omitted for brevity ...
	]
}

Organization

's statistics

List of the organization's statistics.

Code Block

details

Retrieving organization information to which the user has access to

Code Block
languagejson
GET /v1/organizations/:
organization_
id
/statistics

Request example

Code Block
languagejson
$ curl -X GET https://api-shipx-pl.easypack24.net/v1/organizations/1
/statistics

Response

In the response the server will return the following data:

Code Block
{
  "to_send": 23,
  "in_logistics": 31,
  "delivered": 58
}
Statistics parameters
 -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/organizations/34",
  "id": 34,
  "owner_id": 1,
  "tax_id": "3973902075",
  "name": "Random org name39739020755741",
  "created_at": "2016-10-04T10:36:49.631+02:00",
  "updated_at": "2016-10-04T10:36:49.631+02:00",
  "services": [
    "inpost_locker_standard",
    "inpost_courier_standard"
  ],
  "address": {
    "id": 808,
    "line1": null,
    "line2": null,
    "street": "Ulica jakaś39739020755741",
    "building_number": "Budynek39739020755741",
    "city": "Szczecin39739020755741",
    "post_code": "22-100",
    "country_code": "PL"
  }
}

Warning

Error information

The response can contain the following errors:

  • resource_not_found - organization doesn't exist

  • token_invalid - user has no access to organization


Organization statistics

List of the organization's statistics.

Code Block
languagejson
GET /v1/organizations/:organization_id/statistics

Search criteria

Parameter

Description

to_send

  • Returns the number of the organization's shipments to be shipped.

         
  • Shipment statuses:

    Code Block
    languagejson
    created, 
    offers_prepared, 
    offer_selected,
confirmed     
  •  
    confirmed

     

in_logistics

  • Returns the number of the organization's shipments in the logistic process.

            
  • Shipment statuses:

    Code Block
    languagejson
    dispatched_by_sender, 
    collected_from_sender, 
    taken_by_courier, 
    adopted_at_source_branch, 
    sent_from_source_branch,
  •  
    adopted_at_sorting_center, 
    sent_from_sorting_center, 
    adopted_at_target_branch, 
    out_for_delivery, 
    ready_to_pickup, 
    pickup_reminder_sent, 
    pickup_time_expired, 
    avizo, 
    claimed, 
    returned_to_sender


delivered

  • Returns the number of the organization's delivered shipments.

  
  • Shipment statuses

: delivered           
  • : delivered   

Request example

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

Response

Code Block
languagejson
{
  "to_send": 23,
  "in_logistics": 31,
  "delivered": 58
}