/
Organization

Organization

 

 

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

Attribute

Type

Description

id

Integer

Organization's ID

owner_id

Integer

Organization owner's ID

name

String

Organization name (company name)

tax_id

String

Tax identification number

created_at

DateTime

Organization's creation date

updated_at

DateTime

Date of the last update of the organization

services

Array[String]

List of services available for the organization

bank_account_number 

String

Bank account number

address

Address

Organization address

 

Structure of the address object:

Attribute

Type

Description

Attribute

Type

Description

id 

String

Address object identifier

line1 

String

Street

line2 

String

Building number

street 

String

Street name

building_number 

String

House number

city 

String

City

post_code 

String

Postal code

country_code 

String

Country code

 

Organization resource example JSON format:

HTTP/1.1 200 OK Content-Type: application/json { "href": "http://api-shipx-pl.easypack24.net/v1/organizations", "count": 1, "page": 1, "per_page": 100, "items": [ { "href": "https://api-shipx-pl.easypack24.net/v1/organizations/1", "id": 1, "owner_id": 11, "name": "ShpiX", "tax_id": "PL1234567890", "bank_account_number": null, "carriers": [ "inpost_locker", "inpost_letter", "inpost_courier" ], "services": [ "inpost_locker_allegro", "inpost_locker_pass_thru", "inpost_locker_standard", "inpost_letter_allegro", "inpost_courier_palette", "inpost_courier_allegro", "inpost_courier_standard", "inpost_courier_express_1000", "inpost_courier_express_1200", "inpost_courier_express_1700", "inpost_courier_c2c", "inpost_locker_standard_smart", "inpost_locker_allegro_smart" ], "address": { "id": 123456, "street": "Pana Tadeusza", "building_number": "4", "line1": null, "line2": null, "city": "Kraków", "post_code": "30-727", "country_code": "PL" }, "invoice_address": null, "contact_person": { "id": 12344, "email": null, "phone": null, "first_name": null, "last_name": null }, "created_at": "2016-07-27T12:00:33.923+02:00", "updated_at": "2023-10-30T12:59:09.555+01:00" } ] }

 

Authentication

Resource access requires an active access token.


 

Organization list

Organization list within the given organization:

The resource is paged. More information on the Authorization / Query Collections

GET /v1/organizations

Request example

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

Response

HTTP/1.1 200 OK Content-Type: application/json { "href": "http://api-shipx-pl.easypack24.net/v1/organizations", "count": 1, "page": 1, "per_page": 100, "items": [ { "href": "https://api-shipx-pl.easypack24.net/v1/organizations/1", "id": 1, "owner_id": 11, "name": "ShpiX", "tax_id": "PL1234567890", "bank_account_number": null, "carriers": [ "inpost_locker", "inpost_letter", "inpost_courier" ], "services": [ "inpost_locker_allegro", "inpost_locker_pass_thru", "inpost_locker_standard", "inpost_letter_allegro", "inpost_courier_palette", "inpost_courier_allegro", "inpost_courier_standard", "inpost_courier_express_1000", "inpost_courier_express_1200", "inpost_courier_express_1700", "inpost_courier_c2c", "inpost_locker_standard_smart", "inpost_locker_allegro_smart" ], "address": { "id": 12345, "street": "Pana Tadeusza", "building_number": "4", "line1": null, "line2": null, "city": "Kraków", "post_code": "30-727", "country_code": "PL" }, "invoice_address": null, "contact_person": { "id": 1244, "email": null, "phone": null, "first_name": null, "last_name": null }, "created_at": "2016-07-27T12:00:33.923+02:00", "updated_at": "2023-10-30T12:59:09.555+01:00" } ] }

 

Organization details

Retrieving organization information to which the user has access to

GET /v1/organizations/:id

Request example

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

Response

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.

GET /v1/organizations/:organization_id/statistics

Search criteria

Parameter

Description

Parameter

Description

to_send

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

  • Shipment statuses:

    created, offers_prepared, offer_selected, confirmed

     

in_logistics

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

  • Shipment statuses:

    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   

Request example

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

Response

{ "to_send": 23, "in_logistics": 31, "delivered": 58 }

 

Related content