Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

InPost Pay (Basket App) - is a module which provides access to the API, which makes it possible to exchange information regarding the basket and the processing of the order.

  • In a given moment, the user may have numerous active, synchronized baskets (shopping at different merchants). The payment for each basket takes place separately.

  • The relation between the basket on the part of the merchant and of InPost Pay is 1:1. One basket on the part of the merchant corresponds to one basket at InPost Pay.

  • On the part of the InPost Mobile app, the user will be able to:

    • Change the quantity of a given product in the shopping cart

    • Remove a product from the shopping cart

    • Provide a rebate code

  • Any change in the information about the basket on the side of InPost Mobile is transferred to the merchant. The Merchant always sends back the whole content of the basket.

  • If a synchronized basket is changed on the merchant's side, the Merchant always sends the whole basket to InPost Pay.

Together with the basket, the Merchant provides InPost Mobile with the following information:

Data

Description

Product List

  • name

  • category

  • EAN/ product code

  • net price per piece, VAT, gross price

  • list of attributes (colour, size etc.)

  • number of pieces available

  • link to a picture

Basket summary

  • Delivery method chosen

  • The available forms of delivery (list: courier, parcel locker, the net /gross amount for the delivery mode selected, initial delivery date), and additional delivery options

  • Discount codes used

  • The net/gross amount of the basket before the discount

  • Net/gross basket rebate

  • The net/gross amount of the basket after the rebate (without the delivery costs)

  • The net/gross amount to be paid (without the delivery costs)

  • Payment forms available

  • Currency

  • Basket expiration date

Basket expiration date

After this date, the basket is removed from the list of baskets in InPost Mobile.

List of suggested products

On the InPost Mobile side, the user can add a product to the basket. The information is sent to the merchant, same as with other operations on the basket on the InPost Mobile side.

Discount codes used

The user may add further codes separately. The User should be able to remove any already added rebate code on the InPost Mobile side

Additional delivery options, and the cost of the options

E.g. Parcel on Weekend – PLN 5, Collecting (key: COD) – PLN 4, Packaging service - PLN 15). The COD key is restricted, and makes the cash on delivery payment forms available for the given basket.

Consents 

The list of consents should include the fields:

  • ID

  • Heading – the short name of the consent presented in InPost Mobile limited down to X characters (for instance 150 characters)

  • The necessity of the consent to place the order (always, only for a new version, not required)

  • Consent version (for instance date)

  • Link to the full content of the consent

Info

InPost Mobile stores the information regarding the consents checked for a given merchant, so that the consents required for "a new version" are provided only once for the given ID assigned and the consent version.

The user must accept the consents that are required "always" for each order placed.


On this page

Table of Contents
minLevel1
maxLevel3
outlinefalse
typelist
printablefalse

View basket in InPost Pay Mobile

View of active baskets in InPost Mobile:

Basket details in InPost Mobile:

List of orders placed:


InPost Pay API

List of endpoints issued by the InPost Pay app, used to communicate between the merchant, and the InPost Pay app

Metod

Description

Browser

Status
colourRed
titleDELETE
/v1/izi/browser/{browser_id}/binding

Method deletes binded browser or removes phone from binded browser.

Basket

Status
colourRed
titlePUT
/v1/izi/basket/{basket_id}

This method updates or creates a basket e.g. change products quantity, delivery type etc.

Status
colourRed
titleDELETE
/v1/izi/basket/{basket_id}/binding

Desynchronisation of basket with telephone number

Status
colourGreen
titlePOST
/v1/izi/basket/{basket_id}/binding

This method connect basket with InPost app

Status
colourBlue
titleGET
/v1/izi/basket/{basket_id}/binding

This method verify if basket is connected with InPost app

Status
colourBlue
titleGET
/v1/izi/baskets

Returns baskets list for merchnat

Order

Status
colourGreen
titlePOST
/v1/izi/order/{order_id}/event

Updata order

Status
colourBlue
titleGET
/v1/izi/orders

Returns orders list for merchant

Signature verification

Status
colourBlue
titleGET
/v1/izi/signing-keys/public

Returns public signing keys

Status
colourBlue
titleGET
/v1/izi/signing-keys/public/{version}

Returns public signing key for version

Production Environment

Production environment address: https://api.inpost.plhttps://sandbox-api.inpost.pl/

Sandbox Environment

Test environment address: https://sandbox-api.inpost.plhttps://sandbox-api.inpost.pl/

 

Confluence open api
---
openapi: 3.0.3
info:
  title: Swagger
  description: 'Basket APP API for Merchant'
  version: 3.7.14

tags:
  - name: Browser
    description: Provides access to binding browsers.
  - name: Basket
    description: Provides access to managing baskets.
  - name: Order
    description: Provides access to managing orders.
  - name: Signature verification
    description: Signature verification
