Fetching an order list

Fetching an order list

This article describes a method that returns information about orders created in the InPost application, along with an example of how to implement the method in PHP.

 

Description of the method

A method that returns information about orders created in 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

Page index

string

O

  

page_size

Page size

string

O

  

order_id

Order ID

string

O

 

Request – none 

Response

Field name

Description

Type

Requirement status

Additional remarks

page_size

Page size 

integer

O

"page_size":1

total_items

Total number of items 

integer

O

"total_items":159

page_index

Page index 

integer

O

"page_index":1

orders

An object that returns a list of orders  

object

O

 

orders.order_details

Order details 

object

Y

 

orders.order_details.order_comments

Comments about the order 

string

O

"comments ": "Zamówienie przetwarzane"

orders.order_details.order_id

Order ID assigned by the Merchant 

string

Y

"order_id":"3433d1b7-fd9b-484b-aa68-80fccc575407"

orders.order_details.customer_order_id

Order ID presented to the customer and used for payment. If missing, the order_id is used.

string

O

"customer_order_id":"3433d1b7”

orders.order_details.pos_id

POS id 

string

Y

"pos_id":"000000000"

orders.order_details.order_creation_date

Date when the order was created 

string($date-time)

Y

"order_creation_date":"2023-09-07T14:18:41.949Z"

orders.order_details.order_update_date

Last date when the order was updated 

string($date-time)

O

"order_update_date":"2023-09-07T14:23:54.190Z"

orders.order_details.payment

An object that returns payment information 

object

O

 

orders.order_details.payment.payment_type

Selected payment method. Enum: 

[ CARD, CARD_TOKEN, GOOGLE_PAY, APPLE_PAY, BLIK_CODE, BLIK_TOKEN, PAY_BY_LINK, SHOPPING_LIMIT, DEFERRED_PAYMENT, CASH_ON_DELIVERY, FREE_ORDER ] 

string

Y

"payment_type":"BLIK_CODE"

orders.order_details.payment.payment_status

Payment status 

Enum:[ UNPAID, STARTED, PENDING, AUTHORIZED, DECLINED, CANCELLED, ERROR, COD ] 

string

Y

"payment_status":"AUTHORIZED"

orders.order_details.payment.available_payment_types

Payment methods available for the relevant order.  

List with possible values : [ CARD, CARD_TOKEN, GOOGLE_PAY, APPLE_PAY, BLIK_CODE, BLIK_TOKEN, PAY_BY_LINK, SHOPPING_LIMIT, DEFERRED_PAYMENT, CASH_ON_DELIVERY ] 

  

array

O

"available_payment_types":["BLIK_CODE","BLIK_TOKEN","PAY_BY_LINK"]

orders.order_details.payment.payment_details

Payment details 

object

O

 

orders.order_details.payment.payment_details.payment_reference

Reference number 

string

Y

"payment_reference":"52428_9b642ee3-ff3d-4fae-8ff8-30e29c0dafac"

orders.order_details.payment.payment_details.payment_id

Payment ID 

string

O

"payment_id":"3cb4967d-4b63-4c5c-84bc-54e699a2dca0"

orders.order_details.payment.payment_details.payment_sec_token

Security token used  

string

O

"payment_sec_token":"eyJraWQiOiIyMDRjY2U0OC1iYTFkLTQ0ODYtOTNlNy1kY..."

orders.order_details.payment.payment_details.payment.payment_type

Type of payment 

string

Y

"payment_type":"BLIK_TOKEN"

orders.order_details.payment.payment_details.payment_token

Card token 

string

O

"payment_token":"gr...ki@it...om"

orders.order_details.payment.payment_details.payment_card

Card information 

object

O

 

orders.order_details.payment.payment_details.payment_card.last_four_digits

Last 4 digits of the card 

string

O

"last_four_digits":"0021"

orders.order_details.payment.payment_details.payment_card.scheme

The scheme in which the card operates 

string

O

"scheme":"https://static.payu.com/images/mobile/logos/pbl_c.png"

orders.order_details.payment.payment_details.payment_card.card_type

Card type [ DEBIT, CREDIT, PREPAID, CHARGE, DEFERRED_DEBIT ] 

string

O

"card_type":" DEBIT"

orders.order_details.payment.payment_details.payment_status

Payment status 

string

O

"payment_status":"AUTHORIZED"

orders.order_details.payment.payment_details.payment_code

Payment code 

string

O

"payment_code":"00"

orders.order_details.payment.payment_details.payment_description

Additional information about the payment 

string

O

"payment_description":"APPROVED"

orders.order_details.payment.payment_details.payment_error_code

Error code 

string

O

