Versions Compared

Key

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


InPost Pay (Basket App) - jest to moduł udostępniający API, pozwalający na wymianę informacji o koszyku i realizacji zamówienia. W tej sekcji znajdziesz informacje o metodach API udostępnionych przez InPost służących do komunikacji pomiędzy Merchantem a InPost Pay.

Na tej stronie

Table of Contents

InPost Pay API

Środowisko produkcyjne

Adres środowiska produkcyjnego:https://api.inpost.pl

Środowisko sandbox

Adres środowiska testowego: https://sandbox-api.inpost.pl

Lista endpointów

Poniższa tabel przedstawia listę endpointów wystawionych przez aplikacje InPost Pay, służących do komunikacji pomiędzy Merchantem a aplikacją InPost Pay.

Metoda

Opis

Przeglądarka

DELETE /v1/izi/browser/{browser_id}/binding

Metoda usuwa powiązaną przeglądarkę lub usuwa telefon z powiązanej przeglądarki.

Koszyk

PUT /v1/izi/basket/{basket_id}

Metoda aktualizuje lub tworzy koszyk, np. zmienia ilość produktów, typ dostawy itp

DELETE /v1/izi/basket/{basket_id}/binding

Desynchronizacja koszyka z numerem telefonu

POST /v1/izi/basket/{basket_id}/binding

Metoda łączy koszyk z aplikacją InPost

GET /v1/izi/basket/{basket_id}/binding

Metoda sprawdza, czy koszyk jest połączony z aplikacją InPost

GET /v1/izi/baskets

Opcjonalny endpoint back office'owy, zwraca listę koszyków dla Merchanta

Zamówienie

POST /v1/izi/order/{order_id}/event

Aktualizacja zamówienia

GET /v1/izi/orders

Opcjonalny endpoint back office'owy, zwraca listę zamówień dla Merchanta

Płatności

GET /v1/izi/payments

Zwraca metody płatności dostępne dla Merchanta - metoda dostępna w kolejnej wersji aplikacji

Weryfikacja sygnatury

GET /v1/izi/signing-keys/public

Zwraca publiczne klucze podpisujące

GET /v1/izi/signing-keys/public/{version}

Zwraca publiczny klucz podpisujący dla wersji


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

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: Payment
    description: Payment  
  - 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: Information Bindingabout basket bound with InPost Pay and InPosttrusted appbrowser.
      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/v1/izi/payments:
    merchantDisabledErrorget:
      valuetags:
        error_code: MERCHANT_DISABLE- Payment
      summary: Returns error_message: 'Merchant with given id is DISABLED'
      summary: MERCHANT_DISABLEreturns available payment types for merchant - method available in next version of app
       description: Service is temporarily disabled, because of to many incorrect requests or manual blockade Returns returns available payment types for merchant - method available in next version of app
      basketBoundErroroperationId: paymentsTypes
      valueresponses:
        error_code"200":
BASKET_IS_BINDED          error_messagedescription: 'BasketGet alreadylist bound'of orders
     summary: BASKET_IS_BINDED    content:
   description:  Basket already bound.     basketExpiredapplication/json:
      value:         error_codeschema:
BASKET_EXPIRED         error_message: 'Basket expired'     $ref:  summary: BASKET_EXPIRED'#/components/schemas/responseGetPayments'
        description"401":
Basket expired and will be removed soon.     basketNotBoundErrorcontent:
      value:         error_codeapplication/json:
BASKET_NOT_BOUND         error_message: 'Basket not bound'  example:
    summary: BASKET_NOT_BOUND       description: Basket not bound. error_code: UNAUTHORIZED
  bindingRedundantPhoneError:       value:
        error_codemessage: ERROR_VALIDATION_PHONE_NUMBER
        error_message: 'Phone number required for PHONE binding method only'Given user is not authorized to access the resource.
               summaryschema:
ERROR_VALIDATION_PHONE_NUMBER       description: Phone number should not be passed for binding methods other than PHONE.$ref: '#/components/schemas/error'
      bindingPhoneRequiredError:    description: Unauthorized.
 value:       "403":
 error_code: ERROR_VALIDATION_PHONE_NUMBER_REQUIRED         content:
 error_message: 'Phone number is required'       summary: ERROR_VALIDATION_PHONE_NUMBER_REQUIREDapplication/json:
           description: Phone number isexample:
required for PHONE method binding.     bindingBrowserRequiredError:       valueerror_code: FORBIDDEN
       error_code: ERROR_VALIDATION_BROWSER_REQUIRED         error_message: 'Browser Access to given resource is requiredforbidden for PHONEcurrent bindinguser.
method'       summary: ERROR_VALIDATION_BROWSER_REQUIRED       descriptionschema:
Browser details are required for PHONE binding method     phoneBindingMethodUnavailableError:    $ref: '#/components/schemas/error'
 value:         error_code: PHONE_BINDING_METHOD_UNAVAILABLEdescription: Forbidden. 
        error_message"500":
'Unavailable'       summary: PHONE_BINDING_METHOD_UNAVAILABLE  description: Internal server error
 description: Phone binding method temporarily unavailable for requested number. content:
   orderStatusError:       value:  application/json:
      error_code: STATUS_ORDER_ERROR         error_message: 'Unavailableschema:
                $ref: '#/components/schemas/error'
      summary: STATUS_ORDER_ERROR       descriptionexamples:
Can't  be changed ORDER_COMPLETED     publicKeyNotFound:       valueinternalServerError:
        error_code: PUBLIC_KEY_NOT_FOUND         error_message$ref: 'Public key version {} not found''#/components/examples/internalServerError'
        "409":
  summary: PUBLIC_KEY_NOT_FOUND       description: publicConflict. keyRequest notcannot foundbe handled with the current argumentNotValidError:state of the target resource.
  value:        content:
error_code: BAD_REQUEST         error_message: Invalid request. application/json:
      summary: BAD_REQUEST       descriptionschema:
Request validation error. Error message might optionally contain information about constraint violations.     malformedRequest$ref: '#/components/schemas/error'
     value:         error_codeexamples:
 MALFORMED_REQUEST         error_message: Request not readable.   merchantDisabledError:
   summary: MALFORMED_REQUEST       description: The server was not able to read the request.       $ref: '#/components/examples/merchantDisabledError'                  
