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 ] 

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

Price for the order excluding delivery 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

Price per order including delivery 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.order_discount

Value of discount codes applied to the order

number($decimal) 

"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