"payment_error_code":"test"

orders.order_details.payment.payment_details.payment_message_code

Payment message (code) 

string

O

"payment_message_code":"userCancelled"

orders.order_details.payment.payment_details.payment_date

Transaction date 

string($date-time)

O

"payment_date":"2023-08-02T09:48:12.302Z"

orders.order_details.order_status

Technical status – used to determine the permissions that the customer can exercise on the order in the InPost Pay application. 

There are 3 technical statuses: 

  

ORDER_COMPLETED – status assigned by the Merchant, informing the InPost Pay application that the order has been finalized by the customer on the Merchant's store page.

ORDER_REJECTED – status indicates that the order has been rejected. 

ORDER_PROCESSING– order is being processed 

string

Y

"order_status":"ORDER_COMPLETED"

orders.order_details.order_merchant_status_description

Descriptive status presented to the customer in the InPost Pay app - each Merchant can transfer the status so that the statuses presented in InPost Mobile are consistent with the statuses presented to the customer in the Merchant's store. 

string

Y

"order_merchant_status_description": "W trakcie realizacji"

orders.order_details.order_base_price

Order price including merchant discounts/coupons and InPost discounts, excluding shipping costs.

object

Y

 

orders.order_details.order_base_price.net

Net 

number ($decimal)

Y

"order_base_price":{"net":202.51,"gross":263.0,"vat":60.49},

orders.order_details.order_base_price.gross

Gross 

number ($decimal)

Y

orders.order_details.order_base_price.vat

VAT 

number ($decimal)

Y

orders.order_details.order_final_price

Total order price including merchant discounts/coupons and InPost discounts, including shipping costs.

object

Y

 

orders.order_details.order_final_price.net

Net 

number ($decimal)

Y

"order_final_price":{"net":208.2,"gross":270.0,"vat":61.8}

orders.order_details.order_final_price.gross

Gross 

number ($decimal)

Y

orders.order_details.order_final_price.vat

VAT 

number ($decimal)

Y

orders.order_details.inpost_discounts

Object containing the list of InPost discounts applied to the order. The merchant is required to reflect the passed discounts in the final order value.

array

O

 

orders.order_details.inpost_discounts.type

Type of discount.

string

Y

 

orders.order_details.inpost_discounts.discount

Value of the discount applied to the order.

number ($decimal)

Y

 

orders.order_details.order_discount

Value of discount codes applied to the order

number($decimal) 

Y 

"order_discount": 20.2

orders.order_details.currency

Order currency (currently only PLN) 

string

Y

"currency":"PLN"

orders.order_details.delivery_references_list

List of assigned order shipment numbers 

array

O

"delivery_references_list":[12345678]

orders.order_details. order_additional_parameters

An object with additional order parameters saved in the order details and passed by the Merchant upon creation/update of the order.

array

O

 

orders.order_details. order_additional_parameters.key

Key

string

Y

 

orders.order_details. order_additional_parameters.value

Value

string

Y

 

orders.account_info

User account information 

object

Y

 

orders.account_info.name

First name  

string

Y

