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 resource has the following attributes:Organization Attribute:
Attribute | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
href | string | Absolute URL address to the resource | |||||||||||||||||||||||||||
id | integer | Organization's ID | |||||||||||||||||||||||||||
owner_id | integer | Organization Owner's ID | |||||||||||||||||||||||||||
name | string | Organization name (company name) | |||||||||||||||||||||||||||
tax_id | string | NIP | |||||||||||||||||||||||||||
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 | Organization's bank account number | |||||||||||||||||||||||||||
address | Address | Object containing the organization's address. Address object structure:
|
Sample Organization resource in the JSON format:
Code Block |
---|
{ "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 existtoken_invalid
- the user does not have access rights to a specific organization
List all organizations
List of all organizations which the user has access to
Code Block |
---|
GET /v1/organizations |
Resource is paged. More information at AXA General information.
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 |
---|
$ curl 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 |
---|
{ "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 |
---|
GET /v1/organizations/:organization_id/statistics |
Request example
Code Block |
---|
GET /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
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 |