components:
  examples:
    notFoundmerchantDisabledError:
      value:
        error_code: NOTMERCHANT_FOUNDDISABLE
        error_message: Resource not found.'Merchant with given id is DISABLED'
      summary: NOTMERCHANT_FOUNDDISABLE
      description: Service Theis servertemporarily wasdisabled, notbecause ableof to read the request. many incorrect requests or manual blockade
    basketNotFoundbasketBoundError:
      value:
        error_code: BASKET_NOTIS_FOUNDBINDED
        error_message: 'Basket notalready found.bound'
      summary: BASKET_NOTIS_FOUNDBINDED
      description: Basket notalready foundbound.
    orderNotFoundbasketExpired:
      value:
        error_code: ORDERBASKET_NOT_FOUNDEXPIRED
        error_message: Order not found.'Basket expired'
      summary: ORDERBASKET_NOT_FOUNDEXPIRED
      description: Order not found Basket expired and will be removed soon.
    browserNotFoundbasketNotBoundError:
      value:
        error_code: BROWSERBASKET_NOT_FOUNDBOUND
        error_message: Browser'Basket not foundbound'
      summary: BROWSERBASKET_NOT_FOUNDBOUND
      description: BrowserBasket not found bound.
    internalServerErrorbindingRedundantPhoneError:
      value:
        error_code: INTERNALERROR_VALIDATION_SERVERPHONE_ERRORNUMBER
        error_message: Something'Phone wentnumber wrong. Please try again later.required for PHONE binding method only'
      summary: INTERNALERROR_VALIDATION_SERVERPHONE_ERRORNUMBER
      description: The server encountered unexpected error.
  schemas: Phone number should not be passed for binding methods other than PHONE.
    errorbindingPhoneRequiredError:
      requiredvalue:
         - errorCodeerror_code: ERROR_VALIDATION_PHONE_NUMBER_REQUIRED
        typeerror_message: object'Phone number is required'
   properties:   summary: ERROR_VALIDATION_PHONE_NUMBER_REQUIRED
    error_code:  description: Phone number is required for PHONE method binding.
type: string   bindingBrowserRequiredError:
      value:
description: Code that indicates the nature of an error._code: ERROR_VALIDATION_BROWSER_REQUIRED
        error_message: 'Browser is required for PHONE binding method'
   type: string    summary: ERROR_VALIDATION_BROWSER_REQUIRED
      description: AdditionalBrowser informationdetails whichare mayrequired befor useful.PHONE     merchant_baskets:binding method
      typephoneBindingMethodUnavailableError:
object       propertiesvalue:
        pageerror_sizecode: PHONE_BINDING_METHOD_UNAVAILABLE
         typeerror_message: integer'Unavailable'
      summary: PHONE_BINDING_METHOD_UNAVAILABLE
  description: page size  description: Phone binding method temporarily unavailable for total_items:
requested number.
    orderStatusError:
    type: integer value:
         descriptionerror_code: totalSTATUS_ORDER_ERROR
items         pageerror_indexmessage: 'Unavailable'
      summary: STATUS_ORDER_ERROR
 type: integer    description: Can't be changed    description: page index
 ORDER_COMPLETED
    publicKeyNotFound:
      basketsvalue:
          typeerror_code: arrayPUBLIC_KEY_NOT_FOUND
          descriptionerror_message: baskets'Public listkey version {} not found'
      itemssummary: PUBLIC_KEY_NOT_FOUND
      description: public key not found
$ref: '#/components/schemas/merchant_basket_details'     request_order_event_merchantargumentNotValidError:
      typevalue:
 object       requirederror_code: BAD_REQUEST
       - eventerror_idmessage: Invalid request.
      -summary: eventBAD_data_timeREQUEST
      description: Request - event_data
      properties:
validation error. Error message might optionally contain information about constraint violations.
    malformedRequest:
  event_id:    value:
      type: string error_code: MALFORMED_REQUEST
        descriptionerror_message: eventRequest idnot readable.
      summary: event_data_time:MALFORMED_REQUEST
      description: The server was type:not stringable to read the request.
      descriptionnotFound: event
date time         phone_numbervalue:
          $ref: '#/components/schemas/phone_number'error_code: NOT_FOUND
        eventerror_datamessage: Resource not found.
       $refsummary: '#/components/schemas/event_data_merchant'NOT_FOUND
      basket_request_putdescription: The server was not able to type:read objectthe request.
     requiredbasketNotFound:
      value:
 - summary      error_code: BASKET_NOT_FOUND
 - delivery      error_message: Basket not -found.
products      summary: BASKET_NOT_FOUND
 - consents    description: Basket  propertiesnot found.
    orderNotFound:
      value:
        browsererror_idcode: ORDER_NOT_FOUND
        error_message: Order not found.
  type: string   summary: ORDER_NOT_FOUND
      description: browserOrder idnot found.
    browserNotFound:
  summary:    value:
      $ref: '#/components/schemas/basket_summary'  error_code: BROWSER_NOT_FOUND
        deliveryerror_message: Browser not found
       typesummary: arrayBROWSER_NOT_FOUND
          description: deliveryBrowser listnot found .
    internalServerError:
   items:   value:
         $referror_code: '#/components/schemas/delivery_basket_response'INTERNAL_SERVER_ERROR
        promoerror_codesmessage: Something went wrong. Please try again later.
   type: array    summary: INTERNAL_SERVER_ERROR
      description: promoThe codesserver encountered unexpected error.
  schemas:
    itemserror:
      required:
      $ref: '#/components/schemas/promo_codes'
  - errorCode
      productstype: object
      properties:
  type: array     error_code:
     description: products order list  type: string
       items:   description: Code that indicates the nature of an error.
 $ref: '#/components/schemas/get_products'         relatederror_productsmessage:
          type: arraystring
          description: related productAdditional information which may be useful.
    merchant_baskets:
 items:     type: object
      $refproperties:
'#/components/schemas/get_products'         consentspage_size:
          type: arrayinteger
          description: consentspage listsize
          total_items:
          type: integer
$ref: '#/components/schemas/consents'     get_products:    description: total items
type: object       requiredpage_index:
        - product_id type: integer
      - product_name   description: page index
   - base_price    baskets:
    - quantity     type: array
properties:          product_id:description: baskets list
          typeitems:
 string           description$ref: product id'#/components/schemas/merchant_basket_details'
    request_order_event_merchant:
    product_category:  type: object
       typerequired:
string        - event_id
 description: product category     - event_data_time
  ean:      - event_data
   type: string           description: ean codeproperties:
         productevent_nameid:
          type: string
          description: productevent nameid
        productevent_data_descriptiontime:
          type: string
          description: productevent date descriptiontime
        productphone_linknumber:
          type$ref: string'#/components/schemas/phone_number'
        event_data:
 description: product link         product_image:$ref: '#/components/schemas/event_data_merchant'
    basket_request_put:
      type: stringobject
      required:
   description: product image   - summary
    base_price:    - delivery
     $ref: '#/components/schemas/base_price'  - products
     promo_price:   - consents
      $ref: '#/components/schemas/base_price'properties:
        lowestbrowser_priceid:
          $reftype: '#/components/schemas/base_price' string
          quantitydescription: browser id
        $refsummary: '#
          $ref: '#/components/schemas/quantitybasket_summary'
        product_attributesdelivery:
          type: array
          description: productdelivery attributeslist
          items:
            $ref: '#/components/schemas/productdelivery_basket_attributesresponse'
        variantspromo_codes:
          type: array
          description: variant product ordered listpromo codes
          items:
            $ref: '#/components/schemas/variantspromo_codes'
    get_products_order:    products:
  type: object       requiredtype: array
       - product_id  description: products order list
   - product_name      items:
  - base_price         - quantity
