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 | |
| The flag indicating whether the basket without delivery costs is free. | 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 |
|
| Preferred payment method for the basket. The merchant passs a list of preferred payment methods for the basket from which the customer can then select payment methods. If an empty list is passed, the customer will be presented with a default list of payments according to the merchant's configuration in the payment gateway and CASH_ON_DELIVERY when List with possible payment methods: [ CARD, CARD_TOKEN, GOOGLE_PAY, APPLE_PAY, BLIK_CODE, BLIK_TOKEN, PAY_BY_LINK, SHOPPING_LIMIT, DEFERRED_PAYMENT, CASH_ON_DELIVERY ] | object | 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 |