Creating a shipment in the simplified mode

Shipment creation in simplified mode 

 

In order to create a shipment within an organization the user has to be its member.

 

Warning! Debit clients!

After creating a shipment we do not return prices for debit clients. The rate attribute is null

 

Warning! Asynchronous action.

After creating a shipment an asynchronous offer, manifestation and offer purchase process will be started.

 

POST /v1/organizations/:organization_id/shipments

Parameters

All the following attributes should be included in the  shipment object.

Parameter

Type

Description

Validation

Parameter

Type

Description

Validation

receiver

Receiver

Receiver details

The attribute is required.

  • In case of a courier service offer (inpost_courier_c2c included), at least receiver.phone_number, receiver.company_name and/or receiver.first_name and receiver.last_name and address  object should be provided

  • In case of parcel locker service offer receiver.phone_number and receiver.email  should be provided

  • Providing all the data will allow both types of offers to be presented

  • In case of is_return = true, Attribute receiver is not required

sender

Sender

Sender details.

The attribute is optional.

  • If no data is provided, the organization data for which the shipment is created will be used by default

parcels

Array[ParcelsSimple]

Details of parcels in the shipment.

The attribute is required.

  • Minimum length - 1, maximum length - 1000

custom_attributes

CustomAttributes

Additional shipment attributes, e.g.

"custom_attributes": {
"target_point": "KRA010"
}

The attribute is optional.

  • The list of available custom attributes has been described in Shipment.

  • Specifying a target point is required in case of a parcel locker service.

cod

Cod

Cash collection amount.

The attribute is optional.

  • Attribute validation and requirement is defined at the time of providing a service.

insurance

Insurance

Shipment insurance amount.

The attribute is required for the following services:
inpost_courier_standard, inpost_courier_express_1000, inpost_courier_express_1200, inpost_courier_express_1700, inpost_courier_palette, inpost_letter_allegro, inpost_courier_allegro, inpost_courier_c2c when passing the COD attribute.

  • Attribute validation and requirement is defined at the time of providing a service.

reference

String

Additional shipment description, e.g. order number.

The attribute is optional.

  • Minimum length - 3, maximum length - 100, can be empty.

is_return

Bool

Determines whether the shipment is a return shipment.

The attribute is optional.

  • Available values (true, false)

  • Can be empty.

  • If true, marks the shipment as a return shipment. In this case the recipient and sender details will be swapped automatically.

service

String

Selected service.

Available services:

The attribute is required.



additional_services

Array[String]

Additional services.

Available additional services: smsemailsaturday.

The attribute is optional.

  • Attribute validated once value is provided.

  • When the additional_services  attribute is provided, the system checks the service  attribute provision, if the service  attribute is not provided or the additional_services  attribute does not fit in the scope of the service  provided, the user will get an error.

external_customer_id 

String

ID of the broker generating shipments within a different organization.

The attribute is optional.

only_choice_of_offer

Bool

Setting the parameter to true results in the offer being selected for the given service but not being paid for. The shipment has to be paid for before the offer expiry. 

The attribute is optional.

  • Default false 

mpk

String

Name of cost center.

The attribute is optional.

  • Maximum length - 255

  • If the attribute is specified, we verify whether it belongs to the organization which the request is made from

  • Can be empty

The cost center must first be added to the organization in order to assign it to the shipment.

comments

String

Any comment

The attribute is optional.

  • Maximum length - 100

  • Minimum lenght - 3

  • Can be empty

 

 

Example requests

Single parcel for courier delivery

curl --location 'https://api-shipx-pl.easypack24.net/v1/organizations/1/shipments' \ --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5c...' \ --header 'Content-Type: application/json' \ --data-raw '{ "sender": { "company_name": "Company_name", "first_name": "first_name", "last_name": "last_name", "email": "test@grupainteger.pl", "phone": "321321321", "address": { "street": "Czerniakowska", "building_number": "87A", "city": "Warszawa", "post_code": "00-718", "country_code": "PL" } }, "receiver": { "company_name": "Company name", "first_name": "Jan", "last_name": "Kowalski", "email": "receiver@example.com", "phone": "888000000", "address": { "street": "Cybernetyki", "building_number": "10", "city": "Warszawa", "post_code": "02-677", "country_code": "PL" } }, "parcels": [ { "id": "small package", "dimensions": { "length": "80", "width": "360", "height": "640", "unit": "mm" }, "weight": { "amount": "25", "unit": "kg" }, "is_non_standard": false } ], "insurance": { "amount": 25, "currency": "PLN" }, "cod": { "amount": 12.50, "currency": "PLN" }, "service": "inpost_courier_standard", "additional_services": [ "email", "sms" ], "reference": "Test", "comments": "dowolny komentarz" }'

Response

HTTP/1.1 201 CREATED Content-Type: application/json { "href": "https://api-shipx-pl.easypack24.net/v1/shipments/1234", "id": 1234, "status": "created", "tracking_number": null, "return_tracking_number": null, "service": "inpost_courier_standard", "reference": "Test", "is_return": false, "application_id": 25, "created_by_id": null, "external_customer_id": null, "sending_method": null, "end_of_week_collection": false, "comments": "dowolny komentarz", "mpk": null, "additional_services": [ "email", "sms" ], "custom_attributes": {}, "cod": { "amount": 12.5, "currency": "PLN" }, "insurance": { "amount": 25.0, "currency": "PLN" }, "sender": { "id": 2798153592, "name": null, "company_name": "Company_name", "first_name": "first_name", "last_name": "last_name", "email": "test@grupainteger.pl", "phone": "321321321", "address": { "id": 1970664224, "street": "Czerniakowska", "building_number": "87A", "line1": null, "line2": null, "city": "Warszawa", "post_code": "00-718", "country_code": "PL" } }, "receiver": { "id": 2798153591, "name": null, "company_name": "Company name", "first_name": "Jan", "last_name": "Kowalski", "email": "receiver@example.com", "phone": "888000000", "address": { "id": 1970664223, "street": "Cybernetyki", "building_number": "10", "line1": null, "line2": null, "city": "Warszawa", "post_code": "02-677", "country_code": "PL" } }, "selected_offer": null, "offers": [], "transactions": [], "parcels": [ { "id": 1404043193, "identify_number": "small package", "tracking_number": null, "is_non_standard": false, "template": null, "dimensions": { "length": 80.0, "width": 360.0, "height": 640.0, "unit": "mm" }, "weight": { "amount": 25.0, "unit": "kg" } } ], "created_at": "2023-12-18T23:52:42.375+01:00", "updated_at": "2023-12-18T23:52:42.375+01:00" }

 

Query with multiple packages (can only be created for inpost_courier)

 

Response


 

Courier service - InPost Courier C2C (service for retail customer - prepaid)

Response


 

Courier service Standard pallet

Response


 

Parcel locker standard

Response


 

Parcel locker - Pass-Thru

Response


 

Shipment Allegro Paczkomat® 24/7 InPost

Response


 

Shipment Allegro miniKurier24 InPost

Response


 

Shipment Allegro Kurier24 InPost

Response