$ref: '#/components/schemas/get_products'
     properties:         product_idrelated_products:
          type: stringarray
          description: related product idinformation
          product_categoryitems:
          type: string $ref: '#/components/schemas/get_related_products'
        descriptionconsents:
product category         eantype: array
          typedescription: stringconsents list
          descriptionitems:
 ean  code         product_name$ref: '#/components/schemas/consents'
         typemerchant_store:
string           descriptiontype: object
 product name         product_descriptionrequired:
          type: string  - url
       description: product description    - cookies
   product_link:        properties:
  type: string           descriptionurl:
product link         product_image:    type: string
     type: string        description: Url of description:the productmerchant imageshop or direct address to cart
   base_price:           $refexample: '#/components/schemas/base_price'"https://uat.outofthebox.pl/cart/"
            lowest_price:cookies:
              $ref: '#/components/schemas/base_price'type: array
              quantityitems:
                $ref: '#/components/schemas/quantity_order'cookies'            
    productget_attributesproducts:
      type: object
      type: array
 required:
        - product_id
        description:- product_name
  attributes      - base_price
   items:     - quantity
      $ref: '#/components/schemas/product_attributes'properties:
        variantsproduct_id:
          type: arraystring
          description: variant product orderedid
list           itemsproduct_category:
            $reftype: '#/components/schemas/variants'string
    variants:
      type: object       description: variant product orderedcategory
      required:  ean:
      - variant_id   type: string
    - variant_name     description: ean properties:code
        variantproduct_idname:
          type: string
          description: variantproduct idname
        variantproduct_namedescription:
          type: string
          description: variantproduct namedescription
        variantproduct_descriptionlink:
          type: string
          description: variantproduct descriptionlink
        variantproduct_typeimage:
          type: string
          description: variantproduct typeimage
        variantadditional_product_valuesimages:
          type: stringarray
          description: variantadditional valuesproduct images. Object available in consents:next version app
    type: object       descriptionitems:
Consents list       required:   $ref: '#/components/schemas/product_images'     - consent_id     
   - consent_description    base_price:
    - requirement_type     $ref: '#/components/schemas/base_price'
  - consent_link      promo_price:
  - consent_version       properties:$ref: '#/components/schemas/base_price'
        consentlowest_idprice:
          type$ref: string'#/components/schemas/base_price'
          descriptionquantity:
consent id         consent_link$ref: '#/components/schemas/quantity'
         typeproduct_attributes:
string          type: description:array
consent link         consent_description: product attributes
          typeitems:
 string           description$ref: consent description'#/components/schemas/product_attributes'
         consent_versionvariants:
          type: stringarray
          description: consent versionvariant product ordered list
          requirement_typeitems:
            type$ref: string'#/components/schemas/variants'
        delivery_product:
 enum:         type: array
  - OPTIONAL       description: additional delivery information for product - REQUIRED_ONCE
    object for use in next version app
        - REQUIRED_ALWAYS items:
         description: information on requirement consent$ref: '#/components/schemas/delivery_product'
    deliveryget_related_products:
      type: object
      descriptionrequired:
 delivery information      - required:product_id
        - deliveryproduct_typename
        - deliverybase_price
        - delivery_datequantity
      properties:
        deliveryproduct_typeid:
          type: string
          enumdescription: product id
        product_category:
 - APM        type: string
   -   COURIER    description: product category
    description:   delivery typeean:
(APM; COURIER)         delivery_datetype: string
          description: delivery date ean code
        product_name:
          type: string
          formatdescription: product date-timename
        deliveryproduct_optionsdescription:
          type: arraystring
          description: delivery options product description
        product_link:
          itemstype: string
          description: $ref: '#/components/schemas/delivery_options'product link
        mailproduct_image:
          type: string
          description: emailproduct image
        phoneadditional_product_numberimages:
          $reftype: '#/components/schemas/phone_number' array
          delivery_point:
     description: additional product images. Object available in next version app
    type      items:
string           description: APM delivery point$ref: '#/components/schemas/product_images'           
        deliverybase_addressprice:
          $ref: '#/components/schemas/deliverybase_addressprice'
        deliverypromo_price:
          $ref: '#/components/schemas/base_price'
        courierlowest_noteprice:
          type$ref: string'#/components/schemas/base_price'
        quantity:
 description: additional information for courier     delivery_address:$ref: '#/components/schemas/quantity'
        typeproduct_attributes:
  object        descriptiontype: deliveryarray
address       required:   description: product attributes
   - name      items:
  - country_code         - address$ref: '#/components/schemas/product_attributes'
        -variants:
city         - postal_codetype: array
     properties:     description: variant product ordered name:list
          typeitems:
string            description$ref:  name'#/components/schemas/variants'
        countrydelivery_related_codeproducts:
          type: stringarray
          description: additional delivery countryinformation codefor product - object for use in next version address:app
          typeitems:
string            description:$ref: '#/components/schemas/delivery_related_products'   address         
city:    get_products_order:
      type: stringobject
      required:
   description: city    - product_id
   postal_code:     - product_name
    type: string   - base_price
      description: postal code- quantity
   client_address:   properties:
   type: object    product_id:
  description: delivery address      type: required:string
        - country_code description: product id
     - address  product_category:
      - city   type: string
    - postal_code     description: product properties:category
        country_codeean:
          type: string
          description: countryean code
        addressproduct_name:
          type: string
          description: product addressname
        cityproduct_description:
          type: string
          description: product citydescription
        postalproduct_codelink:
          type: string
          description: postalproduct codelink
    delivery_basket_response:    product_image:
  type: object       requiredtype: string
       - delivery_type  description: product image
    - delivery_date   additional_product_images:
     - delivery_price    type: array
 properties:         delivery_typedescription: additional product images. Object available in next version   type:app
string           description: delivery type (APM; COURIER)items:
           enum$ref:   '#/components/schemas/product_images'          -
APM        base_price:
    - COURIER     $ref: '#/components/schemas/base_price'
    delivery_date    lowest_price:
          type$ref: string'#/components/schemas/base_price'
          format: date-timequantity:
          description$ref: delivery date'#/components/schemas/quantity_order'
         deliveryproduct_optionsattributes:
          type: array
          description: deliveryproduct optionsattributes
          items:
            $ref: '#/components/schemas/deliveryproduct_optionsattributes'
        delivery_pricevariants:
          $reftype: '#/components/schemas/base_price' array
          free_delivery_minimum_gross_pricedescription: variant product ordered list
      type    items:
number            format: decimal$ref: '#/components/schemas/variants'
    variants:
      descriptiontype: freeobject
delivery minimum gross price   description: variant product ordered
      required:
 delivery_options:       type: object- variant_id
      description: additional delivery- optionsvariant_name
      requiredproperties:
        - delivery_name
 variant_id:
      - delivery_code_value   type: string
    - delivery_option_price     description: variant properties:id
        deliveryvariant_name:
          type: string
          description: deliveryvariant name
          examplevariant_description:
Paczka w Weekend         delivery_code_value:type: string
          typedescription: stringvariant description
         enumvariant_type:
          -type: CODstring
          -description: PWWvariant type
         descriptionvariant_values:
