[1.23.0] Organization

 

Warning!

Resource is available only in the following countries: PL, IT

Organization  resource represents a company that has a signed agreement for provision of services.

Within the organization the user can manage shipments.


Structure

Organization resource has the following attributes:

Attribute

Type

Description

Availability

Attribute

Type

Description

Availability

id

Integer

Organization's ID

PL, IT

owner_id

Integer

Organization owner's ID

PL, IT

name

String

Organization name (company name)

PL, IT

tax_id

String

Tax identification number

PL, IT

created_at

DateTime

Organization's creation date

PL, IT

updated_at

DateTime

Date of the last update of the organization

PL, IT

services

Array[String]

List of services available for the organization

PL, IT

bank_account_number 

String

Bank account number

PL, IT

address

Address

Organization address

PL, IT

 

Structure of the address object:

Attribute

Type

Description

Availability

Attribute

Type

Description

Availability

id 

String

Address object identifier

PL, IT

line1 

String

Street

PL, IT

line2 

String

Building number

PL, IT

street 

String

Street name

PL, IT

building_number 

String

House number

PL, IT

city 

String

City

PL, IT

post_code 

String

Postal code

PL, IT

country_code 

String

Country code

PL, IT

 

Organization resource example JSON format:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "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" } }

 

Authentication

Resource access requires an active access token.


 

Organization list

Organization list within the given organization:

The resource is paged. More information on the https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/28639247

1 GET /v1/organizations

Request example

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

Response

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 details

Retrieving organization information to which the user has access to

1 GET /v1/organizations/:id

Request example

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

Response

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 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"   } }

 

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.

1 GET /v1/organizations/:organization_id/statistics

Search criteria

Parameter

Description

Availability

Parameter

Description

Availability

to_send

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

  • Shipment statuses:

    1 2 3 4 created, offers_prepared, offer_selected, confirmed

     

PL, IT

in_logistics

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

  • Shipment statuses:

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 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



PL, IT

delivered

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

  • Shipment statuses: delivered   

PL, IT

Request example

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

Response

1 2 3 4 5 { "to_send": 23, "in_logistics": 31, "delivered": 58 }