### Example Request to List Services Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/11731042/Us%2Bugi This example demonstrates how to make a GET request to the /v1/services endpoint using curl. Ensure you include the 'Content-Type' header. ```curl curl -X GET https://api-shipx-pl.easypack24.net/v1/services -H "Content-Type: application/json" ``` -------------------------------- ### Product Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/201752592/Aktualizacja%2Bkoszyka Example of product details to be passed in the cart. ```json "product_id":26 "product_category":20 "product_type":"DIGITAL" "ean":"0" "product_name":"Plecak washpapa" ``` -------------------------------- ### Pagination Example GET Request Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/11731055/Autoryzacja%2BKolekcje%2Bzapyta Example of a GET request to paginate through collection results by specifying the 'page' parameter. ```http GET /v1/points?page=10 HTTP/1.1 Host: api-shipx-pl.easypack24.net Content-Type: application/json ``` -------------------------------- ### Geowidget Initialization and API Call Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/481755145 This example demonstrates how to get a reference to the geowidget element and use its API to change the map position upon initialization. Ensure the 'inpost.geowidget.init' event listener is set up correctly. ```javascript const geowidget = document.getElementById('geowidget'); // Listener to Geowidget init event geowidget.addEventListener('inpost.geowidget.init', (event) => { // Reference to api object const api = event.detail.api; // Call api method. Check ApiInterface for more details. api.changePosition({ longitude: 20.318968, latitude: 49.731131 }, 16); }); ``` -------------------------------- ### Product Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/357925000/Basket%2BUpdate Demonstrates how to include product information in the basket, such as product ID, name, and type. ```json "product_id": 26 "product_category":20 "product_type":"DIGITAL" "ean":"0" "product_name": "washpapa backpack" ``` -------------------------------- ### InPost Pay Basket Binding GET Request Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/200212520 This example shows the structure of a GET request to the InPost Pay API for verifying basket binding. It specifies the endpoint and expected response format. ```http GET /v1/izi/basket/{basket_id}/binding ``` -------------------------------- ### Geowidget Initialization and API Call Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/481755145/Geowidget%2BInternational This example demonstrates how to get a reference to the Geowidget API after initialization and call a method to change the map position. ```html ``` -------------------------------- ### Product Information Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/253788271 Example of product data within the 'products' array, including ID, name, description, and pricing details. ```json { "product_id": 26, "product_category": 20, "product_type": "DIGITAL", "ean": "0", "product_name": "Plecak washpapa", "product_description": " \r\n\r\nCzasem masz ochotę rzucić wszystko, spakować się i wyjechać w Bieszczady? Jest to dobry plan na wakacje. A w ciągu roku po prostu odkrywaj swoje miasto na nowo.\r\n\r\nUdana eksploracja nie obędzie się bez solidnego plecaka ze zwijanym zamknięciem i uszytego z wysokiej jakości materiałów, takiego jak nasz.\r\n\r\nBawełniane pasy zapewnią wygodę noszenia, a washpapa wyrazi Twoje przywiązanie do natury. Pamiętaj! Za każdą przygodą stoi dobry plecak.", "product_link": "https://test.outofthebox.pl/product/plecak-washpapa/", "product_image": "https://test.outofthebox.pl/img/2022/10/INPOST_aranzacje-z-modelami25-1.jpg", "base_price": { "net": "161.79", "gross": "199.00", "vat": "37.21" }, "promo_price": { "net": "160.98", "gross": "198.00", "vat": "37.02" } } ``` -------------------------------- ### Product Information Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/693665798/Aktualizacja%2Bkoszyka%2BV2?atl_f=content-tree Example of product details including ID, category, type, and name. ```json "products": [ { "product_id": 26, "product_category": 20, "product_type": "DIGITAL", "ean": "0", "product_name": "Plecak washpapa" } ] ``` -------------------------------- ### Get Returns Request URL Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/1043791894/InPost%2BReturns%2BREST%2BAPI Example URL to retrieve information about registered return shipments. This GET request can be filtered by date, status, and pagination parameters. ```http https://api.inpost.pl/v1/returns/tickets?dateFrom=2024-01-01T12:00:00.000Z&dateTo=2025-06-19T12:10:19.168Z&status=ACCEPTED&page=0&size=100 ``` -------------------------------- ### Production Geowidget SDK Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/45744192 Link to the example for integrating the Geowidget SDK in a production environment. ```link New GeowidgetSdk example ``` -------------------------------- ### Example Address Book Search Query Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/622724/www.atlassian.com This is an example GET request to search for address books within a specific organization. It includes the Host, Content-Type, and Authorization headers. ```HTTP GET /v1/organizations/12345/address_books HTTP/1.1 Host: api-shipx-pl.easypack24.net Content-Type: application/json Authorization: Bearer lkfjasd9f70y43ohriw...[ommited for brevity]... ``` -------------------------------- ### Retrieve COD Report API Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/11731074/1.4.0%2BCOD An example using curl to make a GET request to the COD Report API. It demonstrates how to specify the organization ID, format, and date range for the report. ```bash curl "https://api-shipx-pl.easypack24.net/v1/organizations/1/reports/cod?format=csv&start_date=2011-01-01&end_date=2012-01-01" -X GET -H "Authorization: Bearer token" ``` -------------------------------- ### Promo Code Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/201752592 Demonstrates how to include a promotional code with its name and value. ```json "name": "Promocja 5%" "promo_code_value": "INPOST10" ``` -------------------------------- ### Example Response for Get Basket List Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/253788271/Pobranie%2Blisty%2Bkoszyk%2Bw This is a sample JSON response for the GET /v1/izi/baskets endpoint, illustrating the structure and data fields returned for a basket, including its summary, delivery information, products, and related products. ```json { "baskets": [ { "basket_id": "3456789", "creation_date": "2023-11-15T07:42:57.218Z", "update_date": "2023-11-15T07:42:57.213Z", "summary": { "basket_base_price": { "net": 13.98, "gross": 17.2, "vat": 3.22 }, "basket_final_price": { "net": 13.98, "gross": 17.2, "vat": 3.22 }, "currency": "PLN", "basket_expiration_date": "2023-11-19T23:00:00.000Z", "payment_type": [ "CARD", "CARD_TOKEN", "GOOGLE_PAY", "APPLE_PAY", "BLIK_CODE", "BLIK_TOKEN", "PAY_BY_LINK" ] }, "delivery": [ { "delivery_type": "APM", "delivery_date": "2023-11-17T11:00:00.000Z", "delivery_price": { "net": 10.56, "gross": 12.99, "vat": 2.43 } }, { "delivery_type": "COURIER", "delivery_date": "2023-11-17T11:00:00.000Z", "delivery_price": { "net": 10.56, "gross": 12.99, "vat": 2.43 } } ], "products": [ { "product_id": "34567", "ean": "678905432", "product_name": "Cymbałki", "product_description": "Dzwonki/cymbałki szkolne 12 tonowe z 2 pałeczkami w zestawie.", "product_link": "https://p/cymbalki-dzwonki-szkolne-34567/", "product_image": "https://o/cymbalki-dzwonki-szkolne34567.jpg", "base_price": { "net": 13.98, "gross": 17.2, "vat": 3.22 }, "quantity": { "quantity": 1, "quantity_type": "INTEGER", "quantity_unit": "sztuka", "available_quantity": 92, "max_quantity": 92 } } ], "related_products": [ { "product_id": "999", "product_name": "Street Fire Mercedes-Benz", "product_link": "https://p/street-fire-mercedes-benz-143/", "product_image": "https://o/street-fire-mercedes-benz-143.jpg", "base_price": { "net": 59.53, "gross": 73.22, "vat": 13.69 }, "quantity": { "quantity": 1, "quantity_type": "INTEGER", "quantity_unit": "sztuka", "available_quantity": 2, "max_quantity": 2 } }, { "product_id": "7643", "product_name": "Golf", "product_link": "https://p/golf-mk1-7643/", "product_image": "https://o/golf-mk1-7643.jpg", "base_price": { "net": 54.1, "gross": 66.54, "vat": 12.44 }, "quantity": { "quantity": 1, "quantity_type": "INTEGER", "quantity_unit": "sztuka", "available_quantity": 9, "max_quantity": 9 } }, { "product_id": "768", "product_name": "Lamborghini yellow", "product_link": "https://p/lamborghini-yellow-118/", "product_image": "https://o/lamborghini-yellow-118.jpg", "base_price": { "net": 116.45, "gross": 143.23, "vat": 26.78 }, "quantity": { "quantity": 1, "quantity_type": "INTEGER", "quantity_unit": "sztuka", "available_quantity": 4, "max_quantity": 4 } }, { "product_id": "324", "product_name": "Figurka Gołąb", "product_link": "https://p/golab-a-324/", "product_image": "https://o/golab-a-324.jpg", "base_price": { "net": 22.37, "gross": 27.52, "vat": 5.15 }, "quantity": { "quantity": 1, "quantity_type": "INTEGER", "quantity_unit": "sztuka", "available_quantity": 19, "max_quantity": 19 } }, { "product_id": "543", "product_name": "Zestaw naczyń", "product_link": "https://p/zestaw-naczyn-543/", "product_image": "https://o/zestaw-naczyn-543.jpg", "base_price": { "net": 22.08, "gross": 27.16, "vat": 5.08 }, "quantity": { "quantity": 1, "quantity_type": "INTEGER", "quantity_unit": "sztuka", "available_quantity": 3, "max_quantity": 3 } }, { "product_id": "678", "product_name": "Alfa Romeo", "product_link": "https://p/alfa-romeo-green-678/", "product_image": "https://o/alfa-romeo-green-678.jpg", "base_price": { "net": 43.61, "gross": 53.64, "vat": 10.03 }, "quantity": { "quantity": 1, "quantity_type": "INTEGER", "quantity_unit": "sztuka", "available_quantity": 5, "max_quantity": 5 } }, { "product_id": "111", "product_name": "Lamborghini white ", "product_link": "https://p/lamborghini-white-111/", "product_image": "https://o/lamborghini-white-111.jpg", "base_price": { "net": } } ] } ] } ``` -------------------------------- ### Available Promotions Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/201752592/Aktualizacja%2Bkoszyka Example of a list of available promotions that a customer can use. ```json "promotions_available": [ { "type": "MERCHANT", "promo_code_value": "IZI", "description": "Super promocja -- 20 PLN ", "start_date": "2024-10-03T07:33:13.942Z", "end_date": "2024-11-03T07:33:13.942Z", "priority": 0, "details": { "link": " https://inpostpay.pl/ " } } ] ``` -------------------------------- ### Product Type Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/693665798/Aktualizacja%2Bkoszyka%2BV2?atl_f=content-tree Example specifying the product type as 'DIGITAL'. ```json "product_type": "DIGITAL" ``` -------------------------------- ### Webhook Setup and Requirements Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/18153630/Webhooki Instructions on how to add a webhook URL for production and sandbox environments, along with the structural requirements for the webhook endpoint. ```APIDOC ## Webhook Setup and Requirements ### Description Webhooks can be added in the InPost - Package Manager under the **My Account** > **API > ORGANIZATION SETTINGS** section for both production and sandbox environments. ### Endpoint Requirements The provided webhook address must meet three basic conditions: 1. **Valid URL Structure**: The URL must be correctly formed. 2. **Resource Accessibility**: The resource pointed to by the URL must be accessible. 3. **HTTP 200 Response**: The resource should respond with an `HTTP 200` code on a GET request. **Example URL Structure:** `https://www.yourserver.pl:8080/directory1/directory2/file.xxx` * `https` (protocol) * `www.yourserver.pl` (address) * `8080` (port) * `/directory1/directory2/file.xxx` (path to the file, **please use lowercase**) **IP Address Range:** Webhooks are sent from the IP address range `91.216.25.0/24`. This range applies to both production and sandbox environments. ``` -------------------------------- ### List Sending Methods API Request Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/11731047/Spos%2Bb%2Bnadania Example GET request to retrieve a list of available sending methods from the ShipX API. ```http GET /v1/sending_methods HTTP/1.1 Host: api-shipx-pl.easypack24.net Content-Type: application/json ``` -------------------------------- ### Product Description Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/357072932/Fetching%2Ba%2Bbasket%2Blist Example of a product description, including HTML formatting. ```json "product_description": "  \r\n\r\nSometimes you just want to leave everything, pack your bags and go to Bieszczady? It's a good plan for holidays. And during the year, simply discover your city again.\r\n\r\n Exploration cannot be successful without a reliable backpack with foldable closings and made of high quality materials, such as our.\r\n\r\nThe cotton straps ensure the convenience of carrying, and washpapa will express your devotion to the nature. Remember! Behind each adventure, there is a good backpack." ``` -------------------------------- ### Get All Statuses Response Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/11731056 This JSON response shows a successful retrieval of shipment statuses. It includes a link to the resource and an array of status items, each with a name, title, and description. ```json { "href": "https://api-shipx-pl.easypack24.net/v1/statuses", "items": [ { "name": "confirmed", "title": "Przygotowana przez Nadawcę", "description": "Nadawca poinformował nas, że przygotował paczkę do nadania. Podróż paczki jeszcze się nie rozpoczęła." }, { "name": "stored_by_sender", "title": "Umieszczona w Paczkomacie Nadawczym", "description": "Paczka oczekuje na wyjęcie z Paczkomatu przez doręczyciela. Stąd trafi do najbliższego oddziału InPost i wyruszy w trasę do Paczkomatu odbiorczego. Na tym etapie Odbiorca otrzyma e-mail informujący o wyruszeniu przesyłki w drogę." }, {"..."} ] } ``` -------------------------------- ### Delivery Options Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/201752592/Aktualizacja%2Bkoszyka Example of how to pass additional delivery options like weekend delivery or cash on delivery. ```json "delivery_name": "Paczka w Weekend" "delivery_code_value": "PWW" ``` -------------------------------- ### Example GET Request for Return Labels Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/11731066/Pobieranie%2Betykiet%2Bzwrotnych This cURL command demonstrates how to request return labels for specific shipments in ZPL format. Ensure you replace placeholders with actual IDs and a valid token. ```bash curl -X GET "https://api-shipx-pl.easypack24.net/v1/organizations/1/shipments/return_labels?shipment_ids[]=4257802&shipment_ids[]=4257803&format=zpl" -H 'Authorization: Bearer token' -H 'Content-Type: application/json' ``` -------------------------------- ### Product Example Source: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/201752592 Example of a product entry in the cart, including product ID, category, and type. ```json "product_id":26 "product_category":20 "product_type":"DIGITAL" ```