delivery code value. COD - option with payment on delivery, PWWtype: -string
option with weekend delivery       description: variant values
 example: PWW  consents:
      delivery_option_pricetype: object
      description: Consents list
$ref: '#/components/schemas/base_price'     basket_summaryrequired:
      type: object  - consent_id
        - required:consent_description
        - basketconsent_base_priceversion
        - currencyrequirement_type
        - paymentconsent_typelink
      properties:
        basketconsent_base_priceid:
          $reftype: '#/components/schemas/base_price' string
          basket_final_pricedescription: consent id
        $refconsent_link: '#/components/schemas/base_price'
          basket_promo_price:type: string
          $refdescription: '#/components/schemas/base_price' consent link
        currencylabel_link:
          type: string
          description: label basketlink currencypresented in app
        enumadditional_consent_links:
          type: array
- PLN         basket_expiration_datedescription: Object to additional links on consents. Available in next version type:of stringapp
          formatitems:
 date-time           description$ref: expiry date of basket'#/components/schemas/additional_consent_links'
          basket_additional_informationconsent_description:
          type: string
          description: additionalconsent informationdescription
        paymentconsent_typeversion:
          type: arraystring
          description: paymentconsent typeversion
          itemsrequirement_type:
          type: string
$ref: '#/components/schemas/payment_type'         basket_noticeenum:
          $ref: '#/components/schemas/information'
  - OPTIONAL
   payment_type:       type: string - REQUIRED_ONCE
    description: payment type      - enum:REQUIRED_ALWAYS
        - CARD description: information on requirement consent
   - CARD_TOKENadditional_consent_links:
      type: object
- GOOGLE_PAY     required:
   - APPLE_PAY    - consent_id
        - BLIK_CODE consent_link
      properties:
        consent_id:
          type: string
          description: consent id
        consent_link:
          type: string
          description: consent link
        label_link:
          type: string
          description: label link presented in app
    delivery:
      type: object
      description: delivery information
      required:
        - BLIK_TOKEN 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: additional delivery options
      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
          - PAY_BY_LINK - AUTHORIZED
      - SHOPPING_LIMIT     - DECLINED
  - DEFERRED_PAYMENT         - CASH_ON_DELIVERY
CANCELLED
   invoice_details:       type: object - ERROR
    description: invoice details      - properties:COD
        legalavailable_payment_formtypes:
          type: stringarray
          description: legalavailable payment formtypes offor customerorder
          enumitems:
            - PERSON$ref: '#/components/schemas/payment_type'
        payment_details:
   - COMPANY      $ref: '#/components/schemas/payment_details'
 country_code:    payment_details:
      type: stringobject
      required:
   description: country code   - payment_type
    tax_id_prefix:    - payment_status
     type: string  - payment_reference
       description: tax id prefixproperties:
         taxpayment_idreference:
          type: string
          description: taxpayment idreference
        companypayment_nameid:
          type: string
          description: companypayment namereference
        namepayment_sec_token:
          type: string
          description: namesecurity token        surname:
          type: string
 used to payment process
        descriptionpayment_type:
surname          citytype: string
         type description: order stringstatus
          descriptionenum:
city         street:   - CARD
      type:  string    - CARD_TOKEN
     description: street      - GOOGLE_PAY
 building:           type: string- APPLE_PAY
          description: number building- BLIK_CODE
       flat:     - BLIK_TOKEN
    type: string       - PAY_BY_LINK
  description: number flat        - postal_code:SHOPPING_LIMIT
            - type:DEFERRED_PAYMENT
string           description: postal code- CASH_ON_DELIVERY
        mailpayment_token:
          type: string
          description: emailcard token or blik  alias
   registration_data_edited:           typepayment_card:
string           description$ref: registration data edited'#/components/schemas/payment_card'
          additionalpayment_informationstatus:
          type: string
          description: additionalpayment informationstatus. UNPAID - status after account_info:creation of order. unpaid (assigned by BasketApp), type:STARTED object- status initiating payment    required:
        - name
        - surname
        - phone_number
        - client_address
        - mail
      properties:
        name: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
           typeenum:
string           description: name- UNPAID
       surname:     - STARTED
    type: string       - PENDING
  description: surname         phone_number:- AUTHORIZED
         $ref: '#/components/schemas/phone_number'  - DECLINED
     mail:       - CANCELLED
  type: string         - ERROR
description: email         client_address:  - COD
       $ref: '#/components/schemas/client_address' payment_code:
    consents_order:       type: string
  object        description: payment consentscode
order list       requiredpayment_description:
 
      - consent_id   type: string
    - is_accepted     description: payment properties:description
        consentpayment_error_idcode:
          type: string
          description: consentpayment error idcode
        consentpayment_message_versioncode:
          type: string
          description: payment consenterror versioncode
        ispayment_accepteddate:
          type: booleanstring
          descriptionformat: is accepted consent date-time
          orders_listdescription: payment date
    typedelivery_references:
object       descriptiontype: orders detailsstring
list       propertiesdescription: delivery references
      pagepromo_sizecodes:
   
      type: integer
object
         description: pagepromo sizecodes
      required:
 total_items:       - name
  type: integer     - promo_code_value
    description: total sizeproperties:
        page_indexname:
          type: integerstring
          description: promo pagecode indexname
        orderspromo_code_value:
          type: arraystring
          itemsdescription: promo code value
    product_attributes:
      $reftype: '#/components/schemas/merchant_order_response' object
      get_payment:description: product attributes
      required:
        - paymentattribute_typename
        - paymentattribute_statusvalue
      properties:
        paymentattribute_typename:
          type: string
          description: orderattribute statusname
        attribute_value:
 enum:         type: string
  - CARD       description: attribute value
   - CARD_TOKENresponse_basket_binding:
      type: object
      required:
- GOOGLE_PAY       - qr_code
    - APPLE_PAY   - deep_link
        - BLIK_CODEdeep_link_hms
      properties:
       - BLIKqr_TOKENcode:
          type: string
 - PAY_BY_LINK        description: qr-code
   - SHOPPING_LIMIT    deep_link:
        - DEFERRED_PAYMENT type: string
          - CASH_ON_DELIVERYdescription: deep link
        paymentdeep_link_statushms:
          type: string
          description: deep link
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
  response_basket_connected:
      type: object
      required:
        - basket_linked
        - browser_trusted
      properties:
        basket_linked:
          type: boolean
          description: is basket linked
        enuminpost_basket_id:
          type: string
- UNPAID         description: basket id created -by STARTEDBasketApp
        browser_trusted:
   - PENDING      type: boolean
     - AUTHORIZED    description: is browser trusted
     - DECLINED  client_details:
          - CANCELLED$ref: '#/components/schemas/client_details'
    client_details:
      type: object
 - ERROR    required:
        - phone_number
COD        - availablemasked_paymentphone_types:number
        - name
type: array       - surname
  description: available payment types forproperties:
order           items:
 phone_number:
          $ref: '#/components/schemas/paymentphone_typenumber'
        paymentmasked_phone_detailsnumber:
          $ref: '#/components/schemas/payment_details'