"account_info":{"name":"Jan","surname":"Kowalski","phone_number":{"country_prefix":"+48","phone":"600000000"}

orders.account_info.surname

Last name 

string

Y

orders.account_info.phone_number

Phone number 

object

Y

orders.account_info.phone_number.country_prefix

Prefix 

string

Y

orders.account_info.phone_number.phone

User phone number 

string

Y

orders.account_info.mail

E-mail address of the InPost Pay application user. Merchant can use the above e-mail address only for the purposes of setting up a customer account, user verification, etc. If the user logs in to InPost Pay using Apple, the account's email address contains the hash assigned by Apple and is passed in the following form: abc@privaterelay.appleid.com, for example. In order for a Merchant to communicate with a customer using this address, the Merchant's domain must be added to the InPost account in Apple. Apple limits the number of domains that may be assigned to an account to 100. Therefore, InPost forwards the e-mail address abc@mail.inpostpay.pl to Merchant with the same hash, but in the domain mail.inpostpay.pl. 

string

Y

"mail":"test@g....m"

orders.account_info.client_address

User address 

object

Y

 

orders.account_info.client_address.country_code

Country code 

string

Y

"client_address":{"country_code":"PL","city":"Test","address":"Testowa 3/9 Testowa 3 ","postal_code":"00-000"}

orders.account_info.client_address.address

Address 

string

Y

orders.account_info.client_address.city

City 

string

Y

orders.account_info.client_address.postal_code

Postal code 

string

Y

orders.invoice_details

Invoice details 

object

O

 

orders.invoice_details.legal_form

Legal form [ PERSON, COMPANY ] 

string

O

"invoice_details":{"legal_form":"COMPANY","country_code":"PL","tax_id":"0000000000","company_name":TEST","city":"Warszawa","street":"ul. Testowa","building":"10A","postal_code":"01-997","mail":"test@m...l","registration_data_edited":"true"}

orders.invoice_details.country_code

Country code 

string

O

orders.invoice_details.tax_id_prefix

ID prefix 

string

O

orders.invoice_details.tax_id

Tax ID 

string

O

orders.invoice_details.company_name

Company name 

string

O

orders.invoice_details.name

First name 

string

O

orders.invoice_details.surname

Last name 

string

O

orders.invoice_details.city

City 

string

O

orders.invoice_details.street

Street name 

string

O

orders.invoice_details.building

Building number 

string

O

orders.invoice_details.flat

Flat number 

string

O

orders.invoice_details.postal_code

Postal code 

string

O

orders.invoice_details.mail

E-mail 

string

O

orders.invoice_details.registration_data_edited

Registration date 

string

O

orders.invoice_details.additional_information

Additional information 

string

O

orders.delivery

Delivery information 

object

Y

 

orders.delivery.delivery_type

Delivery option. Enum:[ APM, COURIER, DIGITAL ].  

APM – automated parcel machine, COURIER – InPost courier service 
DIGITAL – digital delivery

string

Y

"delivery_type":"COURIER"

orders.delivery.delivery_date

Delivery date  

string($date-time)

Y

"delivery_date":"2023-09-10T12:00:00.000Z"

orders.delivery.delivery_options

Selected delivery options 

array

O

 

orders.delivery.delivery_options.delivery_name

Name  

string

Y

"delivery_options":[{"delivery_name":"Paczka w Weekend","delivery_code_value":"PWW","delivery_option_price":{"net":5,"gross":"6.15","vat":"1.15"}}]

orders.delivery.delivery_options.delivery_code_value

Option code 

string

Y

orders.delivery.delivery_options.delivery_option_price

Amount of delivery option 

object

Y

orders.delivery.delivery_options.delivery_option_price.net

Net 

number ($decimal)

Y

orders.delivery.delivery_options.delivery_option_price.gross

Gross 

number ($decimal)

Y

orders.delivery.delivery_options.delivery_option_price.vat

VAT 

number ($decimal)

Y

orders.delivery.mail

The masked e-mail address of the user in the order.inpostpay.pl domain, which the Merchant must mandatorily use to handle the created order, in particular registration/shipping (the parcel should be shipped to the e-mail from delivery.mail, which will enable its proper monitoring and to link the created order in InPost Pay with the parcel shipped for the order). 

string

O

"mail":"test@g..m"

orders.delivery.digital_delivery_email

The e-mail address to which the digital product is to be sent. Passed only if there is a digital product in the basket. If the address contains a hash assigned by Apple and is in the form of abc@privaterelay.appleid.com, for example. In order for the Merchant to communicate with a customer using this address, the Merchant's domain must be added to the InPost account in Apple. Apple limits the number of domains that may be assigned to an account to 100. Therefore, InPost forwards the e-mail address abc@mail.inpostpay.pl to Merchant with the same hash, but in the domain mail.inpostpay.pl.

string

O

"digital_delivery_email":"jankowalski@g...m"

orders.delivery.phone_number

Phone number  

object

O

 

orders.delivery.phone_number.country_prefix

Prefix 

string

Y

"phone_number":{"country_prefix":"+48","phone":"600000000"}

orders.delivery.phone_number.phone

Code  

string

Y

orders.delivery.delivery_point

APM delivery point 

string

O

"delivery_point":"RSL218"

orders.delivery.delivery_address

Delivery address 

object

O

 

orders.delivery.delivery_address.name

Name 

string

Y

"delivery_address":{"name":"Jan Kowalski","country_code":"PL","address":"Testowa 3 ","city":"Test","postal_code":"00-000"}

orders.delivery.delivery_address.country_code

Country code 

string

Y

orders.delivery.delivery_address.address

Address 

string

Y

orders.delivery.delivery_address.city

City 

string

Y

orders.delivery.delivery_address.postal_code

Postal code 

string

Y

orders.delivery.delivery_price

An object used to provide information about the cost of delivery  

object

Y

 

orders.delivery.delivery_price.net

Net price 

number ($decimal) (10,2)

Y

"delivery_price":{"net":"10.00","gross":"12.30","vat":"2.30"}

orders.delivery.delivery_price.gross

Gross price (net + VAT) 

number ($decimal) (10,2)

Y

orders.delivery.delivery_price.vat

VAT 

number ($decimal) (10,2)

Y

orders.delivery.courier_note

Notes for the courier 

string

O

" courier_note ":"Proszę o przekazanie przesyłki po godzinie 16"

orders.products

The list of products in the order 

array

Y

 

orders.products.product_id

Product ID assigned by the Merchant 

string

Y

"product_id": 26

orders.products.product_category

Product category assigned by the Merchant 

string

O

"product_category":20

orders.products.product_type

A non-mandatory field specifying the product type. Assumes value:

·       PRODUCT - physical product

·       DIGITAL  - digital product.

If the value is null, the application implicitly assumes that the product is physical.

string

O

"product_type":"DIGITAL"

orders.products.ean

Ean 

string

O

"ean":"0"

orders.products.product_name

Product name  

string

Y

"product_name": "washpapa backpack"

orders.products.product_description

Product description 

string

O

"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\ 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."

orders.products.product_link

Link to the product on the Merchant’s website 

string

O

"product_link":"https://test.outofthebox.pl/product/plecak-washpapa/"

orders.products.product_image

Link to product photo. Preferred format: png, jpg (recommendation: png without background) 

 

string

O

"product_image":"https://test.outofthebox.pl/img/2022/10/INPOST_aranzacje-z-modelami25-1.jpg"

orders.products.additional_product_images

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

-

orders.products.additional_product_images.small_size

Product photo. Preferred size 360 x 352

string

Y

-

orders.products.additional_product_images.normal_size

Product photo. Preferred size 360 x 504

string

Y

-

orders.products.base_price

Product price including discounts and promotional codes applied to the product 

object

Y

 

orders.products.base_price.net

Net price 

number ($decimal) (10,2)

 

Y

"base_price":{"net":"161.79","gross":"199.00","vat":"37.21"}

orders.products.base_price.gross

Gross price (net + VAT) 

number ($decimal) (10,2)

Y

orders.products.base_price.vat

VAT 

number ($decimal) (10,2)

Y

orders.products.lowest_price

An object used to pass the lowest price of the product over the last 30 days. Required for compliance with the Omnibus Directive 

object

O

 

orders.products.lowest_price.net

Net price 

number ($decimal) (10,2)

 

Y

"lowest_price ":{"net":"160.98","gross":"198.00","vat":"37.02"}

orders.products.lowest_price.gross

Gross price (net + VAT) 

number ($decimal) (10,2)

 

Y

orders.products.lowest_price.vat

VAT 

number ($decimal) (10,2)

 

Y

orders.products.quantity

An object used to pass information about the quantity of the product 

object

Y

 

orders.products.quantity.quantity

Product quantity 

number ($decimal)

Y

"quantity":1

orders.products.quantity.quantity_type

Type of quantity field. Available values: [ DECIMAL, INTEGER ] 

 

string

Y

"quantity_type":"INTEGER"

orders.products.quantity.quantity_unit

Product quantity unit 

string

O

"quantity_unit":"pcs"

orders.products.product_attributes

An object used to specify product attributes 

array

O

 

orders.products.product_attributes.attribute_name

Attribute name 

string

Y

"product_attributes ": [{ "attribute_name ": "Dimensions/Capacity", "attribute_value ":"54 cm x 38 cm x 10 cm "}, { "attribute_name ": "Material", "attribute_value": "Washable paper standard + kodura + woven cotton straps"}]

orders.products.product_attributes.attribute_value

Attribute value 

string

Y

 

orders.products.variants

An object used to pass product variants. Currently, this object is not used. Functionality will be implemented in future versions of the application. 

object

O

 

orders.products.variants.variant_id

Variant ID 

string

Y

 

orders.products.variants.variant_name

Name of the variant 

string

Y

 

orders.products.variants.variant_description

Detailed description of the variant 

string

O

 

orders.products.variants.variant_type

Variant type 

string

O

 

orders.products.variants.variant_values

Value of the variant 

string

O

 

orders.consents

An object used to pass information about the customer's consents for the relevant order 

array

Y

 

orders.consents.consent_id

Consent ID  

string

Y

"consent_id":3

orders.consents.consent_version

Consent version 

string

O

"consent_version":1

orders.consents.is_accepted

Information on whether consent has been given 

boolean

Y

"is_accepted": true

GET /v1/izi/orders

Example response

{ "orders": [ { "order_details": { "order_id": "c5bea8ea-4444-4aaa-9ccf-12345678", "pos_id": "V123", "order_creation_date": "2023-10-19T07:18:27.000Z", "order_update_date": "2023-10-19T08:37:23.313Z", "payment": { "payment_type": "BLIK_CODE", "payment_status": "AUTHORIZED", "payment_details": { "payment_reference": "1234_6e8d5ee2-26eb-4953-bb68-12344567", "payment_type": "BLIK_CODE", "payment_status": "AUTHORIZED", "sdk_payment_status": "PENDING", "payment_id": "1234567-3894-2222-3333-d9cad00781b4", "payment_code": "00", "payment_description": "APPROVED", "payment_date": "2023-10-19T05:18:42.202Z", "base_transaction_amount": { "amount": 35.9, "currency": "PLN" } }, "available_payment_types": [ "CARD", "BLIK_CODE", "BLIK_TOKEN", "PAY_BY_LINK", "SHOPPING_LIMIT", "DEFERRED_PAYMENT" ] }, "order_status": "ORDER_REJECTED", "order_merchant_status_description": "Anulowano", "order_base_price": { "net": 19.52, "gross": 24.01, "vat": 4.49 }, "order_final_price": { "net": 29.19, "gross": 35.9, "vat": 6.71 }, "currency": "PLN", "delivery_references_list": [] }, "account_info": { "name": "<secret>", "surname": "<secret>", "phone_number": { "country_prefix": "+48", "phone": "600000000" }, "mail": "jan.kowalski@o...l", "client_address": { "country_code": "pl", "city": "Warszawa", "address": "Warszawska 3,4", "postal_code": "00-000" } }, "delivery": { "delivery_type": "APM", "delivery_date": "2023-10-21T07:18:27.000Z", "mail": "<secret>", "phone_number": { "country_prefix": "+48", "phone": "600000000" }, "delivery_point": "WAW73M", "delivery_price": { "net": 9.67, "gross": 11.89, "vat": 2.22 } }, "products": [ { "product_id": "12345", "ean": "1234567890", "product_name": "Zestaw balonów", "product_link": "https://zestaw-balonow-urodzinowych", "product_image": "https://zestaw-balonow-urodzinowych-granatowo-czarny.jpg", "base_price": { "net": 19.52, "gross": 31.01, "vat": 4.49 }, "quantity": { "quantity": 1, "quantity_type": "INTEGER", "quantity_unit": "szt." } } ], "consents": [ { "consent_id": "7", "consent_version": "2023-06-06", "is_accepted": true }, { "consent_id": "3", "consent_version": "2018-06-07", "is_accepted": true }, { "consent_id": "2", "consent_version": "2018-06-07", "is_accepted": true }, { "consent_id": "4", "consent_version": "2018-06-07", "is_accepted": false } ] }, { "order_details": { "order_id": "123456-36ca-4731-a945-1234567890", "pos_id": "V123456789", "order_creation_date": "2023-10-19T07:30:46.000Z", "order_update_date": "2023-10-19T07:56:45.748Z", "payment": { "payment_type": "CASH_ON_DELIVERY", "payment_status": "COD" }, "order_status": "ORDER_REJECTED", "order_merchant_status_description": "Anulowano", "order_base_price": { "net": 1.45, "gross": 1.78, "vat": 0.33 }, "order_final_price": { "net": 13.08, "gross": 16.08, "vat": 3 }, "currency": "PLN", "delivery_references_list": [] }, "account_info": { "name": "Jan", "surname": "Kwiatkowski", "phone_number": { "country_prefix": "+48", "phone": "000000000" }, "mail": "j.kwiat@o...l", "client_address": { "country_code": "pl", "city": "Warszawa", "address": "Jana Pawła 33", "postal_code": "00-001" } }, "delivery": { "delivery_type": "APM", "delivery_date": "2023-10-21T07:30:46.000Z", "mail": "<secret>", "phone_number": { "country_prefix": "+48", "phone": "000000000" }, "delivery_point": "BPO02A", "delivery_price": { "net": 9.67, "gross": 11.89, "vat": 2.22 } }, "products": [ { "product_id": "3456", "ean": "12345678986", "product_name": "Magiczna gąbka", "product_link": "https://magiczna-gabka", "product_image": "https://magiczna-gabka.png", "base_price": { "net": 1.45, "gross": 1.78, "vat": 0.33 }, "quantity": { "quantity": 1, "quantity_type": "INTEGER", "quantity_unit": "szt." } } ], "consents": [ { "consent_id": "7", "consent_version": "2023-06-06", "is_accepted": true }, { "consent_id": "3", "consent_version": "2018-06-07", "is_accepted": true }, { "consent_id": "2", "consent_version": "2018-06-07", "is_accepted": true }, { "consent_id": "4", "consent_version": "2018-06-07", "is_accepted": false } ] } ], "page_size": 10, "total_items": 2, "page_index": 0 }