Page tree
Skip to end of metadata
Go to start of metadata

Production environment

To receive an authorization token for API ShipX, use the form at the link: https://inpost.pl/formularz-wsparcie

Link to the POLAND (PL) production environment:  https://api-shipx-pl.easypack24.net

Link to the ITALY (IT) production environment:  https://api-shipx-it.easypack24.net

Sandbox environment

Link to the POLAND (PL) sandbox environment:  https://sandbox-api-shipx-pl.easypack24.net

Link to the ITALY (IT) sandbox environment:  https://stage-api-shipx-it.easypack24.net


On this page

 

Request headers

The following headers can be specified when executing a request

HeaderDescription
Authorization Authorization header where all authorization data should be sent. Details can be found in the Authorization chapter.
X-User-Agent This header allows you to specify the client/platform name and/or other information related to it.
X-User-Agent-Version This header allows you to specify the client/platform number of the request. Its content does not affect the functioning of the API.
X-Request-ID This header allows you to specify the name of the request. It is useful for debugging bugs and problems that may occur during API integration. Its application does not affect the functioning of the API.
Accept-Language 

This header allows you to change the editing of errors. Available values:

  • keys (some_error_message)
  • en_GB (Some error message)
  • pl_PL (Przykładowy komunikat błędu)



Response header

In response, the server returns the following header:
HeaderDescription
X-Request-ID Request ID. It is useful for debugging bugs and problems that may occur during API integration.
If it is specified during the request, the API will not generate its own IID, and the one provided during the request will be returned in the response.



Authorization

All requests which are sent to the server requires to pass a valid access token, which belongs to the owner of the organization.

The access token should be provided in the header Authorization.

Request Example:

GET /v1/users HTTP/1.1
Host: api-shipx-pl.easypack24.net
Content-Type: application/json
Authorization: Bearer TOKEN-MUST-BE-PLACED-HERE



Collections

Collection attributes

AttributeTypeDescription
href StringAbsolute URL address to the collection.
countIntegerA total number of items in the collection.
pageIntegerThe current collection results page.
per_pageIntegerA number of results (per page) returned in the response.
itemsArray
Elements of the collection.

Collection example in JSON:

{
	"href": "https://api-pl-shipx.easypack24.net/v1/points",
	"count": 1024,
	"page": 10,
	"per_page": 100,
	"items": [
		{
			"href": "https://api-shipx-pl.easypack24.net/v1/points/KRA010",
			"id": "KRA010",
			... other resource's params ...
		}
	]
}


Paging

Collections support paging (unless stated otherwise in the resource-specific documentation).

Scrolling through the pages of the collection is done by passing query parameters (page) and/or (page_page) in the request. Request example:

GET /v1/points?page=10 HTTP/1.1
Host: api-shipx-pl.easypack24.net
Content-Type: application/json



Errors

Errors example

HTTP/1.1 400 Bad Request
Content-Type: application/json
 
{
	"status": 400,
	"error": "invalid_parameter",
	"description": "Passed unsupported value (value of the parameter here) to parameter (parameter name)",
	"details": null
}
List of error keys that may occur:
KeyDescription
resource_not_found
The resource you are looking for was not found.
access_forbidden
Access to the specified resource is denied.
invalid_parameterAn invalid value was passed for a parameter in the URI. Details are available under the description key of the error response.
validation_failedValidation error. The data sent in the payload of the POST request is incorrect. Details of the error are in the response under the details key.
offer_expiredThe offer cannot be purchased, because its validity has expired.

Error example

HTTP/1.1 400 Bad Request
Content-Type: application/json
 
{
	"status": 400,
	"error": "validation_failed",
	"description": "Some of data sent in payload are invalid. Check details for more information.",
	"details": {
		"email": ["invalid"]
	}
}

The details object contains a collection in which the keys correspond to the names of parameters sent in the payload of the request, while the values ​​are an array with keys specifying which validation errors occurred for a given parameter.

Possible validation errors:
Validation errorDescription
required
The value for the specified parameter is required.
too_shortThe number of characters is too small. Check the resource documentation for details.
too_longThe number of characters is too large. Check the resource documentation for details.
not_a_numberThe entered value should be a number.
not_an_integerThe entered value should be an integer number.
invalidThe entered value is invalid. Check the resource documentation for details.



  • No labels