type: string
   payment_details:       typedescription: object masked phone number
   required:       example: 60*****00
 -   payment_type    name:
    - payment_status     type: string
  - payment_reference       propertiesdescription: client name
        payment_referencesurname:
          type: string
          description: payment referenceclient surname
       payment_idevent_data_merchant:
      type: object
  type: string   description: Data on events
    description: payment referenceproperties:
        paymentorder_sec_tokenstatus:
          type: string
          description: security token used to payment process
        payment_type: order status - Merchant can change order status to; ORDER_COMPLETED - order completed in merchant's shop, ORDER_REJECTED - order rejected by merchant
          typeenum:
     string       - ORDER_COMPLETED
  description:  order status       - ORDER_REJECTED
  enum:      order_merchant_status_description:
      - CARD   type: string
        - CARD_TOKEN description: order merchant status description
       - GOOGLE_PAYdelivery_references_list:
          type: array
- APPLE_PAY         description: delivery references list
- BLIK_CODE         items:
   - BLIK_TOKEN        $ref: '#/components/schemas/delivery_references'
   - PAY_BY_LINKbase_price:
      required:
        - SHOPPING_LIMITnet
        -  gross
 - DEFERRED_PAYMENT      - vat
     - CASH_ON_DELIVERY properties:
        payment_tokennet:
          type: stringnumber
          descriptionformat: carddecimal
token or blik alias         payment_carddescription: net price
        $refgross:
'#/components/schemas/payment_card'          payment_statustype: number
         type format: stringdecimal
          description: paymentgross status.price
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 vat:
          type: number
          format: decimal
          description: VAT
    quantity:
      type: object
      description: product quantity
      required:
        - quantity
  enum:    properties:
        -quantity:
UNPAID          type: number
 - STARTED        description: product quantity
  - PENDING     quantity_type:
       - AUTHORIZED  type: string
         - DECLINEDenum:
            - CANCELLEDDECIMAL
            - ERRORINTEGER
          description: product -quantity CODtype
        paymentquantity_codeunit:
          type: string
          description: paymentunit codequantity
        paymentavailable_descriptionquantity:
          type: stringnumber
          descriptionformat: paymentdecimal
description         payment_error_code:
          type: string
  description: product quantity available
        descriptionmax_quantity:
payment error code         payment_message_code:type: number
          typeformat: stringdecimal
          description: paymentmaximum errorproduct codequantity
        paymentmin_datequantity:
          type: stringnumber
          format: date-timedecimal
          description: paymentminimum dateproduct quantity. Field available in delivery_references:next       type: stringversion app        description: delivery references
    promoquantity_codesorder:
      type: object
      description: promoproduct codesquantity
      required:
        - namequantity
        - promo_code_value
      properties:
        namequantity:
          type: stringnumber
          description: promoproduct codequantity
name         promo_code_valuequantity_type:
          type: string
          description: promo code valueenum:
             product_attributes:- DECIMAL
       type: object    - INTEGER
 description: product attributes       requireddescription: product quantity type
       - attributequantity_nameunit:
        - attribute_value type: string
    properties:      description: unit quantity
attribute_name:    phone_number:
      type: stringobject
      description: phone number
 description: attribute name   required:
     attribute_value:   - country_prefix
      type: string - phone
      properties:
 description: attribute value     responsecountry_basket_bindingprefix:
      type: object   type: string
  required:        description: -prefix
qr_code         - deep_link
example: '+48'
       - deep_link_hms phone:
      properties:    type:  string
  qr_code:        example: 600123123
 type: string  request_basket_binding:
        descriptionallOf:
qr-code        - deep_linktype: object
         type required:
string           description: deep- linkbrowser
        deep_link_hms:  properties:
        type: string   binding_method:
       description: deep link     response_basket_connected:type: string
      type: object       requiredenum:
        - basket_linked       - PHONE
- browser_trusted       properties:        - basketDEEP_linked:LINK
          type: boolean   description: binding method
     description: is basket linked     binding_place:
   inpost_basket_id:           type: string
          description    enum:
basket id created by BasketApp         browser_trusted:   - PRODUCT_CARD
      type: boolean         - BASKET_SUMMARY
description: is browser trusted         client_details:    - ORDER_CREATE
     $ref: '#/components/schemas/client_details'
    client_details:      - type:BASKET_POPUP
object       required:         - phone_number
 THANK_YOU_PAGE
      - masked_phone_number         - name
 LOGIN_PAGE
      - surname       properties:  - CHECKOUT_PAGE
     phone_number:           $ref: '#/components/schemas/phone_number'- REGISTERFORM_PAGE
        masked_phone_number:        - MINICART_PAGE
 type:  string           description: client binding maskedplace
phone number           examplephone_number:
60*****00         name:     $ref: '#/components/schemas/phone_number'
    type: string       browser:
   description: client name         surname$ref: '#/components/schemas/browser_details'
    browser_details:
      type: stringobject
      description: browser details
 description:  client surname  required:
  event_data_merchant:      - type:browser_id
object       description: Data- onuser_agent
events       properties: - platform
      order_status:  - architecture
       type: string- data_time
        - description:location
order status - Merchant can change order status to;- ORDERcustomer_COMPLETEDip
 - order completed in merchant's shop, ORDER_REJECTED - orderport
rejected by merchant    properties:
      enum:  user_agent:
          - ORDER_COMPLETEDtype: string
          description: user -agent
ORDER_REJECTED         order_merchant_status_description:
          type: string
          description: order merchant statusadditional description
        delivery_references_listplatform:
          type: arraystring
          description: deliveryplatform
references list       architecture:
   items:       type: string
    $ref: '#/components/schemas/delivery_references'     base_pricedescription: architecture
     required:   data_time:
     - net    type: string
   - gross      format: date-time
 -  vat       propertiesdescription: tiem
        netlocation:
          type: numberstring
          format: decimaldescription: location
        customer_ip:
          descriptiontype: netstring
 price         grossdescription: browser id
        typeport:
number           formattype: decimalstring
          description: port
gross  price  merchant_order_response:
      vattype: object
      required:
  type: number     - order_details
    format: decimal   - account_info
      description: VAT - delivery
  quantity:      - type:products
object       description: product- quantityconsents
      requiredproperties:
        order_details:
   - quantity       properties:$ref: '#/components/schemas/merchant_orders_details'
        quantityaccount_info:
          type$ref: number'#/components/schemas/account_info'
          descriptioninvoice_details:
product quantity         quantity_type$ref: '#/components/schemas/invoice_details'
         typedelivery:
string           enum$ref: '#/components/schemas/delivery'
        products:
  - DECIMAL       type: array
    - INTEGER     description: products order list
  description: product quantity type      items:
  quantity_unit:           type$ref: string'#/components/schemas/get_products_order'
          descriptionconsents:
unit quantity         available_quantitytype: array
          typedescription: consents numberlist
          formatitems:
decimal            description$ref: product quantity available
        max_quantity:
   '#/components/schemas/consents_order'
    merchant_orders_details:
      type: numberobject
          formatrequired:
