Fetching a basket list
The article describes a method that returns a list of linked baskets, along with an example of how to implement the method in PHP.
On this page:
Description of the method
Method that returns information about active baskets linked with the InPost Pay application. This method is not used in the process of linking and handling of baskets/orders by the customer.
For this method, we require the implementation of all the fields listed in the table, as they make up the entirety of the InPost Pay service. Some of the following fields in the 'Required' column are marked as 'O', i.e. optional, due to the fact that not all products/baskets in online stores have all parameters assigned, so a basket can be created and an order placed without them. However, the implementation/deployment of all fields is REQUIRED from a business perspective.
Parameters
Field name | Description | Type | Requirement status | Additional remarks |
| Page index | string | O |
|
| Page size | string | O |
|
Request – none
Response
Field name | Description | Type | Requirement status | Additional remarks |
| Page size | string | O |
|
| Total number of items | string | O |
|
| Page index | string | O |
|
| Object that returns a list of active baskets in InPost Pay | object | Y |
|
| Unique basket identifier assigned by the merchant | string | Y |
|
| The date when the basket was created/linked to the InPost Pay app | string($date-time) | O |
|
| Date of last basket update | string($date-time) | O |
|
| Object used to provide basic details about the basket | object | Y |
|
| Object used to pass the base price for the basket without delivery costs | object | Y |
|
| Net price | number ($decimal) (10,2) | Y |
|
| Gross price (net + VAT) | number ($decimal) (10,2) | Y | |
| VAT | number ($decimal) (10,2) | Y | |
| An object used to pass the final price of a basket with a promotion and discount code included on the basket, without delivery costs. | object | O |
|
| Net price | number ($decimal) (10,2) | Y |
|
| Gross price (net + VAT) | number ($decimal) (10,2) | Y | |
| VAT | number ($decimal) (10,2) | Y | |
| An object for passing the price of a basket with a promotion included for the basket, but without an applied discount code and without delivery costs. | object | O |
|
| Net price | number ($decimal) (10,2) | Y |
|
| Gross price (net + VAT) | number ($decimal) (10,2) | Y | |
| VAT | number ($decimal) (10,2) | Y | |
| Functionality using the object available in future versions of the application. | boolean | O |
|
| Basket currency. The only currency currently supported is PLN | string | Y |
|
| Basket expiration/validity date. This is the date after which the basket will be automatically removed from the InPost Pay app (will expire). The date cannot be a past date. | string($date-time) | O |
|
| This field is used to provide additional information about the basket that, from the merchant's point of view, may be relevant to the customer | string | O |
|
| A mandatory object defining the payment methods for the basket. The merchant passes | array | Y |
|
| Object with additional information about the basket that the merchant wants to provide to the customer in the InPost Pay app | object | O |
|
| Type of information. There are two types of information based on which the application will present the appropriate format of the message Enum: [ ATTENTION, ERROR ]: ATTENTION – used when we want to inform the customer about important information on the basket, such as the application of a promotional code, the addition of a free product, etc. ERROR – used when some action on the basket failed, such as an invalid promo code or a failed attempt to add a suggested product.
| string | Y |
|
| The contents of the message presented to the customer in the InPost Pay app for the relevant notice.type | string | Y |
|
| An object used to pass additional basket parameters that are saved in the basket details during basket creation/update. The Merchant can use this object, for example, to save parameters that will enable identification/association of the basket with a campaign. Additional parameters are not displayed in the application. | array | O |
|
| Key | string | Y |
|
| Value | string | Y |
|
| An object used to provide information about the preferred delivery options for the relevant basket | array | Y |
|
| Delivery option. Enum:[ APM, COURIER, DIGITAL ]. APM – automated parcel machine, COURIER – InPost courier service | string | Y |
|
| Suggested delivery date | string($date-time) | O |
|
| An object used for passing additional delivery options. Currently, two additional delivery options are available: PWW – weekend parcel; COD – cash on delivery. If the CASH_ON_DELIVERY value is passed for the relevant basket in payment_type, it is mandatory to pass COD as an additional delivery option.
|
| O |
|
| Name of additional delivery option | string | Y |
|
| Additional delivery option code. Currently, there are two codes available: PWW – weekend parcel COD – cash on delivery
| string | Y |
|
| An object used to provide information about the cost of additional delivery options | object | Y |
|
| Net price | number ($decimal) (10,2)
| Y |
|
| Gross price (net + VAT) | number ($decimal) (10,2)
| Y |
|
| VAT | number ($decimal) (10,2)
| Y |
|
| An object used to provide information about the cost of delivery | object | Y |
|
| Net price | number ($decimal) (10,2)
| Y |
|
| Gross price (net + VAT) | number ($decimal) (10,2)
| Y |
|
| VAT | number ($decimal) (10,2)
| Y |
|
| Minimum basket value starting from which the cost of delivery will be PLN 0 | number ($decimal) (10,2)
| O |
|
| List of promotional codes applied to the basket | array | O |
|
| Code name (this field is not required in the next version of the application) | string | Y |
|
| Promo code | string | Y |
|
| The type of regulation or restriction to which the promo code is subject. NOTE: Where the promo code is a code within the meaning of the OMNIBUS Directive, then the “OMNIBUS” value should be passed. | string | O |
|
| A list of available promo codes that customers can apply to the basket. | array | O |
|
| Code type: ONLY_IN_APP – code available only in the InPost Pay app (ONLY IN APP). | string | Y | |
| Code value, e.g. DELIVERY | string | Y | |
| Code description Max: 60 characters | string | Y | |
| Start date on which the promo code becomes effective | string($date-time) | O | |
| End date on which the promo code becomes ineffective | string($date-time) | O | |
| Code priority | integer | O | |
| Promo code details | object | Y | |
| Link to details of the promo code information in the merchant's store. | string | Y | |
| List used to pass information about products in the basket | array | Y |
|
| Product identifier assigned by the merchant | string | Y |
|
| Product category assigned by the merchant | string | O |
|
| A non-mandatory field specifying the product type. Assumes value: · PRODUCT – physical product · DIGITAL – digital product. If the value is null, then by default the application assumes that the product is physical. | string | O |
|
| Ean | string | O |
|
| Product name | string | Y |
|
| Product description | string | O |
|
| Product link on merchant's website | string | O |
|
| Link to product photo. Preferred format: png, jpg (recommendation: png without background)
| string | O |
|
| An object used for providing additional product photos (list). The maximum number of photos is 10 (10 objects { "normal_size": "string", "small_size": "string" } ) | object | O |
|
| Product photo. Preferred size 360 x 352 | string | Y |
|
| Product photo. Preferred size 360 x 504 | string | Y |
|
| Base price of the product | object | Y |
|
| Net price | number ($decimal) (10,2)
| Y |
|
| Gross price (net + VAT) | number ($decimal) (10,2)
| Y | |
| VAT | number ($decimal) (10,2)
| Y | |
| Promotional price of the product | object | O |
|
| Net price | number ($decimal) (10,2)
| Y |
|
| Gross price (net + VAT) | number ($decimal) (10,2)
| Y | |
| VAT | number ($decimal) (10,2)
| Y | |
| An object used to pass the lowest price of the product over the last 30 days. Required for compliance with the Omnibus Directive. It is mandatory to pass the object, if the promotional price of the product was passed (promo_price object) and the promo code with "regulation_type": "OMNIBUS" was passed. | object | O |
|
| Net price | number ($decimal) (10,2)
| Y |
|
| Gross price (net + VAT) | number ($decimal) (10,2)
| Y | |
| VAT | number ($decimal) (10,2)
| Y | |
| An object used to pass information about the quantity of the product | object | Y |
|
| Product quantity | number ($decimal)
| Y |
|
| Quantity type. Available values: [ DECIMAL, INTEGER ].
| string | Y |
|
| Product quantity unit | string | O |
|
| Quantity of available product in the store | number ($decimal)
| O |
|
| The minimum quantity of a product that a customer can order, e.g. in a single order | number ($decimal)
| O |
|
| The maximum quantity of a product that a customer can order, e.g. in a single order | number ($decimal)
| O |
|
| Quantity jump value when the customer increases/decreases the quantity of the product (e.g. 0.1 or 0.5 or 0.01) | number ($decimal) | O |
|
| An object used to specify product attributes | array | O |
|
| Attribute name | string | Y |
|
| Attribute value | string | Y |
|
| An object used to pass information about the available delivery options for a product. If there is no delivery_product object, it means that all delivery options are available | array | O |
|
| Delivery option. Enum:[ APM, COURIER, DIGITAL ]. APM – automated parcel machine, COURIER – InPost courier service | string | O |
|
| Flag indicating whether the type of delivery is available | string | O |
|
| An object used to pass a list of suggested products for the relevant basket, which the customer can add from the InPost Pay application | array | O |
|
| Product identifier assigned by the merchant | string | Y |
|
| Product category assigned by the merchant | string | O |
|
| A non-mandatory field specifying the product type. Assumes value: · PRODUCT – physical product · DIGITAL – digital product. If the value is null, then by default the application assumes that the product is physical. | string | O |
|
| Ean | string | O |
|
| Product name | string | Y |
|
| Product description | string | O |
|
| Product link on merchant's website | string | O |
|
| URL to the product photo. Preferred format: png, jpg (recommendation: png without background) | string |
|
|
| An object used for providing additional product photos (list). The maximum number of photos is 10 (10 objects { "normal_size": "string", "small_size": "string" } ) | object | O |
|
| product photo. Preferred size 360 x 352 | string | Y |
|
| product photo. Preferred size 360 x 504 | string | Y |
|
| Base price of the product | object | Y |
|
| Net price | number ($decimal) (10,2) | Y |
|
| Gross price (net + VAT) | number ($decimal) (10,2) | Y | |
| VAT | number ($decimal) (10,2) | Y | |
| Promotional price of the product | object | O |
|
| Net price | number ($decimal) (10,2) | Y |
|
| Gross price (net + VAT) | number ($decimal) (10,2) | Y | |
| VAT | number ($decimal) (10,2) | Y | |
| An object used to pass the lowest price of the product over the last 30 days. Required for compliance with the Omnibus Directive. It is mandatory to pass the object, if the promotional price of the product was passed (promo_price object) and the promo code with "regulation_type": "OMNIBUS" was passed. | object | O |
|
| Net price | number ($decimal) (10,2) | Y |
|
| Gross price (net + VAT) | number ($decimal) (10,2) | Y | |
| VAT | number ($decimal) (10,2) | Y | |
| An object used to pass information about the quantity of the product | object | Y |
|
| Product quantity | number ($decimal)
| Y |
|
| Quantity type. Available values: [ DECIMAL, INTEGER ].
| string | Y |
|
| Product quantity unit | string | O |
|
| Quantity of available product in the store | number ($decimal) | O |
|
| The minimum quantity of a product that a customer can order, e.g. in a single order | number ($decimal) | O |
|
| The maximum quantity of a product that a customer can order, e.g. in a single order | number ($decimal) | O |
|
| Quantity jump value when the customer increases/decreases the quantity of the product (e.g. 0.1 or 0.5 or 0.01) | number ($decimal) | O |
|
| An object used to specify product attributes | array | O |
|
| Attribute name | string | Y |
|
| Attribute value | string | Y | |
| An object used to pass information about the available delivery options for a product. If there is no delivery_product object, it means that all delivery options are available | array | O |
|
| Delivery option. Enum:[ APM, COURIER, DIGITAL ]. APM – automated parcel machine, COURIER – InPost courier service | string | O |
|
| Flag indicating whether the type of delivery is available | boolean | O |
|
| A flag indicating whether the customer will have free delivery when the suggested product is added to the basket. Where if_delivery_free=true applies to the relevant suggested product, the customer will be presented with an appropriate message on that product. | boolean | O |
|
| An object used to pass a list of consents for the relevant basket | array | Y |
|
| Consent ID assigned by the merchant | string | Y |
|
| A link redirecting to the full wording of the consent, e.g. to the merchant’s website | string | O |
|
| Label for the link passed in consent_link, no more than 500 characters | object | O |
|
| An object used to pass an additional link to the consent/regulations | string | O |
|
| Consent ID assigned by the merchant | string | O |
|
| A link redirecting to the full wording of the consent, e.g. to the merchant’s website | string | O |
|
| Label for the link passed in consent_link, no more than 500 characters | string | Y |
|
| A description of the consent, not more than 500 characters | string | Y |
|
| Consent version | string | Y |
|
| Consent type. Available values: Enum: [OPTIONAL, REQUIRED_ONCE, REQUIRED_ALWAYS ] OPTIONAL – Optional consent REQUIRED_ONCE – required once. This type and version of the consent will be saved on the user's profile with the information that the customer has given consent, and it will be checked by default for subsequent baskets. REQUIRED_ALWAYS – required always. This type and version of the consent is not saved on the user's profile. The customer must give consent every time. | string | Y |
|
GET /v1/izi/baskets
Example response
{
"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": 136.02,
"gross": 167.3,
"vat": 31.28
},
"quantity": {
"quantity": 1,
"quantity_type": "INTEGER",
"quantity_unit": "sztuka",
"available_quantity": 5,
"max_quantity": 5
}
},
{
"product_id": "909",
"product_name": "Porsche green",
"product_link": "https://p/porsche-909/",
"product_image": "https://o/porsche-909.jpg",
"base_price": {
"net": 49.31,
"gross": 60.65,
"vat": 11.34
},
"quantity": {
"quantity": 1,
"quantity_type": "INTEGER",
"quantity_unit": "sztuka",
"available_quantity": 2,
"max_quantity": 1
}
}
],
"consents": [
{
"consent_id": "11",
"consent_link": "https://regulamin/newsletter/",
"consent_description": "Regulamin usługi Newsletter",
"consent_version": "45677",
"requirement_type": "OPTIONAL"
},
{
"consent_id": "12",
"consent_link": "https://regulamin/klienci2023/",
"consent_description": "Informacja o przetwarzaniu danych osobowych",
"consent_version": "4567",
"requirement_type": "REQUIRED_ALWAYS"
},
{
"consent_id": "13",
"consent_link": "https://regulamin/regulamin-2023/",
"consent_description": "Regulamin zakupów w sklepie internetowym",
"consent_version": "6543",
"requirement_type": "REQUIRED_ALWAYS"
}
]
},
{
"basket_id": "111111",
"creation_date": "2023-11-15T00:21:18.372Z",
"update_date": "2023-11-15T00:21:18.368Z",
"summary": {
"basket_base_price": {
"net": 48.7,
"gross": 51.14,
"vat": 2.44
},
"basket_final_price": {
"net": 48.7,
"gross": 51.14,
"vat": 2.44
},
"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": "34556",
"ean": "01234567890",
"product_name": "Czwarte skrzydło",
"product_description": "Opis produktu",
"product_link": "https://b/czwarte-skrzydlo-3456/",
"product_image": "https://o/czwarte-skrzydlo-3456.jpg",
"base_price": {
"net": 48.7,
"gross": 51.14,
"vat": 2.44
},
"quantity": {
"quantity": 1,
"quantity_type": "INTEGER",
"quantity_unit": "sztuka",
"available_quantity": 100,
"max_quantity": 100
}
}
],
"related_products": [
{
"product_id": "8765",
"product_name": "Czegoś tu brakuje...",
"product_link": "https://b/czegos-tu-brakuje-8765/",
"product_image": "https://o/czegos-tu-brakuje-8765.jpg",
"base_price": {
"net": 29.93,
"gross": 31.43,
"vat": 1.5
},
"quantity": {
"quantity": 1,
"quantity_type": "INTEGER",
"quantity_unit": "sztuka",
"available_quantity": 16,
"max_quantity": 16
}
},
{
"product_id": "7777",
"product_name": "Opowiadania",
"product_link": "https://b/opowiadania-7777/",
"product_image": "https://o/opowiadania-7777.jpg",
"base_price": {
"net": 16.08,
"gross": 16.88,
"vat": 0.8
},
"quantity": {
"quantity": 1,
"quantity_type": "INTEGER",
"quantity_unit": "sztuka",
"available_quantity": 100,
"max_quantity": 100
}
},
{
"product_id": "9878",
"product_name": "Bajki",
"product_link": "https://b/bajki-tw-9878/",
"product_image": "https://o/bajki-tw-9878.jpg",
"base_price": {
"net": 36.77,
"gross": 38.61,
"vat": 1.84
},
"quantity": {
"quantity": 1,
"quantity_type": "INTEGER",
"quantity_unit": "sztuka",
"available_quantity": 9,
"max_quantity": 9
}
},
{
"product_id": "6543",
"product_name": "Baśnie",
"product_link": "https://b/basnie-tw-6543/",
"product_image": "https://o/basnie-tw-6543.jpg",
"base_price": {
"net": 18,
"gross": 18.9,
"vat": 0.9
},
"quantity": {
"quantity": 1,
"quantity_type": "INTEGER",
"quantity_unit": "sztuka",
"available_quantity": 87,
"max_quantity": 87
}
},
{
"product_id": "87654",
"product_name": "Nowy tytuł",
"product_link": "https://b/nowy-tytul-87654/",
"product_image": "https://o/nowy-tytul-87654.jpg",
"base_price": {
"net": 46.22,
"gross": 48.53,
"vat": 2.31
},
"quantity": {
"quantity": 1,
"quantity_type": "INTEGER",
"quantity_unit": "sztuka",
"available_quantity": 2,
"max_quantity": 2
}
},
{
"product_id": "7654",
"product_name": "Poradnik",
"product_link": "https://b/poradnik-7654/",
"product_image": "https://o/poradnik-7654.jpg",
"base_price": {
"net": 46.09,
"gross": 48.39,
"vat": 2.3
},
"quantity": {
"quantity": 1,
"quantity_type": "INTEGER",
"quantity_unit": "sztuka",
"available_quantity": 100,
"max_quantity": 100
}
},
{
"product_id": "45678",
"product_name": "Zadania",
"product_link": "https://b/zadania-45678/",
"product_image": "https://o/zadania-45678.jpg",
"base_price": {
"net": 26.67,
"gross": 28,
"vat": 1.33
},
"quantity": {
"quantity": 1,
"quantity_type": "INTEGER",
"quantity_unit": "sztuka",
"available_quantity": 8,
"max_quantity": 8
}
},
{
"product_id": "45670",
"product_name": "Codziennik",
"product_link": "https://b/codziennik-45670/",
"product_image": "https://codziennik-45670.jpg",
"base_price": {
"net": 18.52,
"gross": 19.45,
"vat": 0.93
},
"quantity": {
"quantity": 1,
"quantity_type": "INTEGER",
"quantity_unit": "sztuka",
"available_quantity": 2,
"max_quantity": 1
}
}
],
"consents": [
{
"consent_id": "120",
"consent_link": "https://regulamin/newsletter/",
"consent_description": "Regulamin usługi Newsletter",
"consent_version": "3456",
"requirement_type": "OPTIONAL"
},
{
"consent_id": "121",
"consent_link": "https://regulamin/klienci2023/",
"consent_description": "Informacja o przetwarzaniu danych osobowych",
"consent_version": "123456",
"requirement_type": "REQUIRED_ALWAYS"
},
{
"consent_id": "123",
"consent_link": "https://regulamin/regulamin-2023/",
"consent_description": "Regulamin zakupów w sklepie internetowym",
"consent_version": "34567",
"requirement_type": "REQUIRED_ALWAYS"
}
]
},
],
"page_size": 100,
"total_items": 2,
"page_index": 0
}