paths:
  /v1/izi/basket/{basket_id}:
    put:
      tags:
        - Basket
      summary: Create or update a basket. Consumer Basket App.
      description: This method updates or creates a basket e.g. change products quantity, delivery type etc.
      operationId: addFaq
      parameters:
        - name: basket_id
          in: path
          description: ID basket assigned by merchant to update
          required: true
          style: simple
          explode: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/basket_request_put'
        required: true
      responses:
        "200":
          description: Create or update basket response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response_put_basket'
        "401":
          content:
            application/json:
              example:
                error_code: UNAUTHORIZED
                error_message: Given user is not authorized to access the resource.
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized.
        "403":
          content:
            application/json:
              example:
                error_code: FORBIDDEN
                error_message: Access to given resource is forbidden for current user.
              schema:
                $ref: '#/components/schemas/error'
          description: Forbidden.                
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                internalServerError:
                  $ref: '#/components/examples/internalServerError'
        "400":
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                argumentNotValidError:
                  $ref: '#/components/examples/argumentNotValidError'
                malformedRequest:
                  $ref: '#/components/examples/malformedRequest'
        "404":
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                basketNotFound:
                  $ref: '#/components/examples/basketNotFound'
                browserNotFound:
                  $ref: '#/components/examples/browserNotFound'
        "409":
          description: Conflict. Request cannot be handled with the current state of the target resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                merchantDisabledError:
                  $ref: '#/components/examples/merchantDisabledError'
                basketExpired:
                  $ref: '#/components/examples/basketExpired'
  /v1/izi/basket/{basket_id}/binding:
    delete:
      tags:
        - Basket
      summary: Desynchronisation of basket with telephone number
      description: Desynchronisation of basket with telephone number
      operationId: deleteBasketMerchant
      parameters:
        - name: basket_id
          in: path
          description: ID basket assigned by merchant to update
          required: true
          style: simple
          explode: false
          schema:
            type: string
        - name: if_basket_realized
          in: query
          description: If basket deleted because order completed at merchant
          required: false
          style: form
          explode: false
          schema:
            type: boolean
      responses:
        "204":
          description: basket deleted
        "401":
          content:
            application/json:
              example:
                error_code: UNAUTHORIZED
                error_message: Given user is not authorized to access the resource.
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized.
        "403":
          content:
            application/json:
              example:
                error_code: FORBIDDEN
                error_message: Access to given resource is forbidden for current user.
              schema:
                $ref: '#/components/schemas/error'
          description: Forbidden. 
        "404":
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                basketNotFound:
                  $ref: '#/components/examples/basketNotFound'
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                internalServerError:
                  $ref: '#/components/examples/internalServerError'
        "409":
          description: Conflict. Request cannot be handled with the current state of the target resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                merchantDisabledError:
                  $ref: '#/components/examples/merchantDisabledError'
                basketExpired:
                  $ref: '#/components/examples/basketExpired'
                basketNotBoundError:
                  $ref: '#/components/examples/basketNotBoundError'
    post:
      tags:
        - Basket
      summary: Binding basket and InPost app.
      description: This method connect basket with InPost app.
      operationId: updateBasket
      parameters:
        - name: basket_id
          in: path
          description: ID basket assigned by merchant
          required: true
          style: simple
          explode: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/request_basket_binding'
      responses:
        "200":
          description: Basket response if binding_method = DEEP_LINK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response_basket_binding'
        "202":
          description: Basket response if binding_method = PHONE
        "400":
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                argumentNotValidError:
                  $ref: '#/components/examples/argumentNotValidError'
                malformedRequest:
                  $ref: '#/components/examples/malformedRequest'
        "401":
          content:
            application/json:
              example:
                error_code: UNAUTHORIZED
                error_message: Given user is not authorized to access the resource.
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized.
        "403":
          content:
            application/json:
              example:
                error_code: FORBIDDEN
                error_message: Access to given resource is forbidden for current user.
              schema:
                $ref: '#/components/schemas/error'
          description: Forbidden. 
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                internalServerError:
                  $ref: '#/components/examples/internalServerError'
        "409":
          description: Conflict. Request cannot be handled with the current state of the target resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                basketBoundError:
                  $ref: '#/components/examples/basketBoundError'
                merchantDisabledError:
                  $ref: '#/components/examples/merchantDisabledError'
                basketExpired:
                  $ref: '#/components/examples/basketExpired'
                phoneBindingMethodUnavailableError:
                  $ref: '#/components/examples/phoneBindingMethodUnavailableError'
                bindingRedundantPhoneError:
                  $ref: '#/components/examples/bindingRedundantPhoneError'
                bindingPhoneRequiredError:
                  $ref: '#/components/examples/bindingPhoneRequiredError'
                bindingBrowserRequiredError:
                  $ref: '#/components/examples/bindingBrowserRequiredError'
    get:
      tags:
        - Basket
      summary: Binding basket and InPost app.
      description: This method verify if basket is connected with InPost app.
      operationId: verifyBasket
      parameters:
        - name: basket_id
          in: path
          description: ID basket assigned by merchant
          required: true
          style: simple
          explode: false
          schema:
            type: string
        - name: browser_id
          in: query
          description: ID basket to update
          required: false
          style: form
          explode: false
          schema:
            type: string
      responses:
        "200":
          description: Basket response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response_basket_connected'
        "401":
          content:
            application/json:
              example:
                error_code: UNAUTHORIZED
                error_message: Given user is not authorized to access the resource.
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized.
        "403":
          content:
            application/json:
              example:
                error_code: FORBIDDEN
                error_message: Access to given resource is forbidden for current user.
              schema:
                $ref: '#/components/schemas/error'
          description: Forbidden. 
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                internalServerError:
                  $ref: '#/components/examples/internalServerError'
        "409":
          description: Conflict. Request cannot be handled with the current state of the target resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                merchantDisabledError:
                  $ref: '#/components/examples/merchantDisabledError'
                basketExpired:
                  $ref: '#/components/examples/basketExpired'
  /v1/izi/baskets:
    get:
      tags:
        - Basket
      summary: Returns baskets list for merchnat
      description: Returns baskets list for merchnat
      operationId: basketsList
      parameters:
        - name: page_index
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: page_size
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: string
      responses:
        "200":
          description: Basket details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/merchant_baskets'
        "401":
          content:
            application/json:
              example:
                error_code: UNAUTHORIZED
                error_message: Given user is not authorized to access the resource.
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized.
        "403":
          content:
            application/json:
              example:
                error_code: FORBIDDEN
                error_message: Access to given resource is forbidden for current user.
              schema:
                $ref: '#/components/schemas/error'
          description: Forbidden. 
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                internalServerError:
                  $ref: '#/components/examples/internalServerError'
        "409":
          description: Conflict. Request cannot be handled with the current state of the target resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                merchantDisabledError:
                  $ref: '#/components/examples/merchantDisabledError'
  /v1/izi/browser/{browser_id}/binding:
    delete:
      tags:
        - Browser
      summary: Deletes a binded browser.
      description: Method deletes binded browser or removes phone from binded browser.
      operationId: deleteBrowserMerchant
      parameters:
        - name: browser_id
          in: path
          description: ID of browser
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        "204":
          description: browser deleted
        "401":
          content:
            application/json:
              example:
                error_code: UNAUTHORIZED
                error_message: Given user is not authorized to access the resource.
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized.
        "403":
          content:
            application/json:
              example:
                error_code: FORBIDDEN
                error_message: Access to given resource is forbidden for current user.
              schema:
                $ref: '#/components/schemas/error'
          description: Forbidden. 
        "404":
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                browserNotFound:
                  $ref: '#/components/examples/browserNotFound'
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                internalServerError:
                  $ref: '#/components/examples/internalServerError'
        "409":
          description: Conflict. Request cannot be handled with the current state of the target resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                merchantDisabledError:
                  $ref: '#/components/examples/merchantDisabledError'
  /v1/izi/order/{order_id}/event:
    post:
      tags:
        - Order
      summary: Update order
      operationId: updateOrderMerchant
      parameters:
        - name: order_id
          in: path
          description: ID order assigned by merchant to update
          required: true
          style: simple
          explode: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/request_order_event_merchant'
        required: true
      responses:
        "200":
          description: Order update
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        "400":
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                argumentNotValidError:
                  $ref: '#/components/examples/argumentNotValidError'
                malformedRequest:
                  $ref: '#/components/examples/malformedRequest'
        "404":
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                orderNotFound:
                  $ref: '#/components/examples/orderNotFound'
        "409":
          description: Conflict. Request cannot be handled with the current state of the target resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                merchantDisabledError:
                  $ref: '#/components/examples/merchantDisabledError'
                orderStatusError:
                  $ref: '#/components/examples/orderStatusError'
        "401":
          content:
            application/json:
              example:
                error_code: UNAUTHORIZED
                error_message: Given user is not authorized to access the resource.
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized.
        "403":
          content:
            application/json:
              example:
                error_code: FORBIDDEN
                error_message: Access to given resource is forbidden for current user.
              schema:
                $ref: '#/components/schemas/error'
          description: Forbidden.                   
  /v1/izi/orders:
    get:
      tags:
        - Order
      summary: Returns orders list for merchant
      description: Returns orders list for merchant
      operationId: ordersList
      parameters:
        - name: page_index
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: page_size
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: string
      responses:
        "200":
          description: Get list of orders
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/orders_list'
        "401":
          content:
            application/json:
              example:
                error_code: UNAUTHORIZED
                error_message: Given user is not authorized to access the resource.
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized.
        "403":
          content:
            application/json:
              example:
                error_code: FORBIDDEN
                error_message: Access to given resource is forbidden for current user.
              schema:
                $ref: '#/components/schemas/error'
          description: Forbidden. 
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                internalServerError:
                  $ref: '#/components/examples/internalServerError'
        "409":
          description: Conflict. Request cannot be handled with the current state of the target resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                merchantDisabledError:
                  $ref: '#/components/examples/merchantDisabledError'
  /v1/izi/signing-keys/public:
    get:
      tags:
        - Signature verification
      summary: Returns public signing keys
      description: Returns public signing keys
      operationId: signingKeys
      responses:
        "200":
          description: Get list of orders
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response_signing_keys'
        "401":
          content:
            application/json:
              example:
                error_code: UNAUTHORIZED
                error_message: Given user is not authorized to access the resource.
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized.
        "403":
          content:
            application/json:
              example:
                error_code: FORBIDDEN
                error_message: Access to given resource is forbidden for current user.
              schema:
                $ref: '#/components/schemas/error'
          description: Forbidden. 
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                internalServerError:
                  $ref: '#/components/examples/internalServerError'
        "409":
          description: Conflict. Request cannot be handled with the current state of the target resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                merchantDisabledError:
                  $ref: '#/components/examples/merchantDisabledError'
  /v1/izi/signing-keys/public/{version}:
    get:
      tags:
        - Signature verification
      summary: Returns public signing key for version
      description: Returns public signing key for version
      operationId: versionSigningKeys
      parameters:
        - name: version
          in: path
          description: version
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        "200":
          description: Get list of orders
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response_version_signing_keys'
        "409":
          description: Conflict. Request cannot be handled with the current state of the target resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                merchantDisabledError:
                  $ref: '#/components/examples/merchantDisabledError'
        "404":
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                publicKeyNotFound:
                  $ref: '#/components/examples/publicKeyNotFound'
        "401":
          content:
            application/json:
              example:
                error_code: UNAUTHORIZED
                error_message: Given user is not authorized to access the resource.
              schema:
                $ref: '#/components/schemas/error'
          description: Unauthorized.
        "403":
          content:
            application/json:
              example:
                error_code: FORBIDDEN
                error_message: Access to given resource is forbidden for current user.
              schema:
                $ref: '#/components/schemas/error'
          description: Forbidden. 
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              examples:
                internalServerError:
                  $ref: '#/components/examples/internalServerError'