decimal        - order_id
 description: maximum product quantity    - quantitymerchant_order:
  _id
   type: object    - pos_id
 description: product quantity       required:- order_creation_date
        - merchant_id
quantity       properties: - basket_hash
      quantity:  - payment_status
       type: number- order_status
        - order_merchant_status_description:
product quantity       -  quantity_type:order_base_price
        - order_final_price
type: string       - currency
  enum:    properties:
        -order_comments:
DECIMAL             - INTEGERtype: string
          description: productorder quantityinformation
type         quantityorder_unitid:
          type: string
          description: unit quantity ID order assigned by merchant
        phonecustomer_order_numberid:
          type: objectstring
      description: phone number  description: order ID presented to required:customer and used for payment. In case of lack -of countrycustomer_order_prefixid order_id will be  used.    - phone      
properties:         countrypos_prefixid:
          type: string
          description: prefix
  POS identifier provided by Vodeno, allowing merchant to filter payments in the reporting tools
        exampleorder_creation_date:
 '+48'         phonetype: string
          typeformat: stringdate-time
          exampledescription: 600123123order creation date
  request_basket_binding:       allOf:order_update_date:
         - type: objectstring
          requiredformat: date-time
          description: -order browserupdate date
         propertiespayment:
            binding_method:$ref: '#/components/schemas/get_payment'
        order_status:
     type:  string   type: string
          enumdescription: order status. ORDER_PROCESSING - status given by Basket App when order is created, payment possible ORDER_COMPLETED - PHONEorder completed at merchant, payment not possible, ORDER_REJECTED - order rejected by merchant or at Inpost app, -payment DEEP_LINKnot possible.
             descriptionenum:
binding method           -  bindingORDER_place:COMPLETED
            - ORDER_REJECTED
type: string           - ORDER_PROCESSING
  enum:      order_merchant_status_description:
          - PRODUCT_CARDtype: string
          description: order merchant status description
 - BASKET_SUMMARY       order_base_price:
         - ORDER_CREATEtype: object
          description: price for order without -delivery BASKET_POPUPcosts
          required:
     - THANK_YOU_PAGE      - net
       description: client binding place  - gross
         phone_number:   - vat
          $ref: '#/components/schemas/phone_number'properties:
            browsernet:
              $reftype: '#/components/schemas/browser_details'number
    browser_details:       type: object  format: decimal
   description: browser details       required:  description: net price
    - browser_id       gross:
 - user_agent         - platform  type: number
     - architecture        format: -decimal
data_time         - location    description: gross price
  - customer_ip         - port
vat:
     properties:         user_agenttype: number
         type: string    format: decimal
     description: user agent
        description: VAT
         typeorder_final_price:
string          type: description:object
additional description         platformdescription: total order price with delivery    costs
 type: string        required:
  description: platform         architecture:- net
         type: string  - gross
       description: architecture    - vat
   data_time:       properties:
   type: string        net:
  format: date-time           descriptiontype: tiemnumber
        location:      format:  decimal
  type: string           description: net price
location         customer_ip:   gross:
       type: string      type: number
   description: browser id         portformat: decimal
           type: string  description: gross price
      description: port     merchant_order_responsevat:
      type: object       requiredtype: number
       - order_details      format: decimal
 - account_info         - delivery  description: VAT
     - products  order_discount:
      - consents   type: number
  properties:         order_details:format: decimal
          $refdescription: '#/components/schemas/merchant_orders_details'
    Value used discount coupons on order     account_info:  
        $refcurrency:
'#/components/schemas/account_info'          invoice_detailstype: string
          $refdescription: '#/components/schemas/invoice_details' basket currency
          deliveryenum:
          $ref: '#/components/schemas/delivery'  - PLN
        productsdelivery_references_list:
          type: array
          description: productsdelivery orderreferences list
          items:
            $ref: '#/components/schemas/getdelivery_products_orderreferences'
    merchant_basket_details:
   consents:   type: object
      typerequired:
 array       - summary
  description: consents list    - delivery
     items:   - products
        $ref: '#/components/schemas/consents_order'- consents
      merchant_orders_detailsproperties:
       type basket_id:
object          requiredtype: string
        - order_id description: ID basket assigned by merchant
  - merchant_order_id     creation_date:
   - pos_id      type: string
 - order_creation_date        format: date-time
 merchant_id         description: -date basket_hash creation
       - payment_statusupdate_date:
          - order_statustype: string
        - order_merchant_status_description
  format: date-time
      - order_base_price   description: date basket update
  - order_final_price     summary:
   - currency       properties:$ref: '#/components/schemas/basket_summary'
        order_commentsdelivery:
          type: stringarray
          description: orderdelivery list
 information         order_iditems:
          type: string $ref: '#/components/schemas/delivery_basket_response'
        description: ID order assigned by merchantpromo_codes:
           pos_id:type: array
          typedescription: stringpromo codes
          descriptionitems:
POS identifier provided by Vodeno, allowing merchant to filter payments in the reporting tools$ref: '#/components/schemas/promo_codes'
        order_creation_dateproducts:
          type: stringarray
          formatdescription: date-time products order list
          descriptionitems:
order  creation date         order_update_date$ref: '#/components/schemas/get_products'
         typerelated_products:
string           formattype: date-timearray
          description: related orderproduct information
update date         paymentitems:
            $ref: '#/components/schemas/get_related_paymentproducts'
        order_statusconsents:
          type: array
          description: consents list
          items:
 string           description$ref: 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.
   '#/components/schemas/consents'
    information:
      type: object
      required:
        - type
        - description
      enumproperties:
        type:
   - ORDER_COMPLETED      type: string
     - ORDER_REJECTED    enum:
        - ORDER_PROCESSING   - ATTENTION
    order_merchant_status_description:        -   type:ERROR
string           description: ordertype merchantadditional statusnotice
description         order_base_pricedescription:
          type: objectstring
          description: pricebasket foradditional ordernotice
without delivery costs  payment_card:
      type: object
required:      required:
      - net - type
        - description
- gross     properties:
       - vat last_four_digits:
          propertiestype: string
           netdescription: Last 4 digits of original          type:PAN (card number)
        scheme:
     format: decimal    type: string
          description: netScheme pricein which the card operates
        gross:
  card_type:
           type: numberstring
          enum:
   format: decimal        - DEBIT
     description: gross price     - CREDIT
      vat:      - PREPAID
       type: number    - CHARGE
         format: decimal  - DEFERRED_DEBIT
           description: VATScheme in which the card operates
    orderresponse_finalsigning_pricekeys:
      type: object
  type: object   properties:
       description merchant_external_id:
total order price with delivery costs     type: string
    required:      description: merchant external id
   - net    public_keys:
        - gross type: array
          - vatdescription: public keys
          propertiesitems:
            net$ref: '#/components/schemas/public_key'
    public_key:
      type: object
 type: number    required:
        - type
format: decimal       - description
      descriptionproperties:
net price       public_key_base64:
     gross:     type: string
        type: number description: public key in format base64
        formatversion:
decimal          type:  string
  description: gross price      description: version
     vatresponse_version_signing_keys:
      type: object
      typeproperties:
number        merchant_external_id:
      format: decimal   type: string
          description: merchant VATexternal id
        currencypublic_key:
          typeproperties:
 string           descriptionpublic_key_base64:
basket currency           enum:  type:  string
        - PLN         delivery_references_listdescription: public key in format base64
     type: array      version:
    description: delivery references list       type: string
  items:             $refdescription: '#/components/schemas/delivery_references'version
    merchantresponse_put_basket_details:
      type: object
      required:
        - summaryinpost_basket_id
      properties:
 - delivery      inpost_basket_id:
  - products       type: string
  - consents       propertiesdescription: basket id created by BasketApp
    basketdelivery_idproduct:
   
      type: stringobject
          description: IDadditional basketdelivery assignedinformation byfor merchantproduct
        creation_dateproperties:
          delivery_type: string
          formattype: date-timestring
          description: date basket creation delivery type (APM; COURIER)
          update_date:enum:
            - type:APM
string           format: date-time COURIER
         descriptionif_delivery_available:
date basket update         summarytype: boolean
         $ref: '#/components/schemas/basket_summary'
        delivery: description: if type of delivery available for product
    delivery_related_products:
      type: array
 object
        description: additional delivery listinformation for product
        itemsproperties:
        delivery_type:
   $ref: '#/components/schemas/delivery_basket_response'      type: string
 promo_codes:         description: delivery type: array (APM; COURIER)
          descriptionenum:
promo  codes          - items:APM
            $ref: '#/components/schemas/promo_codes'- COURIER
        productsif_delivery_free:
          type: arrayboolean
          description: is productsfree orderdelivery listfor a type of delivery
      items:  if_delivery_available:
          $reftype: '#/components/schemas/get_products'boolean
        related_products:  description: if type of delivery available for   type:product
array    responseGetPayments:
      descriptiontype: relatedobject
product information     required:
     items:   - payment_type
        $refproperties:
'#/components/schemas/get_products'         consentspayment_type:
          type: array
          description: consentspayment listtype
          items:
            $ref: '#/components/schemas/consentspayment_type' 
    informationproduct_images:
      type: object
      requireddescription: additional product images
     - typerequired:
        - descriptionsmall_size
      properties:  - normal_size      type:
      properties:    type: string 
         enumsmall_size:
          type: string
- ATTENTION         description: product image. Preferred -size ERROR360 x 352
        descriptionnormal_size:
type additional notice         description:
          type: string
          description: basketproduct additionalimage. noticePreferred size 360 x  payment_card:504
      typecookies:
object       required:
        - typedomain
        - descriptionkeyValue
      properties:  - key
     last_four_digits:
          type: string
          description: Last 4 digits of original PAN (card number) - value
      scheme:  - path
       type: stringobject
       properties:
    description: Scheme in which thedomain:
card operates         card_type: string
         type description: stringDomain of the cookie represented by pair key-value
   enum:       example: "uat.outofthebox.pl"
    - DEBIT   key:
         - CREDITtype: string
          description: -Cookie PREPAIDkey
          example:  - CHARGE"wp_woocommerce_session_f3cd21b400c074e165b59837d7a9d0a4"
        value:
     - DEFERRED_DEBIT    type: string
     description: Scheme in which the carddescription: operatesCookie value
   response_signing_keys:       typeexample: object"t_f13664beda2ec455d97546c1ddab8b%7C%7C1699438060%7C%7C1699434460%7C%7Cf77d310ce1f0440cb4812f5043736989"
        propertiespath:
         merchant_external_id: type: string
          typedescription: Cookie stringpath
          descriptionexample: merchant external id"/"
         public_keysexpires:
          type: arraystring
          description: public keys Cookie expiration time or maxAge
           items:example: "2025-01-16T14:17:02.486Z"
          format: date-time     $ref: '#/components/schemas/public_key'     
 public_key:       typesecure:
  object        requiredtype: boolean
       - type  description: Cookie security information
   - description      example: properties:false
        publichttp_key_base64only:
          type: stringboolean
          description: publicCookie keyhttp ininformation
format base64         versionexample: true
         typesame_site:
string           descriptiontype: versionstring
    response_version_signing_keys:      enum:
type: object       properties:    - STRICT
   merchant_external_id:         - LAX
type: string           description:- merchantNONE
external id         public_keydescription: Cookie sameSite information
       properties:   example: "LAX"
        public_key_base64:
  priority:
           type: string
          enum:
   description: public key in format base64    - LOW
       version:     - MEDIUM
        type: string   - HIGH
          description: versionCookie priority
   response_put_basket:       typeexample: object"MEDIUM"
      required:  max_age:
      - inpost_basket_id    type: integer
 properties:         inpost_basket_iddescription: Cookie max age
       type: string   example: 0       description: basket id created by BasketApp
        

Przykład implementacji w języku PHP

  • Tworzymy interfejs serwisu klienta, który będzie odpowiedzialny za komunikację Merchant -> InPost - InPost Pay (Basket App) .

    Code Block
    languagephp
    <?php
    
    declare(strict_types=1);
    
    namespace Iteo\InpostPayClient\Client;
    
    use Iteo\InpostPayClient\SDK\Basket\BasketApp\Basket;
    use Iteo\InpostPayClient\SDK\Basket\Binding\BindingBasket;
    use Iteo\InpostPayClient\SDK\Basket\Binding\QrCode\QrCodeData;
    use Iteo\InpostPayClient\SDK\Basket\Binding\Request\BasketApp\BasketBindingRequest;
    use Iteo\InpostPayClient\SDK\Basket\Response\BasketsResponse;
    use Iteo\InpostPayClient\SDK\Basket\Response\InpostBasketId;
    use Iteo\InpostPayClient\SDK\Core\Exceptions\InpostPayEndpointException;
    use Iteo\InpostPayClient\SDK\Core\Exceptions\InpostPayPostBasketBindingException;
    use Iteo\InpostPayClient\SDK\Core\Exceptions\InpostPayPostOrderEventException;
    use Iteo\InpostPayClient\SDK\Order\Request\BasketApp\OrderEventRequest;
    use Iteo\InpostPayClient\SDK\Order\Response\BasketApp\OrdersResponse;
    use Iteo\InpostPayClient\SDK\SignatureVerification\SigningKeys\SigningKeysResponse;
    use Iteo\InpostPayClient\SDK\SignatureVerification\SigningVersionKey\SigningKeyResponse;
    
    /**
     * Client interface used for communication between Merchant and InPost Pay application.
     */
    interface InpostPayClientInterface
    {
        /**
         * This method verify if basket is connected with InPost app.
         *
         * @param string $basketId ID basket assigned by merchant
         * @param string|null $browserId Browser ID from cookie
         *
         * @return BindingBasket Object with information about whether the browser is trusted
         * and whether the basket is linked
         *
         * @throws InpostPayEndpointException
         */
        public function getBasketBinding(string $basketId, ?string $browserId): BindingBasket;
    
        /**
         * This method connect basket with InPost app.
         *
         * @param string $basketId ID basket assigned by merchant
         * @param BasketBindingRequest $requestBody Request data, needed for binding basket
         *
         * @return ?QrCodeData Object with data for QR Code when successful binding with QR Code or null
         * when successful binding with phone number
         *
         * @throws InpostPayPostBasketBindingException|InpostPayEndpointException
         */
        public function postBasketBinding(string $basketId, BasketBindingRequest $requestBody): ?QrCodeData;
    
        /**
         * This method desynchronize basket with Inpost Pay mobile app.
         *
         * @param string $basketId ID basket assigned by merchant
         * @param ?bool $ifBasketRealized Information about the fact that the basket will be deleted because
         * it has been realized
         *
         * @throws InpostPayEndpointException
         */
        public function deleteBasketBinding(string $basketId, ?bool $ifBasketRealized): void;
    
        /**
         * This method updates or creates a basket e.g. change products quantity, delivery type etc.
         *
         * @param string $basketId ID basket assigned by merchant
         * @param Basket $basket All Basket data
         *
         * @return InpostBasketId Object with basket ID created from Inpost mobile app
         *
         * @throws InpostPayEndpointException
         */
        public function putBasket(string $basketId, Basket $basket): InpostBasketId;
    
        /**
         * This method update order.
         *
         * @param string $orderId ID order assigned by merchant
         * @param OrderEventRequest $orderEventRequest Information about order event, that will change order status
         *
         * @throws InpostPayPostOrderEventException|InpostPayEndpointException
         */
        public function postOrderEvent(string $orderId, OrderEventRequest $orderEventRequest): void;
    
        /**
         * This method deletes binded browser from Inpost Pay mobile app.
         *
         * @param string $browserId ID browser from cookie
         *
         * @throws InpostPayEndpointException
         */
        public function deleteBrowserBinding(string $browserId): void;
    
        /**
         * This method get baskets list for merchant.
         *
         * @param ?int $pageIndex Information about page index of merchant baskets list
         * @param ?int $pageSize Information about page size of merchant baskets list page
         *
         * @return BasketsResponse Object containing list of baskets for merchant for strict page index
         *
         * @throws InpostPayEndpointException
         */
        public function getBaskets(?int $pageIndex, ?int $pageSize): BasketsResponse;
    
        /**
         * This method get orders list for merchant.
         *
         * @param ?int $pageIndex Information about page index of merchant orders list
         * @param ?int $pageSize Information about page size of merchant orders list page
         *
         * @return OrdersResponse Object containing list of orders for merchant for strict page index
         *
         * @throws InpostPayEndpointException
         */
        public function getOrders(?int $pageIndex, ?int $pageSize): OrdersResponse;
    
        /**
         * This method get public signing keys.
         *
         * @return SigningKeysResponse Object containing list of public signing keys
         *
         * @throws InpostPayEndpointException
         */
        public function getSigningKeys(): SigningKeysResponse;
    
        /**
         * This method get public signing key for version.
         *
         * @param string $version Version of signing-key
         *
         * @return SigningKeyResponse Object containing public signing key
         *
         * @throws InpostPayEndpointException
         */
        public function getSigningKey(string $version): SigningKeyResponse;
    }

View file
nameautoryzacjaClientInterface.txt

  • Tworzymy interfejs url creatora, który będzie odpowiedzialny za uzyskanie odpowiedniego adresu url do API InPostPay'a.

    Code Block
    languagephp
    <?php
    
    declare(strict_types=1);
    
    namespace Iteo\InpostPayClient\Client;
    
    /**
     * Interface used for creating url for communication with Inpost Pay.
     */
    interface InpostPayURLCreatorInterface
    {
        /**
         * Method that return url for Inpost Pay.
         *
         * @return InpostPayURL url for Inpost Pay
         */
        public function create(): InpostPayURL;
    }

View file
nameautoryzacjaURLCreatorInterface.txt

  • Tworzymy implementację serwisu url creatora dla środowiska Sandbox.

    Code Block
    languagephp
    <?php
    
    declare(strict_types=1);
    
    namespace Iteo\InpostPayClient\Client;
    
    /**
     * PHP URL Creator Service implementation used for creating url to Sandbox InpostPay.
     */
    final class SandboxInPostPayURLCreator implements InpostPayURLCreatorInterface
    {
        /**
         * {@inheritdoc}
         */
        public function create(): InpostPayURL
        {
            return new InpostPayURL('https://sandbox-api.inpost.pl/v1/izi/');
        }
    }
    

View file
nameSandboxInPostPayURLCreator.txt

  • Tworzymy implementację serwisu url creatora dla środowiska Produkcyjnego.

    Code Block
    languagephp
    <?php
    
    declare(strict_types=1);
    
    namespace Iteo\InpostPayClient\Client;
    
    /**
     * PHP URL Creator Service implementation used for creating url to Production InpostPay.
     */
    final class ProductionInPostPayURLCreator implements InpostPayURLCreatorInterface
    {
        /**
         * {@inheritdoc}
         */
        public function create(): InpostPayURL
        {
            return new InpostPayURL('https://api.inpost.pl/v1/izi/');
        }
    }
    

View file
nameProductionInPostPayURLCreator.txt

  • Tworzymy implementację serwisu klienta, wykorzystując do tego PSR'owego klienta do komunikacji REST, oraz wcześniej zaimplementowany interfejs url creatora aby uzyskać url do API InpostPay'a oraz interfejs serwisu bearera aby uzyskać access token. Aby klient był w całości sprawny, potrzebna jest implementacja funkcji opisanych w interfejsie, odpowiedzialnych za konkretne endpointy w Lista endpointów.

    Code Block
    languagephp
    /**
     * Client symfony implementation used for communication between Merchant and InPost Pay application.
     *
     * @param InpostPayBearerServiceInterface $inpostPayBearerService <p> Bearer service interface,
     * with contains creating bearer token which is required for communication with Inpost Pay </p>
     *
     */
    final class InpostPayClient implements InpostPayClientInterface
    {
        private ClientInterface $client;
        private InpostPayURLCreatorInterface $URLCreator;
        private InpostPayBearerServiceInterface $bearerService;
    
        public function __construct(
            ClientInterface $client,
            InpostPayURLCreatorInterface $URLCreator,
            InpostPayBearerServiceInterface $bearerService
        ) {
            $this->client = $client;
            $this->URLCreator = $URLCreator;
            $this->bearerService = $bearerService;
        }
    
        /**
         * @return array{
         *     Authorization: string,
         *     Content-Type: string
         * }
         *
         * @throws InpostPayEndpointException
         */
        private function provideDefaultClientHeaders(): array
        {
            return [
                    'Authorization' => sprintf('Bearer %s', $this->bearerService->getBearerToken()),
                    'Content-Type' => 'application/json',
            ];
        }
    
        private function buildUri(string $path): string
        {
            return sprintf(
                '%s%s',
                $this->URLCreator->create()->getUrl(),
                $path
            );
        }
    }
    

View file
nameimplementacjaKlienta.txt