components:
  examples:
    merchantDisabledError:
      value:
        error_code: MERCHANT_DISABLE
        error_message: 'Merchant with given id is DISABLED'
      summary: MERCHANT_DISABLE
      description: Service is temporarily disabled, because of to many incorrect requests or manual blockade
    basketBoundError:
      value:
        error_code: BASKET_IS_BINDED
        error_message: 'Basket already bound'
      summary: BASKET_IS_BINDED
      description: Basket already bound.
    basketExpired:
      value:
        error_code: BASKET_EXPIRED
        error_message: 'Basket expired'
      summary: BASKET_EXPIRED
      description: Basket expired and will be removed soon.
    basketNotBoundError:
      value:
        error_code: BASKET_NOT_BOUND
        error_message: 'Basket not bound'
      summary: BASKET_NOT_BOUND
      description: Basket not bound.
    bindingRedundantPhoneError:
      value:
        error_code: ERROR_VALIDATION_PHONE_NUMBER
        error_message: 'Phone number required for PHONE binding method only'
      summary: ERROR_VALIDATION_PHONE_NUMBER
      description: Phone number should not be passed for binding methods other than PHONE.
    bindingPhoneRequiredError:
      value:
        error_code: ERROR_VALIDATION_PHONE_NUMBER_REQUIRED
        error_message: 'Phone number is required'
      summary: ERROR_VALIDATION_PHONE_NUMBER_REQUIRED
      description: Phone number is required for PHONE method binding.
    bindingBrowserRequiredError:
      value:
        error_code: ERROR_VALIDATION_BROWSER_REQUIRED
        error_message: 'Browser is required for PHONE binding method'
      summary: ERROR_VALIDATION_BROWSER_REQUIRED
      description: Browser details are required for PHONE binding method
    phoneBindingMethodUnavailableError:
      value:
        error_code: PHONE_BINDING_METHOD_UNAVAILABLE
        error_message: 'Unavailable'
      summary: PHONE_BINDING_METHOD_UNAVAILABLE
      description: Phone binding method temporarily unavailable for requested number.
    orderStatusError:
      value:
        error_code: STATUS_ORDER_ERROR
        error_message: 'Unavailable'
      summary: STATUS_ORDER_ERROR
      description: Can't be changed ORDER_COMPLETED
    publicKeyNotFound:
      value:
        error_code: PUBLIC_KEY_NOT_FOUND
        error_message: 'Public key version {} not found'
      summary: PUBLIC_KEY_NOT_FOUND
      description: public key not found
    argumentNotValidError:
      value:
        error_code: BAD_REQUEST
        error_message: Invalid request.
      summary: BAD_REQUEST
      description: Request validation error. Error message might optionally contain information about constraint violations.
    malformedRequest:
      value:
        error_code: MALFORMED_REQUEST
        error_message: Request not readable.
      summary: MALFORMED_REQUEST
      description: The server was not able to read the request.
    notFound:
      value:
        error_code: NOT_FOUND
        error_message: Resource not found.
      summary: NOT_FOUND
      description: The server was not able to read the request.
    basketNotFound:
      value:
        error_code: BASKET_NOT_FOUND
        error_message: Basket not found.
      summary: BASKET_NOT_FOUND
      description: Basket not found.
    orderNotFound:
      value:
        error_code: ORDER_NOT_FOUND
        error_message: Order not found.
      summary: ORDER_NOT_FOUND
      description: Order not found.
    browserNotFound:
      value:
        error_code: BROWSER_NOT_FOUND
        error_message: Browser not found
      summary: BROWSER_NOT_FOUND
      description: Browser not found .
    internalServerError:
      value:
        error_code: INTERNAL_SERVER_ERROR
        error_message: Something went wrong. Please try again later.
      summary: INTERNAL_SERVER_ERROR
      description: The server encountered unexpected error.
  schemas:
    error:
      required:
        - errorCode
      type: object
      properties:
        error_code:
          type: string
          description: Code that indicates the nature of an error.
        error_message:
          type: string
          description: Additional information which may be useful.
    merchant_baskets:
      type: object
      properties:
        page_size:
          type: integer
          description: page size
        total_items:
          type: integer
          description: total items
        page_index:
          type: integer
          description: page index
        baskets:
          type: array
          description: baskets list
          items:
            $ref: '#/components/schemas/merchant_basket_details'
    request_order_event_merchant:
      type: object
      required:
        - event_id
        - event_data_time
        - event_data
      properties:
        event_id:
          type: string
          description: event id
        event_data_time:
          type: string
          description: event date time
        phone_number:
          $ref: '#/components/schemas/phone_number'
        event_data:
          $ref: '#/components/schemas/event_data_merchant'
    basket_request_put:
      type: object
      required:
        - summary
        - delivery
        - products
        - consents
      properties:
        browser_id:
          type: string
          description: browser id
        summary:
          $ref: '#/components/schemas/basket_summary'
        delivery:
          type: array
          description: delivery list
          items:
            $ref: '#/components/schemas/delivery_basket_response'
        promo_codes:
          type: array
          description: promo codes
          items:
            $ref: '#/components/schemas/promo_codes'
        products:
          type: array
          description: products order list
          items:
            $ref: '#/components/schemas/get_products'
        related_products:
          type: array
          description: related product information
          items:
            $ref: '#/components/schemas/get_products'
        consents:
          type: array
          description: consents list
          items:
            $ref: '#/components/schemas/consents'
    get_products:
      type: object
      required:
        - product_id
        - product_name
        - base_price
        - quantity
      properties:
        product_id:
          type: string
          description: product id
        product_category:
          type: string
          description: product category
        ean:
          type: string
          description: ean code
        product_name:
          type: string
          description: product name
        product_description:
          type: string
          description: product description
        product_link:
          type: string
          description: product link
        product_image:
          type: string
          description: product image
        base_price:
          $ref: '#/components/schemas/base_price'
        promo_price:
          $ref: '#/components/schemas/base_price'
        lowest_price:
          $ref: '#/components/schemas/base_price'
        quantity:
          $ref: '#/components/schemas/quantity'
        product_attributes:
          type: array
          description: product attributes
          items:
            $ref: '#/components/schemas/product_attributes'
        variants:
          type: array
          description: variant product ordered list
          items:
            $ref: '#/components/schemas/variants'
    get_products_order:
      type: object
      required:
        - product_id
        - product_name
        - base_price
        - quantity
      properties:
        product_id:
          type: string
          description: product id
        product_category:
          type: string
          description: product category
        ean:
          type: string
          description: ean code
        product_name:
          type: string
          description: product name
        product_description:
          type: string
          description: product description
        product_link:
          type: string
          description: product link
        product_image:
          type: string
          description: product image
        base_price:
          $ref: '#/components/schemas/base_price'
        lowest_price:
          $ref: '#/components/schemas/base_price'
        quantity:
          $ref: '#/components/schemas/quantity_order'
        product_attributes:
          type: array
          description: product attributes
          items:
            $ref: '#/components/schemas/product_attributes'
        variants:
          type: array
          description: variant product ordered list
          items:
            $ref: '#/components/schemas/variants'
    variants:
      type: object
      description: variant product ordered
      required:
        - variant_id
        - variant_name
      properties:
        variant_id:
          type: string
          description: variant id
        variant_name:
          type: string
          description: variant name
        variant_description:
          type: string
          description: variant description
        variant_type:
          type: string
          description: variant type
        variant_values:
          type: string
          description: variant values
    consents:
      type: object
      description: Consents list
      required:
        - consent_id
        - consent_description
        - requirement_type
        - consent_link
        - consent_version
      properties:
        consent_id:
          type: string
          description: consent id
        consent_link:
          type: string
          description: consent link
        consent_description:
          type: string
          description: consent description
        consent_version:
          type: string
          description: consent version
        requirement_type:
          type: string
          enum:
            - OPTIONAL
            - REQUIRED_ONCE
            - REQUIRED_ALWAYS
          description: information on requirement consent
    delivery:
      type: object
      description: delivery information
      required:
        - delivery_type
        - delivery_price
        - delivery_date
      properties:
        delivery_type:
          type: string
          enum:
            - APM
            - COURIER
          description: delivery type (APM; COURIER)
        delivery_date:
          description: delivery date
          type: string
          format: date-time
        delivery_options:
          type: array
          description: delivery options
          items:
            $ref: '#/components/schemas/delivery_options'
        mail:
          type: string
          description: email
        phone_number:
          $ref: '#/components/schemas/phone_number'
        delivery_point:
          type: string
          description: APM delivery point
        delivery_address:
          $ref: '#/components/schemas/delivery_address'
        delivery_price:
          $ref: '#/components/schemas/base_price'
        courier_note:
          type: string
          description: additional information for courier
    delivery_address:
      type: object
      description: delivery address
      required:
        - name
        - country_code
        - address
        - city
        - postal_code
      properties:
        name:
          type: string
          description:  name
        country_code:
          type: string
          description: country code
        address:
          type: string
          description:  address
        city:
          type: string
          description: city
        postal_code:
          type: string
          description: postal code
    client_address:
      type: object
      description: delivery address
      required:
        - country_code
        - address
        - city
        - postal_code
      properties:
        country_code:
          type: string
          description: country code
        address:
          type: string
          description:  address
        city:
          type: string
          description: city
        postal_code:
          type: string
          description: postal code
    delivery_basket_response:
      type: object
      required:
        - delivery_type
        - delivery_date
        - delivery_price
      properties:
        delivery_type:
          type: string
          description: delivery type (APM; COURIER)
          enum:
            - APM
            - COURIER
        delivery_date:
          type: string
          format: date-time
          description: delivery date
        delivery_options:
          type: array
          description: delivery options
          items:
            $ref: '#/components/schemas/delivery_options'
        delivery_price:
          $ref: '#/components/schemas/base_price'
        free_delivery_minimum_gross_price:
          type: number
          format: decimal
          description: free delivery minimum gross price          
    delivery_options:
      type: object
      description: promoadditional delivery codesoptions
      required:
        - delivery_name
        - delivery_code_value
        - delivery_option_price
      properties:
        delivery_name:
          type: string
          description: delivery name
          example: Paczka w Weekend
        delivery_code_value:
          type: string
          enum:
          - COD
          - PWW
          description: delivery code value. COD - option with payment on delivery, PWW - option with weekend delivery
          example: PWW
        delivery_option_price:
          $ref: '#/components/schemas/base_price'
    basket_summary:
      type: object
      required:
        - basket_base_price
        - currency
        - payment_type
      properties:
        basket_base_price:
          $ref: '#/components/schemas/base_price'
        basket_final_price:
          $ref: '#/components/schemas/base_price'
        basket_promo_price:
          $ref: '#/components/schemas/base_price'
        currency:
          type: string
          description: basket currency
          enum:
            - PLN
        basket_expiration_date:
          type: string
          format: date-time
          description: expiry date of basket
        basket_additional_information:
          type: string
          description: additional information
        payment_type:
          type: array
          description: payment type
          items:
            $ref: '#/components/schemas/payment_type'
        basket_notice:
          $ref: '#/components/schemas/information'
    payment_type:
      type: string
      description: payment type
      enum:
        - CARD
        - CARD_TOKEN
        - GOOGLE_PAY
        - APPLE_PAY
        - BLIK_CODE
        - BLIK_TOKEN
        - PAY_BY_LINK
        - SHOPPING_LIMIT
        - DEFERRED_PAYMENT
        - CASH_ON_DELIVERY
    invoice_details:
      type: object
      description: invoice details
      properties:
        legal_form:
          type: string
          description: legal form of customer
          enum:
            - PERSON
            - COMPANY
        country_code:
          type: string
          description: country code
        tax_id_prefix:
          type: string
          description: tax id prefix
        tax_id:
          type: string
          description: tax id
        company_name:
          type: string
          description: company name
        name:
          type: string
          description: name
        surname:
          type: string
          description: surname
        city:
          type: string
          description: city
        street:
          type: string
          description: street
        building:
          type: string
          description: number building
        flat:
          type: string
          description: number flat
        postal_code:
          type: string
          description: postal code
        mail:
          type: string
          description: email
        registration_data_edited:
          type: string
          description: registration data edited
        additional_information:
          type: string
          description: additional information
    account_info:
      type: object
      required:
        - name
        - surname
        - phone_number
        - client_address
        - mail
      properties:
        name:
          type: string
          description: name
        surname:
          type: string
          description: surname
        phone_number:
          $ref: '#/components/schemas/phone_number'
        mail:
          type: string
          description: email
        client_address:
          $ref: '#/components/schemas/client_address'
    consents_order:
      type: object
      description: consents order list
      required:
        - consent_id
        - is_accepted
      properties:
        consent_id:
          type: string
          description: consent id
        consent_version:
          type: string
          description: consent version
        is_accepted:
          type: boolean
          description: is accepted consent
    orders_list:
      type: object
      description: orders details list
      properties:
        page_size:
          type: integer
          description: page size
        total_items:
          type: integer
          description: total size
        page_index:
          type: integer
          description: page index
        orders:
          type: array
          items:
            $ref: '#/components/schemas/merchant_order_response'
    get_payment:
      required:
        - payment_type
        - payment_status
      properties:
        payment_type:
          type: string
          description: order status
          enum:
            - CARD
            - CARD_TOKEN
            - GOOGLE_PAY
            - APPLE_PAY
            - BLIK_CODE
            - BLIK_TOKEN
            - PAY_BY_LINK
            - SHOPPING_LIMIT
            - DEFERRED_PAYMENT
            - CASH_ON_DELIVERY
        payment_status:
          type: string
          description: payment status. UNPAID - status after creation of order. unpaid (assigned by BasketApp), STARTED - status initiating payment reference process and returning payment type selected by customer (assigned by BasketApp), PENDING - start of process in PEGAZ/SDK with success (assigned by Basket or PEGAZ), AUTHORIZED - payment successfully completed, funds blocked (assigned by PEGAZ), DECLINED - payment refused (assigned by PEGAZ), CANCELLED - payment cancelled (assigned by PEGAZ), ERROR - error (assigned by PEGAZ or INPOST), COD- cash on delivery
          enum:
            - UNPAID
            - STARTED
            - PENDING
            - AUTHORIZED
            - DECLINED
            - CANCELLED
            - ERROR
            - COD
        available_payment_types:
          type: array
          description: available payment types for order
          items:
            $ref: '#/components/schemas/payment_type'
        payment_details:
          $ref: '#/components/schemas/payment_details'
    payment_details:
      type: object
      required:
        - payment_type
        - payment_status
        - payment_reference
      properties:
        payment_reference:
          type: string
          description: payment reference
        payment_id:
          type: string
          description: payment reference
        payment_sec_token:
          type: string
          description: security token used to payment process
        payment_type:
          type: string
          description: order status
          enum:
            - CARD
            - CARD_TOKEN
            - GOOGLE_PAY
            - APPLE_PAY
            - BLIK_CODE
            - BLIK_TOKEN
            - PAY_BY_LINK
            - SHOPPING_LIMIT
            - DEFERRED_PAYMENT
            - CASH_ON_DELIVERY
        payment_token:
          type: string
          description: card token or blik alias
        payment_card:
          $ref: '#/components/schemas/payment_card'
        payment_status:
          type: string
          description: payment status. UNPAID - status after creation of order. unpaid (assigned by BasketApp), STARTED - status initiating payment reference process and returning payment type selected by customer (assigned by BasketApp), PENDING - start of process in PEGAZ/SDK with success (assigned by Basket or PEGAZ), AUTHORIZED - payment successfully completed, funds blocked (assigned by PEGAZ), DECLINED - payment refused (assigned by PEGAZ), CANCELLED - payment cancelled (assigned by PEGAZ), ERROR - error (assigned by PEGAZ or INPOST), COD - cash on delivery
          enum:
            - UNPAID
            - STARTED
            - PENDING
            - AUTHORIZED
            - DECLINED
            - CANCELLED
            - ERROR
            - COD
        payment_code:
          type: string
          description: payment code
        payment_description:
          type: string
          description: payment description
        payment_error_code:
          type: string
          description: payment error code
        payment_message_code:
          type: string
          description: payment error code
        payment_date:
          type: string
          format: date-time
          description: payment date
    delivery_references:
      type: string
      description: delivery references
    promo_codes:
      type: object
      description: promo codes
      required:
        - name
        - promo_code_value
      properties:
        name:
          type: string
          description: promo code name
        promo_code_value:
          type: string
          description: promo code value
    product_attributes:
      type: object
      description: product attributes
      required:
        - attribute_name
        - attribute_value
      properties:
        attribute_name:
          type: string
          description: attribute name
        attribute_value:
          type: string
          description: attribute value
    response_basket_binding:
      type: object
      required:
        - qr_code
        - deep_link
        - deep_link_hms
      properties:
        qr_code:
          type: string
          description: qr-code
        deep_link:
          type: string
          description: deep link
        deep_link_hms:
          type: string
          description: deep link
    response_basket_connected:
      type: object
      required:
        - basket_linked
        - browser_trusted
      properties:
        basket_linked:
          type: boolean
          description: is basket linked
        inpost_basket_id:
          type: string
          description: basket id created by BasketApp
        browser_trusted:
          type: boolean
          description: is browser trusted
        client_details:
          $ref: '#/components/schemas/client_details'
    client_details:
      type: object
      required:
        - phone_number
        - masked_phone_number
        - name
        - surname
      properties:
        phone_number:
          $ref: '#/components/schemas/phone_number'
        masked_phone_number:
          type: string
          description:  masked phone number
          example: 60*****00
        name:
          type: string
          description: client name
        surname:
          type: string
          description:  client surname
    event_data_merchant:
      type: object
      description: Data on events
      properties:
        order_status:
          type: string
          description: order status - Merchant can change order status to; ORDER_COMPLETED - order completed in merchant's shop, ORDER_REJECTED - order rejected by merchant
          enum:
            - ORDER_COMPLETED
            - ORDER_REJECTED
        order_merchant_status_description:
          type: string
          description: order merchant status description
        delivery_references_list:
          type: array
          description: delivery references list
          items:
            $ref: '#/components/schemas/delivery_references'
    base_price:
      required:
        - net
        - gross
        - vat
      properties:
        net:
          type: number
          format: decimal
          description: net price
        gross:
          type: number
          format: decimal
          description: gross price
        vat:
          type: number
          format: decimal
          description: VAT
    quantity:
      type: object
      description: product quantity
      required:
        - quantity
      properties:
        quantity:
          type: number
          description: product quantity
        quantity_type:
          type: string
          enum:
            - DECIMAL
            - INTEGER
          description: product quantity type
        quantity_unit:
          type: string
          description: unit quantity
        available_quantity:
          type: number
          format: decimal
          description: product quantity available
        max_quantity:
          type: number
          format: decimal
          description: maximum product quantity
    quantity_order:
      type: object
      description: product quantity
      required:
        - quantity
      properties:
        quantity:
          type: number
          description: product quantity
        quantity_type:
          type: string
          enum:
            - DECIMAL
            - INTEGER
          description: product quantity type
        quantity_unit:
          type: string
          description: unit quantity
    phone_number:
      type: object
      description: phone number
      required:
        - country_prefix
        - phone
      properties:
        country_prefix:
          type: string
          description: prefix
          example: '+48'
        phone:
          type: string
          example: 600123123
    request_basket_binding:
      allOf:
        - type: object
          required:
            - browser
          properties:
            binding_method:
              type: string
              enum:
                - PHONE
                - DEEP_LINK
              description: binding method
            binding_place:
              type: string
              enum:
                - PRODUCT_CARD
                - BASKET_SUMMARY
                - ORDER_CREATE
                - BASKET_POPUP
                - THANK_YOU_PAGE
              description: client binding place
            phone_number:
              $ref: '#/components/schemas/phone_number'
            browser:
              $ref: '#/components/schemas/browser_details'
    browser_details:
      type: object
      description: browser details
      required:
        - browser_id
        - user_agent
        - platform
        - architecture
        - data_time
        - location
        - customer_ip
        - port
      properties:
        user_agent:
          type: string
          description: user agent
        description:
          type: string
          description: additional description
        platform:
          type: string
          description: platform
        architecture:
          type: string
          description: architecture
        data_time:
          type: string
          format: date-time
          description: tiem
        location:
          type: string
          description: location
        customer_ip:
          type: string
          description: browser id
        port:
          type: string
          description: port
    merchant_order_response:
      type: object
      required:
        - order_details
        - account_info
        - delivery
        - products
        - consents
      properties:
        order_details:
          $ref: '#/components/schemas/merchant_orders_details'
        account_info:
          $ref: '#/components/schemas/account_info'
        invoice_details:
          $ref: '#/components/schemas/invoice_details'
        delivery:
          $ref: '#/components/schemas/delivery'
        products:
          type: array
          description: products order list
          items:
            $ref: '#/components/schemas/get_products_order'
        consents:
          type: array
          description: consents list
          items:
            $ref: '#/components/schemas/consents_order'
    merchant_orders_details:
      type: object
      required:
        - order_id
        - merchant_order_id
        - pos_id
        - order_creation_date
        - merchant_id
        - basket_hash
        - payment_status
        - order_status
        - order_merchant_status_description
        - order_base_price
        - order_final_price
        - currency
      properties:
        order_comments:
          type: string
          description: order information
        order_id:
          type: string
          description: ID order assigned by merchant
        pos_id:
          type: string
          description: POS identifier provided by Vodeno, allowing merchant to filter payments in the reporting tools
        order_creation_date:
          type: string
          format: date-time
          description: order creation date
        order_update_date:
          type: string
          format: date-time
          description: order update date
        payment:
          $ref: '#/components/schemas/get_payment'
        order_status:
          type: string
          description: order status. ORDER_PROCESSING - status given by Basket App when order is created, payment possible ORDER_COMPLETED - order completed at merchant, payment not possible, ORDER_REJECTED - order rejected by merchant or at Inpost app, payment not possible.
          enum:
            - ORDER_COMPLETED
            - ORDER_REJECTED
            - ORDER_PROCESSING
        order_merchant_status_description:
          type: string
          description: order merchant status description
        order_base_price:
          type: object
          description: price for order without delivery costs
          required:
            - net
            - gross
            - vat
          properties:
            net:
              type: number
              format: decimal
              description: net price
            gross:
              type: number
              format: decimal
              description: gross price
            vat:
              type: number
              format: decimal
              description: VAT
        order_final_price:
          type: object
          description: total order price with delivery costs
          required:
            - net
            - gross
            - vat
          properties:
            net:
              type: number
              format: decimal
              description: net price
            gross:
              type: number
              format: decimal
              description: gross price
            vat:
              type: number
              format: decimal
              description: VAT
        currency:
          type: string
          description: basket currency
          enum:
            - PLN
        delivery_references_list:
          type: array
          description: delivery references list
          items:
            $ref: '#/components/schemas/delivery_references'
    merchant_basket_details:
      type: object
      required:
        - summary
        - delivery
        - products
        - consents
      properties:
        basket_id:
          type: string
          description: ID basket assigned by merchant
        creation_date:
          type: string
          format: date-time
          description: date basket creation
        update_date:
          type: string
          format: date-time
          description: date basket update
        summary:
          $ref: '#/components/schemas/basket_summary'
        delivery:
          type: array
          description: delivery list
          items:
            $ref: '#/components/schemas/delivery_basket_response'
        promo_codes:
          type: array
          description: promo codes
          items:
            $ref: '#/components/schemas/promo_codes'
        products:
          type: array
          description: products order list
          items:
            $ref: '#/components/schemas/get_products'
        related_products:
          type: array
          description: related product information
          items:
            $ref: '#/components/schemas/get_products'
        consents:
          type: array
          description: consents list
          items:
            $ref: '#/components/schemas/consents'
    information:
      type: object
      required:
        - type
        - description
      properties:
        type:
          type: string
          enum:
            - ATTENTION
            - ERROR
          description: type additional notice
        description:
          type: string
          description: basket additional notice
    payment_card:
      type: object
      required:
        - type
        - description
      properties:
        last_four_digits:
          type: string
          description: Last 4 digits of original PAN (card number)
        scheme:
          type: string
          description: Scheme in which the card operates
        card_type:
          type: string
          enum:
            - DEBIT
            - CREDIT
            - PREPAID
            - CHARGE
            - DEFERRED_DEBIT
          description: Scheme in which the card operates
    response_signing_keys:
      type: object
      properties:
        merchant_external_id:
          type: string
          description: merchant external id
        public_keys:
          type: array
          description: public keys
          items:
            $ref: '#/components/schemas/public_key'
    public_key:
      type: object
      required:
        - type
        - description
      properties:
        public_key_base64:
          type: string
          description: public key in format base64
        version:
          type: string
          description: version
    response_version_signing_keys:
      type: object
      properties:
        merchant_external_id:
          type: string
          description: merchant external id
        public_key:
          properties:
            public_key_base64:
              type: string
              description: public key in format base64
            version:
              type: string
              description: version
    response_put_basket:
      type: object
      required:
        - inpost_basket_id
      properties:
        inpost_basket_id:
          type: string
          description: basket id created by BasketApp