---
openapi: 3.0.1
info:
  title: Purse - Payment API
  description: Payment API
  version: "v1"
servers:
  - url: https://api.purse-sandbox.com/payment/v1
    description: Upstream Pay pre-production
tags:
  - name: Authentication
  - name: POS API
    description: Endpoints used to process payment in a POS environement
  - name: Session API
  - name: Transaction API
  - name: Deprecated
paths:
  "/oauth/token":
    servers:
      - url: https://api.purse-sandbox.com
    post:
      tags:
        - Authentication
      summary: OAuth2 client credentials authentication
      operationId: clientCredentialsAuthentication
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - grant_type
              properties:
                grant_type:
                  type: string
                  enum:
                    - client_credentials
        required: true
      responses:
        "200":
          description: OK
          content:
            "application/json":
              schema:
                "$ref": "#/components/schemas/Oauth2TokenResponse"
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
        "401":
          description: Not Found
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
      security:
        - BasicAuth: []
        - ApiKey: []
  /{entity}/sessions/{session}/validate:
    post:
      tags:
        - Session API
      summary: Validates the selected payment solutions
      operationId: validateSession
      parameters:
        - name: entity
          in: path
          description: id of the entity
          required: true
          schema:
            type: string
            format: uuid
        - name: session
          in: path
          description: id of the session to validate
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                "$ref": "#/components/schemas/ValidateSessionSolutionApplication"
        required: true
      responses:
        "200":
          description: Success of all apply operations
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ClientAction"
        "207":
          description: Multiple status, with some in success and some in error
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ClientAction"
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
        "404":
          description: Not Found
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
        "409":
          description: Failed of all apply operations
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ClientAction"
      security:
        - ApiKey: []
  "/{entity}/sessions/{session}/init":
    post:
      tags:
        - Session API
      summary: Initializes the payment solution
      operationId: initSession
      parameters:
        - name: entity
          in: path
          required: true
          description: id of the entity
          schema:
            type: string
            format: uuid
        - name: session
          in: path
          required: true
          description: id of the session to init
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/DefaultSessionSolutionApplication"
        required: true
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/InitResult"
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
        "404":
          description: Not Found
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
      security:
        - ApiKey: []
  "/{entity}/sessions/create":
    post:
      tags:
        - Session API
      summary: Creates a new session for an order
      operationId: createSession
      parameters:
        - name: entity
          in: path
          required: true
          description: id of the entity
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/CreateSessionApplication"
        required: true
      responses:
        "201":
          description:
            When the session was created. The Location header contains
            the root path to run actions over it
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/SessionProtocols"
        "204":
          description:
            When the session was created but no eligible experiences matched
            the candidate order.
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/SessionProtocols"
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
        "404":
          description: Not Found
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
      security:
        - OAuth2: []
        - ApiKey: []
  "/{entity}/transactions/{action}":
    put:
      tags:
        - Transaction API
      summary: Initiates a transaction with an action on a payment solution
      operationId: createTransaction
      parameters:
        - name: entity
          in: path
          description: id of the entity
          required: true
          schema:
            type: string
            format: uuid
        - name: action
          in: path
          required: true
          schema:
            type: string
            enum:
              - AUTHORIZE
              - VOID
              - CAPTURE
              - REFUND
              - OFF_SESSION_AUTHORIZE
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/ValidateSessionSolutionApplication"
        required: true
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ActionResult"
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
        "404":
          description: Not Found
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
      security:
        - OAuth2: []
        - ApiKey: []
  "/{entity}/transactions/{transaction}/{action}":
    post:
      tags:
        - Transaction API
      summary: Executes an action on a transaction
      operationId: executeTransactionAction
      parameters:
        - name: entity
          in: path
          required: true
          description: id of the entity
          schema:
            type: string
            format: uuid
        - name: action
          in: path
          required: true
          schema:
            type: string
            enum:
              - AUTHORIZE
              - VOID
              - CAPTURE
              - REFUND
              - OFF_SESSION_AUTHORIZE
        - name: transaction
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: For the CAPTURE, VOID and OFF_SESSION_AUTHORIZE actions, you will need the ID of the authorisation transaction to perform the call. For the REFUND action, you will need the ID of the CAPTURE ID transaction
        - name: x-idempotency-key
          in: header
          required: false
          schema:
            type: string
          description: |
            Unique identifier for the given request.

            For instance, using a timestamp is strongly discouraged, while a unique identifier of the transaction on your end is advised.

            Upon using this header, UpStream Pay action on transaction API will only execute the action once, and each subsequent call to the same endpoint with the same `x-idempotency-key` header value will return the first call’s result.

            Note that this is only true for 14 days, so this does not replace a call to the get transactions for session API
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/DefaultPaymentApplication"
        required: true
      responses:
        "200":
          description: OK
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ActionResult"
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
        "404":
          description: Not Found
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
      security:
        - OAuth2: []
        - ApiKey: []
  "/{entity}/transactions/{transaction}":
    get:
      tags:
        - Transaction API
      summary: Fetches the status of a single transaction
      operationId: statusForTransaction
      parameters:
        - name: entity
          in: path
          description: id of the entity
          required: true
          schema:
            type: string
            format: uuid
        - name: transaction
          in: path
          description: id of the transaction
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ActionResult"
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
        "404":
          description: Not Found
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
      security:
        - OAuth2: []
        - ApiKey: []
  "/{entity}/sessions/{session}":
    get:
      tags:
        - Transaction API
      summary: Fetches the status of each transaction for a session
      operationId: statusForSession
      parameters:
        - name: entity
          in: path
          description: id of the entity
          required: true
          schema:
            type: string
            format: uuid
        - name: session
          in: path
          description: id of the session
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ListActionResult"
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
        "404":
          description: Not Found
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
      security:
        - OAuth2: []
        - ApiKey: []
  "/{entity}/orders/{order}":
    get:
      tags:
        - Deprecated
      summary: Fetches the status of each transaction created for an order
      description: WARNING ! NOT RECOMMENDED ! Orders are not unique Ids. There is a risk that you do not receive the proper data. It is advised to use the sessionId
      operationId: statusForOrder
      parameters:
        - name: entity
          in: path
          description: id of the entity
          required: true
          schema:
            type: string
            format: uuid
        - name: order
          in: path
          description: id of the order (Careful, you must ensure the unicity of the order id)
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ListActionResult"
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
        "404":
          description: Not Found
          content:
            "*/*":
              schema:
                "$ref": "#/components/schemas/ApiError"
      security:
        - OAuth2: []
        - ApiKey: []

  /{{entityId}}/sessions/init:
    post:
      tags:
        - Pos API
      summary: Check a giftcard avaibility
      parameters:
        - name: entityId
          in: path
          required: true
          description: id of the entity
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DefaultInitPosRequest"
        required: true
  /{{entityId}}/transactions/capture:
    put:
      tags:
        - Pos API
      summary: Capture a payment in a POS environment
      parameters:
        - name: entityId
          in: path
          required: true
          description: id of the entity
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DefaultCapturePosRequest"
        required: true
  #   post:
  #     tags:
  #       - Wallet API
  #     summary: Add a token to the owner's wallet
  #     operationId: addToken
  #     parameters:
  #       - name: x-merchant-id
  #         in: header
  #         required: true
  #         schema:
  #           type: string
  #       - name: owner_id
  #         in: path
  #         required: true
  #         schema:
  #           type: string
  #     requestBody:
  #       content:
  #         application/json:
  #           schema:
  #             $ref: '#/components/schemas/WalletApiTokenRequest'
  #       required: true
  #     responses:
  #       '201':
  #         description: The token ID
  #         content:
  #           application/json:
  #             schema:
  #               $ref: '#/components/schemas/WalletApiTokenProjection'
  #       '400':
  #         description: Bad Request
  #         content:
  #           '*/*':
  #             schema:
  #               $ref: '#/components/schemas/ApiError'
  #     security:
  #       - OAuth2: []
  #       - ApiKey: []
  # /wallet/{owner_id}/token/{id}/status:
  #   patch:
  #     tags:
  #       - Wallet API
  #     operationId: updateStatus
  #     summary: Update token status
  #     parameters:
  #       - name: x-merchant-id
  #         in: header
  #         required: true
  #         schema:
  #           type: string
  #       - name: owner_id
  #         in: path
  #         required: true
  #         schema:
  #           type: string
  #       - name: id
  #         in: path
  #         required: true
  #         schema:
  #           type: string
  #           format: uuid
  #     requestBody:
  #       content:
  #         application/json:
  #           schema:
  #             $ref: '#/components/schemas/WalletApiUpdateStatusRequest'
  #       required: true
  #     responses:
  #       '200':
  #         description: OK
  #       '400':
  #         description: Bad Request
  #         content:
  #           '*/*':
  #             schema:
  #               $ref: '#/components/schemas/ApiError'
  #     security:
  #       - OAuth2: []
  #       - ApiKey: []
  # delete:
  #   tags:
  #     - Wallet API
  #   summary: Delete all tokens of an owner
  #   operationId: deleteAllTokens
  #   parameters:
  #     - name: x-merchant-id
  #       in: header
  #       required: true
  #       schema:
  #         type: string
  #     - name: owner_id
  #       in: path
  #       required: true
  #       schema:
  #         type: string
  #   requestBody:
  #     content:
  #       application/json:
  #         schema:
  #           type: string
  #   responses:
  #     '204':
  #       description: The tokens are removed
  #       content:
  #         application/json:
  #           schema:
  #             type: object
  #             additionalProperties:
  #               type: array
  #               items:
  #                 type: string
  #                 format: uuid
  #     '400':
  #       description: Bad Request
  #       content:
  #         '*/*':
  #           schema:
  #             $ref: '#/components/schemas/ApiError'
  #   security:
  #     - OAuth2: []
  #     - ApiKey: []
components:
  schemas:
    Oauth2TokenResponse:
      description: OAuth2 Response for the request of a Bearer Token
      type: object
      properties:
        access_token:
          description: Access Token to be used in accessing protected endpoints
          type: string
        expires_in:
          description: The lifetime in seconds of the Access Token
          type: integer
        scope:
          description: The scope of the Access Token
          type: string
        token_type:
          description: The type of the Token issued
          type: string
      required:
        - access_token
        - expires_in
        - token_type
      example:
        access_token: 2YotnFZFEjr1zCsicMWpAA
        token_type: Bearer
        expires_in: 3600
    ApiError:
      type: object
      properties:
        timestamp:
          type: string
          description: The moment at which the error happened.
          format: date-time
        error_code:
          type: string
          description: The error code to interpret.
          example: AUTHORIZE_NOT_ALLOWED
          enum:
            - FORBIDDEN
            - INTERNAL_SERVER_ERROR
            - BAD_REQUEST
            - PAYLOAD_TOO_LARGE
            - NOT_IMPLEMENTED
            - NOT_FOUND
            - ALREADY_EXISTS
            - NO_SUCH_EXPERIENCE
            - EXPERIENCE_NOT_ELIGIBLE
            - UNAUTHORIZED_OUTGOING_CALL
            - AUTHORIZE_NOT_ALLOWED
            - PLUGIN_UNHANDLED_ERROR
            - PLUGIN_WORKFLOW_ERROR
            - PLUGIN_INPUT_ERROR
            - CREATE_ROOT_ENTITY_ERROR
            - ENTITY_SHOULD_HAVE_NAME_ERROR
            - ENTITY_SHOULD_HAVE_PARENT_ERROR
            - ENTITY_NOT_FOUND_ERROR
            - TRANSACTION_NOT_FOUND_ERROR
            - SESSION_ALREADY_SUBMITTED_ERROR
            - CREDIT_ALREADY_COMMITTED_ERROR
            - CREDIT_NOT_COMMITTED
        message:
          type: string
          description: The message explaining the cause of the error.
          example:
            Authorize action not callable, it can only be impersonated through
            status or verify action.
        request_id:
          type: string
          description: The unique ID of this request for debug purposes.
          example: "21987985"
        status:
          type: integer
          description: The HTTP status returned by this HTTP response.
          format: int32
          example: 409
        path:
          type: string
        error:
          type: string
    Account:
      type: object
      properties:
        creation_date_time:
          type: string
          description:
            The date and time (ISO 8601 format) when the customer account
            has been created.
          format: date-time
          example: "2020-08-25T10:42:59+02:00"
        update_date_time:
          type: string
          description:
            The last date and time (ISO 8601 format) when the customer
            account has been last updated.
          format: date-time
          example: "2020-08-25T10:42:59+02:00"
        password_update_date_time:
          type: string
          description:
            The last date and time (ISO 8601 format) when the customer
            account password has been last updated.
          format: date-time
          example: "2020-08-25T10:42:59+02:00"
        purchase_count_last_day:
          type: integer
          description:
            Number of purchase transaction (successful and abandoned) for
            this account account during the last 24 hours.
          example: 3
        purchase_count_last_six_months:
          type: integer
          description: Number of purchases for the account for the last six months.
          example: 5
        purchase_count_last_year:
          type: integer
          description:
            Number of purchase transaction (successful and abandoned) for
            this account account during the last 12 months.
          example: 15
        different_card_count_last_day:
          type: integer
          description:
            "Number of different card attempt for the account during the
            last 24 hours. "
          example: 3
        authentication_method:
          type: string
          description:
            Information about how the account has been authenticated before
            the payment (for the current order).
          example: GUEST
          enum:
            - GUEST
            - MERCHANT_CREDENTIALS
            - IDENTITY_FEDERATION_CREDENTIALS
            - ISSUER_CREDENTIALS
            - THIRD_PARTY_CREDENTIALS
            - FIDO_CREDENTIALS
        authentication_date_time:
          type: string
          description:
            Date and time (ISO 8601 format) when the customer account has
            been authenticated in merchant system.
          format: date-time
          example: "2020-08-25T10:42:59+02:00"
        prior_payment_authentication:
          type: string
          description:
            How customer has been authenticated during previous 3D Secure
            to this payment.
          example: ACS_FRICTIONLESS
          enum:
            - ACS_FRICTIONLESS
            - ACS_CHALLENGE
            - ACS_VERIFIED
            - OTHER
        prior_payment_authentication_date_time:
          type: string
          description:
            Date and time (ISO 8601 format) of customer's previous 3DSecure
            authentication.
          format: date-time
          example: "2020-08-25T10:42:59+02:00"
        prior_payment_authentication_preference:
          type: string
          deprecated: true
        prior_payment_authentication_reference:
          type: string
          description: ACS Transaction ID for a prior authenticated transaction.
          example: d50244ea-e583-4d90-91ad-b844a7100b9e
        age_indicator:
          type: string
          description: Age of the account in the merchant system.
          example: MORE_60_DAYS
          enum:
            - GUEST
            - NEW
            - LESS_30_DAYS
            - BETWEEN_30_60_DAYS
            - MORE_60_DAYS
        change_indicator:
          type: string
          description: Age since the last update of the account in the merchant system
          example: MORE_60_DAYS
          enum:
            - NEW
            - LESS_30_DAYS
            - BETWEEN_30_60_DAYS
            - MORE_60_DAYS
        password_change_indicator:
          type: string
          description:
            Age since the last update of the password account in the merchant
            system.
          example: MORE_60_DAYS
          enum:
            - GUEST
            - NEW
            - LESS_30_DAYS
            - BETWEEN_30_60_DAYS
            - MORE_60_DAYS
        challenge_indicator:
          type: string
          description:
            What does the merchant expects from the fraud engine of the
            used partner for this customer.
          example: "01"
          enum:
            - "01"
            - "02"
            - "03"
            - "04"
            - "05"
            - "06"
            - "07"
            - "08"
            - "09"
        three_ds_exemption:
          type: string
          description: Type of 3DS exemption if this account is exempted.
          example: Low value exemption
          enum:
            - "Low value exemption"
            - "TRA exemption"
            - "Trusted beneficiary exemption"
            - "Corporate card payment exemption"
        trust_indicator:
          type: enum
          description: Indication of the trustworthiness of the account based on the merchant's own risk analysis.
          example: VERY_GOOD
          enum:
           - "VERY_GOOD"
           - "GOOD"
           - "NEUTRAL"
           - "BAD"
           - "VERY_BAD"
      description:
        Additional information of customer (account, history with the merchant
        ...).
    AdditionalAttributes:
      type: object
      properties:
        national_identifier:
          type: string
          description: National identification number of the customer (country specific).
          example: MX-1234567890
      description: Map of additional attributes related to the customer.
    Address:
      type: object
      properties:
        first_name:
          type: string
          description: The recipient's first name.
          example: Miles
        middle_name:
          type: string
          description: The recipient's middle name.
          example: Eva
        last_name:
          type: string
          description: The recipient's last name.
          example: MORALES
        gender_code:
          type: string
          description: The recipient's gender.
          example: male
          enum:
            - male
            - female
            - unknown
        delivery_point_name:
          type: string
          description: Name of the delivery point (in case of pickup delivery).
          example: Global shop
        company:
          type: string
          description: The company name.
          example: OUTMERCH
        address_lines:
          type: array
          description:
            The recipient's mailing address which can be composed of several
            lines.
          items:
            type: string
            description:
              The recipient's mailing address which can be composed of
              several lines.
        city:
          type: string
          description: The customer's city, town, or village.
          example: Tijuana
        postal_code:
          type: string
          description:
            The customer's postal code, also known as zip, postcode, EIR
            code, etc.
          example: "22000"
        country_code:
          type: string
          description:
            The two-letter country code corresponding to the customer's
            country.
          format: ISO 3166-1 alpha-2
          example: MX
        province_code:
          type: string
          description: The code for the province.
          format: ISO 3166-2
          example: MX-BCN
        email:
          type: string
          description: The customer email address.
          example: miles.morales@marvel.com
        phone:
          type: string
          description: The customer's phone number at this address.
          format: EP-164
          example: "+526645951538"
        mobile_phone:
          type: string
          description: The customer's mobile phone number at this address.
          format: EP-164
          example: "+526645951538"
        work_phone:
          type: string
          description: The customer's mobile phone number at this address.
          format: EP-164
          example: "+526645951538"
      description: The shipping address of the customer for this shipment.
    Browser:
      type: object
      properties:
        accept_header:
          type: string
          description: Content of the HTTP accept headers
          example: text/html
        user_agent:
          type: string
          description: Content of the HTTP user-agent header
          example: Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)
        color_depth:
          type: integer
          description:
            Value representing the bit depth of the color palette for displaying
            images, in bits per pixel
          format: int32
          example: 32
        java_enabled:
          type: boolean
          description:
            Boolean that represents the ability of the cardholder browser
            to execute Java
          example: true
        javascript_enabled:
          type: boolean
          description:
            Boolean that represents the ability of the cardholder browser
            to execute JavaScript
          example: true
        locale:
          type: string
          description: Value representing the browser language
          example: en-GB
        screen_height:
          type: integer
          description: Total height of the Cardholder’s screen in pixels
          format: int32
          example: 1200
        screen_width:
          type: integer
          description: Total width of the Cardholder’s screen in pixels
          format: int32
          example: 1600
        utc_time_zone:
          type: integer
          description:
            Time difference between UTC time and the Cardholder browser
            local time, in minutes
          format: int32
          example: 60
      description:
        Browser information which should be collected by the partner front
        component.
    Customer:
      type: object
      properties:
        reference:
          type: string
          description: The customer unique identifier in Merchant system.
          example: "2090000000000"
        type_code:
          type: string
          description: Type of the customer.
          example: customer
          enum:
            - customer
            - business
        company_name:
          type: string
          description: Name of the company (in case type code is BUSINESS)
          example: Decathlon
        gender_code:
          type: string
          description: The customer's gender.
          example: male
          enum:
            - male
            - female
            - unknown
        first_name:
          type: string
          description: The customer's first name.
          example: Miles
        middle_name:
          type: string
          description: The customer's middle name.
          example: Eva
        last_name:
          type: string
          description: The customer's last name.
          example: MORALES
        birthdate:
          type: string
          description: The customer birthdate date (ISO 8601 format).
          format: date
          example: "1995-08-25"
        ip:
          type: string
          description: The customer ip address
          example: 127.0.0.1
        locale_code:
          type: string
          description: The customer locale (BCP 47 format).
          format:
            BCP 47 (concatenation of language code (ISO 639-1 format) + "-"
            + country code (ISO 3166-1 alpha-2 format))
          example: es-MX
        billing_address:
          "$ref": "#/components/schemas/Address"
        account:
          "$ref": "#/components/schemas/Account"
        additional_attributes:
          "$ref": "#/components/schemas/AdditionalAttributes"
      description: Customer related information to report who is billed.
    ItemLine:
      type: object
      properties:
        type_code:
          type: string
          description: The type code of the line item.
          example: product
          enum:
            - product
            - digital
            - shipping_fees
            - food_and_drink
            - auto_and_motocycle
            - culture_and_entertainment
            - home_and_garden
            - home_appliances
            - bidding_and_multi_purchasing
            - flowers_and_gifts
            - computers_and_software
            - health_and_beauty
            - personal_services
            - professional_services
            - sport
            - clothing_and_accessories
            - travel_and_tourism
            - hifi_photo_video
            - telephone_and_communication
        sku_reference:
          type: string
          description: The item's SKU (stock keeping unit).
          example: "2600218"
        product_URI:
          type: string
          description: The product URI associated with the item.
          example: "www.example.com/products/2600218"
        image_URI:
          type: string
          description: The image URI associated with the item.
          example: "www.example.com/products/2600218.jpg"
        name:
          type: string
          description: The name of the product.
          example: Camiseta100 niño GYM
        brand:
          type: string
          description: The brand of the product.
          example: Domyos
        price:
          type: number
          description:
            The price for a single unit of the item before discounts have
            been applied.
          example: 199.99
        quantity:
          type: integer
          description: The number of items within the line item.
          example: 2
        amount:
          type: number
          description: The total amount of this item including vat.
          example: 399.98
        seller_reference:
          type: string
          description: The seller unique identifier in Merchant system.
          example: decathlon
        seller_name:
          type: string
          description: The seller name in Merchant system.
          example: decathlon shop
        is_marketplace_seller:
          type: boolean
          description: true is the seller is a marketplace one, false else
          example: true
        taxonomy:
          type: number
          description: Product taxonomy, used to classify items in a hierarchical manner.
          example: ["Apparel", "Footwear", "Running Shoes", "Trail Running"]
        categories:
          type: string
          description: A list of merchant-defined categories.
          example: [ "Car", "Bicycle" ]
        tax_lines:
          type: array
          description:
            A list of tax line objects, each of which details a tax applied
            to the item.
          items:
            "$ref": "#/components/schemas/TaxLine"
      description: A list of line item cancelled for this cancellation.
    Order:
      type: object
      properties:
        redirection:
          type: string
          description: Where to redirect customer in case of success or failed payment.
          format: url
          example: https://example.com/return-after-payment/order000001
        reference:
          type: string
          description:
            Merchant reference of the order usually displayed to customer.
            This identifier should be unique per merchant but there is no check in
            the Payment API over it; it is solely used to either search and eventually
            provide it to the payment partner.
          example: MX123456
        amount:
          type: number
          description: Total amount to be paid for the order.
          example: 199.99
        net_amount:
          type: number
          description: Total amount excluding tax of the order.
          example: 179.99
        tax_amount:
          type: number
          description: Total tax amount for the order.
          example: 20
        currency_code:
          type: string
          description:
            Currency code of the order (ISO 4217 format). Usually the merchant
            default currency code.
          format: ISO 4217
          example: EUR
        tax_lines:
          type: array
          description:
            A list of tax line objects, each of which details a tax applied
            to the order
          items:
            "$ref": "#/components/schemas/TaxLine"
        customer:
          "$ref": "#/components/schemas/Customer"
        shipments:
          type: array
          description:
            List of planned shipments for the order. This makes sense only
            in a payment context (session creation).
          items:
            "$ref": "#/components/schemas/Shipment"
        adjustments:
          type: array
          description: The order to be processed for this request.
          items:
            "$ref": "#/components/schemas/Adjustment"
    Adjustment:
      type: object
      properties:
        amount:
          type: number
          description: Total amount to be paid for this shipment.
          example: 199.99
        net_amount:
          type: number
          description: Total amount excluding tax of this shipment.
          example: 179.99
        tax_amount:
          type: number
          description: Total tax amount this shipment.
          example: 20
        seller_reference:
            type: number
            description: Total tax amount this shipment.
            example: 20
        reason_code:
          type: enum
          description: Reason for this adjustment to be added to the order.
          example: "SALES"
          enum:
                - SALES
                - BUNDLE
                - CLEARANCE
                - END_OF_LINE
                - FULFILLER_REQUESTED_REFUND
                - DISCOUNT
                - DISCOUNT_COUPON
                - PROMOTION
                - SALES
                - SET
                - UNKNOWN

    Shipment:
      type: object
      properties:
        amount:
          type: number
          description: Total amount to be paid for this shipment.
          example: 199.99
        net_amount:
          type: number
          description: Total amount excluding tax of this shipment.
          example: 179.99
        tax_amount:
          type: number
          description: Total tax amount this shipment.
          example: 20
        delivery_type_code:
          type: string
          description: Type of delivery.
          example: external_pickup
          enum:
            - user_delivery
            - store_pickup
            - external_pickup
            - shelf_service
            - digital_delivery
        delivery_quickness_code:
          type: string
          description: Type of delivery.
          example: immediate
          enum:
            - immediate
            - express
            - same_day
            - regular
        delivery_method_reference:
          type: string
          description: Delivery method identifier in merchant system.
          example: cash_on_delivery
        estimated_delivery_date_time:
          type: string
          description:
            The date and time when this shipment is planned to be delivered
            to the customer.
          format: date-time
          example: "2020-08-25T10:42:59+02:00"
        shipping_address:
          "$ref": "#/components/schemas/Address"
        item_lines:
          type: array
          description: A list of line item in the shipment.
          items:
            "$ref": "#/components/schemas/ItemLine"
        tax_lines:
          type: array
          description:
            A list of tax line objects, each of which details a tax applied
            to the item.
          items:
            "$ref": "#/components/schemas/TaxLine"
      description:
        List of planned shipments for the order. This makes sense only
        in a payment context (session creation).
    TaxLine:
      type: object
      properties:
        type_code:
          type: string
          description: The type code of the tax.
          example: vat
          enum:
            - vat
            - gst
        subtype_code:
          type: string
          description: The subtype code of the tax.
          example: standard
          enum:
            - standard
            - cgst
            - sgst
            - igst
        rate:
          type: number
          description: The tax rate applied for this tax.
          example: 19.6
        amount:
          type: number
          description: The tax amount calculated for this tax.
          example: 9.8
      description:
        A list of tax line objects, each of which details a tax applied
        to the item.
    ValidateSessionSolutionApplication:
      type: object
      properties:
        order:
          "$ref": "#/components/schemas/Order"
        hook:
          "$ref": "#/components/schemas/HookURL"
        amount:
          type: number
          description:
            Amount to be processed for this specific request. This can
            be different than order amount.
          example: 10.99
        partner:
          type: string
        method:
          type: string
        step_id:
          type: integer
          description:
            The ID of the init step which you want to validate. It is returned
            after each init call.
          format: int32
          example: 0
          default: 0
    HookURL:
      type: string
      format: url
      description: The URL on which updates will be sent to.
      example: https://example.org/order/ORDER_ID/payment_hooks
    CustomData:
      type: object
      properties:

    ActionResult:
      type: object
      properties:
        method:
          type: string
          description: The method on which this result is associated.
          example: paypal
        id:
          type: string
          description: The ID of the session or transaction created for the request.
          format: uuid
          example: 4bd31c68-8cc8-4db1-982a-5e8e7bfd87c9
          deprecated: true
        session_id:
          type: string
          description: the session ID
          format: uuid
          example: dbaf74ee-e248-4f54-b622-15b054ed1fbc
        entity_id:
          type: string
          description: the session ID
          format: uuid
          example: fce21839-4469-aba7-b622-15b054ed1fbc
        transaction_id:
          type: string
          description: the transaction ID
          format: uuid
          example: fce21839-24bf-4469-aba7-074bab328a22
        date:
          type: string
          description:
            The date on which this result was computed. For synchronous
            response, it will be set to the current date.
          format: date-time
          example: "2020-08-25T10:42:59+02:00"
        status:
          "$ref": "#/components/schemas/Status"
        partner:
          type: string
          description: The partner on which this result is associated.
          example: braintree
        plugin_result:
          "$ref": "#/components/schemas/PluginResultActionResult"
      additionalProperties: true
    CardResponse:
      type: object
      properties:
        expiry_date:
          type: string
          description:
            Card expiry date. Day is discarded, so we advise you to put
            01 (ISO 8601 format).
          format: date
          example: "2023-08-01"
        type:
          type: string
          enum:
            - VISA_DEBIT
            - VISA_CREDIT
            - VISA_ELECTRON
            - MASTERCARD_DEBIT
            - MASTERCARD_CREDIT
            - MAESTRO
            - AMERICAN_EXPRESS
            - CARTE_BANCAIRE
        brand_name:
          type: string
          description: scheme used
          enum:
            - VISA
            - MASTERCARD
            - AMERICAN_EXPRESS
            - CARTE_BANCAIRE
        holder_name:
          type: string
          description: Card holder name
        bin:
          type: string
          description: First digits
        last_four_digits:
          type: string
          description: Last digits
        3ds:
          "$ref": "#/components/schemas/3ds"
    3ds:
      type: object
      properties:
        eciCode:
          description: ECI code of the transaction
          type: string
          enum:
            - 00
            - 01
            - 02
            - 05
            - 06
            - 07
        sca:
          type: boolean
          description: 3DS workflow of the transaction
        acs_transaction_id:
          type: string
          description: Transaction identifier from the issuing bank
        ds_transaction_id:
          type: string
          description: Transaction identifier resulting from 3DS authentication
    Description:
      type: object
      properties:
        brand_name:
          type: string
          description:
            The partner token brand name. Usually used for credit card,
            where the token can be registered for various brands (VISA, MasterCard,...).
          nullable: true
          example: VISA
        display_token:
          type: string
          description:
            The partner token displayed for customer to distinguish this
            specific token from another token he might have registered.
          nullable: true
          example: "**** 4169"
        holder_name:
          type: string
          description:
            The partner token holder name. This is usually used in bank
            transaction through card, where customer needs to provide a cardholder,
            and hence can be useful to distinguish this token from another one.
          nullable: true
          example: John DOE
      additionalProperties: true
      description:
        The partner token metadata. This should be filled as much as possible
        since this is used to present token to customer next time he pays (this can
        hold 4 last card's number, the whole card number,... depending on partner).
    PartnerDataResponse:
      type: object
      properties:
        session:
          type: string
          description:
            Session ID generated by the partner front component which should
            be provided when calling the partner's API.
          example: xx-Tyuhjk-OJLK
        fingerprint:
          type: string
          description:
            Customer's device fingerprint generated by partner front component
            which should be provided when calling the partner's API.
          example: mG/7oNfgy7dPj8/jhP5Ynr9u1U=
        cashier_id:
          type: string
          description:
            In case of payment made with the help of a cashier, id of the
            teammate in merchant system.
          example: JDOE26
        point_of_sale_id:
          type: string
          description:
            In case of payment made in store, id of the point of sale in
            merchant system where the payment has been made.
          example: TILL123
        entity_name:
          type: string
          description:
            In case of payment made in store, this value represents the
            store name.
          example: CAMPUS
        entity_id:
          type: string
          description:
            In case of payment made in store, this value represents the
            store identifier.
          example: "118"
        browser:
          "$ref": "#/components/schemas/Browser"
      additionalProperties: true
      description:
        List of data generated by the partner front component and required
        to be send back to the partner's API.
      nullable: true
    PaymentDataResponse:
      type: object
      properties:
        token:
          type: string
          description:
            Customer account token registered in merchant wallet. This
            represents the token to register in case customer wants to save his data
            for a faster payment experience next time.
          example: sl-23S-Dxc
        holder:
          type: string
          description: Payment solution holder name (cardholder, PayPal account holder,...).
          example: John DOE
        card:
          "$ref": "#/components/schemas/CardResponse"
        cards:
          type: array
          items:
            "$ref": "#/components/schemas/CardResponse"
      description:
        Payment data which should be collected by the payment widget or
        merchant front end.
      additionalProperties: true
      nullable: true
    PluginResultActionResult:
      type: object
      properties:
        currency_code:
          type: string
          description: The currency code which was actually interpreted by partner.
          example: EUR
        token:
          type: string
          description:
            The partner token in case customer wanted to register his payment
            method for faster further payments.
          nullable: true
          deprecated: true
        status:
          type: string
          description: The status code as returned by partner.
          example: 000.100.200
        integrated_token:
          type: array
          description: Token to be registered into integrated wallet.
          items:
            "$ref": "#/components/schemas/Token"
        payment_data:
          "$ref": "#/components/schemas/PaymentDataResponse"
        partner_reference:
          type: string
          description:
            Id provided by the partner that can be used to identify the
            transaction
        amount:
          type: number
          description:
            The amount which was actually interpreted by partner. Sometimes,
            it can be different than requested amount, so make sure you double check
            it.
          example: 5
        logs:
          type: object
          properties:
            card_holder:
              type: string
              description: Card holder name
              example: John Doe
            card_expiry_month:
              type: string
              description: Month of card expiry
              example: "02"
            card_expiry_year:
              type: string
              description: Year of card expiry
              example: "2023"
            card_bin:
              type: string
              description: Card BIN (Bank Identification Number)
              example: "420000"
            card_last_4_digits:
              type: string
              description: Card last 4 digits
              example: "0109"
            card_brand:
              type: string
              enum:
                - VISA_DEBIT
                - VISA_CREDIT
                - VISA_ELECTRON
                - MASTERCARD_DEBIT
                - MASTERCARD_CREDIT
                - MAESTRO
                - AMERICAN_EXPRESS
                - CARTE_BANCAIRE
            card_network:
              type: string
              enum:
                - VISA
                - MASTERCARD
                - AMERICAN_EXPRESS
                - CARTE_BANCAIRE
            3d_secure_eci:
              type: string
              description: Electronic Commerce Indicator
          additionalProperties:
            type: string
          description:
            The data which plugin want to forward to merchant. Those are
            not handled by Payment API.
          nullable: true
        partner_data:
          "$ref": "#/components/schemas/PartnerDataResponse"
        loyalty:
          type: string
          description:
            The partner token unique identified in case customer wanted
            to register his payment method for faster further payments. This is used
            for some partner which generates a new token each time. For such partner,
            loyalty is an image of the payment means used, while token is a reference
            to one of the transaction using that loyalty.
          nullable: true
          deprecated: true
      additionalProperties: true
      description: The result returned by plugin code.
    Status:
      type: object
      properties:
        action:
          type: string
          description: The action related to this status.
          example: AUTHORIZE
        state:
          type: string
          description: The state related to this status.
          example: SUCCESS
          enum:
            - PENDING
            - RETRY
            - WAITING
            - SUCCESS
            - ERROR
            - CUSTOMER
            - MANUAL
            - UNCERTAIN
        code:
          type: string
          description: The code related to this status.
          example: SUCCEEDED
          enum:
            - SUCCEEDED
            - FAILED
            - CARD_EXPIRED
            - UNKNOWN
            - FORCED
            - AMOUNT_EXCEEDED
            - BLOCKED_BY_CUSTOMER
            - BLOCKED_CARD
            - DUPLICATED_TRANSACTION
            - EXPIRED_AUTHORIZATION
            - INSUFFICIENT_FUNDS
            - REFUND_REQUESTED_TOO_LATE
            - REJECTED_BANK
            - REJECTED_BY_RISK_CHECKS
            - TECHNICAL_ISSUE_TO_CONTACT_PARTNER
            - TRANSACTION_NOT_SUPPORTED_BY_CARD
            - TRANSACTION_NOT_SUPPORTED_BY_MERCHANT_ACCOUNT
            - UNKNOWN_CARD
            - WAITING_PARTNER_RESPONSE
            - WAITING_ONEPAY_ACTION
            - CARD_ALREADY_ACTIVE
            - TECHNICAL_ISSUE_DURING_AUTHENTICATION_CHECK
            - WRONG_CARD_DATA
            - BAD_REQUEST
            - CARD_IS_NOT_ACTIVE
            - ABORTED_BY_CUSTOMER
            - WRONG_DATA
            - UNCERTAIN
            - MAX_ATTEMPT_REACHED
            - AUTHENTICATION_CHECK_FAIL
            - FRAUD
            - SUSPECTED_FRAUD
            - AUTHENTICATION_FAIL_DUE_TO_FRAUD
            - TRANSACTION_MISSING
        description:
          type: string
          description: The description related to this status.
      additionalProperties: true
    Token:
      type: object
      properties:
        id:
          type: string
          description:
            Customer account token registered in merchant wallet. This
            represents the token to register in case customer wants to save his data
            for a faster payment experience next time.
          example: sl-23S-Dxc
        loyalty:
          type: string
          description:
            The partner token unique identified in case customer wanted
            to register his payment method for faster further payments. This is used
            for some partner which generates a new token each time. For such partner,
            loyalty is an image of the payment means used, while token is a reference
            to one of the transaction using that loyalty.
          nullable: true
          deprecated: true
        uniqueness_token:
          type: string
          description:
            The partner token unique identified in case customer wanted
            to register his payment method for faster further payments. This is used
            for some partner which generates a new token each time. For such partner,
            uniquenessToken is an image of the payment means used, while token is
            a reference to one of the transaction using that uniquenessToken.
          nullable: true
        pin_code:
          type: string
          description:
            The partner token pin code to prefill it if applicable anyhow.
            Usually used to prefill gift cards, since credit card should usually request
            the CSC even when using a token.
          nullable: true
          example: "1234"
        expiration_date:
          type: string
          description:
            The partner token expiration date. When outdated, a token is
            no more returned but can still be removed.
          format: date-time
          example: "2021-08-20T07:46:23.433Z"
        description:
          "$ref": "#/components/schemas/Description"
        owner:
          type: string
          description:
            The customer unique identifier in the merchant system. This
            usually corresponds to customer.reference.
      additionalProperties: true
    DefaultPaymentApplication:
      type: object
      properties:
        order:
          "$ref": "#/components/schemas/Order"
        hook:
          "$ref": "#/components/schemas/HookURL"
        amount:
          type: number
          description:
            Amount to be processed for this specific request. This can
            be different than order amount.
          example: 10.99
      additionalProperties: true
    CreateSessionApplication:
      allOf:
        - "$ref": "#/components/schemas/DefaultPaymentApplication"
        - type: object
          properties:
            information_request:
              type: boolean
              description: Set to true if this is not a payment but just a card information request
              example: true
              default: false
            recurring_payment:
              type: boolean
              description: Set to true if this is a recurring payment
              example: true
              default: false  
          additionalProperties: false
    ClientAction:
      type: object
      properties:
        results:
          type: array
          description:
            For each payment application sent in the validate call, their
            respective results.
          items:
            "$ref": "#/components/schemas/TransactionGeneratorResult"
        errors:
          type: object
          additionalProperties:
            "$ref": "#/components/schemas/ApiErrorsMap"
          description: The list of errors related to each payment solution.
      additionalProperties: true
    TransactionGeneratorResult:
      type: object
      properties:
        id:
          type: string
          description: The ID of the session or transaction created for the request.
          format: uuid
          example: 4bd31c68-8cc8-4db1-982a-5e8e7bfd87c9
          deprecated: true
        session_id:
          type: string
          format: uuid
        partner:
          type: string
          description: The partner on which this result is associated.
          example: braintree
        method:
          type: string
          description: The method on which this result is associated.
          example: paypal
        status:
          "$ref": "#/components/schemas/Status"
        date:
          type: string
          description:
            The date on which this result was computed. For synchronous
            response, it will be set to the current date.
          format: date-time
          example: "2020-08-25T10:42:59+02:00"
        transaction_id:
          type: string
          format: uuid
        parent_transaction_id:
          type: string
          format: uuid
        plugin_result:
          "$ref": "#/components/schemas/TransactionGeneratorResultPluginResultTransactionGeneratorResult"
      additionalProperties: true
    TransactionGeneratorResultPluginResultTransactionGeneratorResult:
      type: object
      properties:
        status:
          type: string
          description: The status code as returned by partner.
          example: 000.100.200
        amount:
          type: number
          description:
            The amount which was actually interpreted by partner. Sometimes,
            it can be different than requested amount, so make sure you double check
            it.
          example: 5
        currency_code:
          type: string
          description: The currency code which was actually interpreted by partner.
          example: EUR
        token:
          type: string
          description:
            The partner token in case customer wanted to register his payment
            method for faster further payments.
          nullable: true
          deprecated: true
        loyalty:
          type: string
          description:
            The partner token unique identified in case customer wanted
            to register his payment method for faster further payments. This is used
            for some partner which generates a new token each time. For such partner,
            loyalty is an image of the payment means used, while token is a reference
            to one of the transaction using that loyalty.
          nullable: true
          deprecated: true
        integrated_token:
          type: array
          description: Token to be registered into integrated wallet.
          items:
            "$ref": "#/components/schemas/Token"
        payment_data:
          "$ref": "#/components/schemas/PaymentDataResponse"
        partner_data:
          "$ref": "#/components/schemas/PartnerDataResponse"
        partner_reference:
          type: string
          description:
            Id provided by the partner that can be used to identify the
            transaction
        logs:
          type: object
          additionalProperties:
            type: string
          description:
            The data which plugin want to forward to merchant. Those are
            not handled by Payment API.
      additionalProperties: true
      description: The result returned by plugin code.
    ApiErrorsMap:
      type: object
      additionalProperties:
        type: array
        items:
          "$ref": "#/components/schemas/ApiError"
    DefaultSessionSolutionApplication:
      type: object
      properties:
        order:
          "$ref": "#/components/schemas/Order"
        hook:
          "$ref": "#/components/schemas/HookURL"
        amount:
          type: number
          description:
            Amount to be processed for this specific request. This can
            be different than order amount.
          example: 10.99
        partner:
          type: string
        method:
          type: string
      additionalProperties: true
    InitPluginResult:
      type: object
      properties:
        status:
          type: string
          description: The status code as returned by partner.
          example: 000.100.200
        amount:
          type: number
          description:
            The amount which was actually interpreted by partner. Sometimes,
            it can be different than requested amount, so make sure you double check
            it.
          example: 5
        currency_code:
          type: string
          description: The currency code which was actually interpreted by partner.
          example: EUR
        token:
          type: string
          description:
            The partner token in case customer wanted to register his payment
            method for faster further payments.
          nullable: true
          deprecated: true
        loyalty:
          type: string
          description:
            The partner token unique identified in case customer wanted
            to register his payment method for faster further payments. This is used
            for some partner which generates a new token each time. For such partner,
            loyalty is an image of the payment means used, while token is a reference
            to one of the transaction using that loyalty.
          nullable: true
          deprecated: true
        integrated_token:
          type: array
          description: Token to be registered into integrated wallet.
          items:
            "$ref": "#/components/schemas/Token"
        payment_data:
          "$ref": "#/components/schemas/PaymentDataResponse"
        partner_data:
          "$ref": "#/components/schemas/PartnerDataResponse"
        partner_reference:
          type: string
          description:
            Id provided by the partner that can be used to identify the
            transaction
        logs:
          type: object
          additionalProperties:
            type: string
          description:
            The data which plugin want to forward to merchant. Those are
            not handled by Payment API.
      additionalProperties: true
      description: The result returned by plugin code.
    InitResult:
      type: object
      properties:
        id:
          type: string
          description: The ID of the session or transaction created for the request.
          format: uuid
          example: 4bd31c68-8cc8-4db1-982a-5e8e7bfd87c9
          deprecated: true
        session_id:
          type: string
          format: uuid
        partner:
          type: string
          description: The partner on which this result is associated.
          example: braintree
        method:
          type: string
          description: The method on which this result is associated.
          example: paypal
        status:
          "$ref": "#/components/schemas/Status"
        date:
          type: string
          description:
            The date on which this result was computed. For synchronous
            response, it will be set to the current date.
          format: date-time
          example: "2020-08-25T10:42:59+02:00"
        plugin_result:
          "$ref": "#/components/schemas/InitPluginResult"
        step_id:
          type: integer
          format: int32
      additionalProperties: true
    Contract:
      type: object
      properties:
        optional:
          "$ref": "#/components/schemas/Order"
        mandatory:
          "$ref": "#/components/schemas/Order"
      additionalProperties: true
      description:
        All the possible actions on transaction, along with required parameters
        to execute those.
    Front:
      type: object
      properties:
        settings:
          "$ref": "#/components/schemas/Settings"
        labels:
          uniqueItems: true
          type: array
          description: Some labels to mark potentially different front behaviors
          example: primary, simulation,...
          items:
            type: string
            description: Some labels to mark potentially different front behaviors
            example: primary, simulation,...
        instant:
          type: boolean
          description:
            "Is the payment processed by underlying partner directly or
            may it be slowed down (e.g.: manual process, daily payment submission,...)
            ?"
          example: true
        position:
          type: integer
          description:
            Determine the order in which the payment are displayed in widget
            (lowest position first)
          format: int32
          example: 0
        stable:
          type: boolean
          description: Is the payment experience stable ?
          example: true
        contracts:
          type: object
          additionalProperties:
            "$ref": "#/components/schemas/Contract"
          description:
            All the possible actions on session, along with required parameters
            to execute those
        template:
          type: string
          description: |2
                Template to use on widget. This allows to generify front end integration and regroup similar payment method.
                This is only to the usage of widget integration but API integration can use it to generify as well.
                Note that templates can not be listed as such since they are not provided by Payment API but by plugins.
          example: aci_creditcard
        merchant_specifics:
          type: object
          additionalProperties:
            type: string
            description:
              Merchant specifics criteria used for workflow not handled
              natively by the Payment API. It can be useful to filter some mean of
              payments.
          description:
            Merchant specifics criteria used for workflow not handled natively
            by the Payment API. It can be useful to filter some mean of payments.
      additionalProperties: true
      description: Configurations needed by the frontend to setup payment.
    Id:
      type: object
      properties:
        method:
          type: string
          description: The method on which the action should be performed.
          example: paypal
        partner:
          type: string
          description: The partner on which the action should be performed.
          example: braintree
      additionalProperties: true
    Protocol:
      type: object
      properties:
        labels:
          type: array
          description: Some labels to mark potentially different front behaviors.
          items:
            type: string
            description: Some labels to mark potentially different front behaviors.
        configurations:
          "$ref": "#/components/schemas/Front"
        integrated_tokens:
          type: array
          description:
            The list of token saved into integrated wallet API for this
            payment solution.
          items:
            "$ref": "#/components/schemas/WalletToken"
        contracts:
          type: object
          additionalProperties:
            "$ref": "#/components/schemas/Contract"
          description:
            All the possible actions on transaction, along with required
            parameters to execute those.
      additionalProperties: true
      description: For each solution, the requirements to use that solution.
      example:
        partner_name_1:
          method_name:
            contracts:
              INIT:
                mandatory: {}
              APPLY:
                mandatory: {}
                optional: {}
            configurations:
              template: string
              settings:
                direct_debit: false
                payment_time: ON_ORDER
                payment_min_amount: 0
                payment_max_amount: 999999
                pay_mix: true
                pay_express: false
                save_token: true
                pay_token: true
                refund_priority: 1
                refund_type: AUTO
                refund_backup: MANUAL
              labels:
                - complementary
        partner_name_2:
          method_name_1:
            contracts:
              INIT:
                mandatory: {}
              APPLY:
                mandatory: {}
                optional: {}
            configurations:
              template: string
              settings:
                direct_debit: false
                payment_time: ON_ORDER
                payment_min_amount: 0
                payment_max_amount: 999999
                pay_mix: true
                pay_express: false
                save_token: true
                pay_token: true
                refund_priority: 1
                refund_type: AUTO
                refund_backup: MANUAL
              labels:
                - complementary
          method_name_2:
            contracts:
              INIT:
                mandatory: {}
              APPLY:
                mandatory: {}
                optional: {}
            configurations:
              template: string
              settings:
                direct_debit: false
                payment_time: ON_ORDER
                payment_min_amount: 0
                payment_max_amount: 999999
                pay_mix: true
                pay_express: false
                save_token: true
                pay_token: true
                refund_priority: 1
                refund_type: AUTO
                refund_backup: MANUAL
              labels:
                - complementary
    SessionProtocols:
      required:
        - failure
        - success
      type: object
      properties:
        id:
          type: string
          description: The ID of the session created for the request.
          example: 4bd31c68-8cc8-4db1-982a-5e8e7bfd87c9
        currency_code:
          type: string
          description: The currency code for which the session was created.
          format: ISO 4217 format
          example: EUR
        protocols:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              "$ref": "#/components/schemas/Protocol"
            description: For each solution, the requirements to use that solution.
            example:
              partner_name_1:
                method_name:
                  contracts:
                    INIT:
                      mandatory: {}
                    APPLY:
                      mandatory: {}
                      optional: {}
                  configurations:
                    template: string
                    settings:
                      direct_debit: false
                      payment_time: ON_ORDER
                      payment_min_amount: 0
                      payment_max_amount: 999999
                      pay_mix: true
                      pay_express: false
                      save_token: true
                      pay_token: true
                      refund_priority: 1
                      refund_type: AUTO
                      refund_backup: MANUAL
                    labels:
                      - complementary
              partner_name_2:
                method_name_1:
                  contracts:
                    INIT:
                      mandatory: {}
                    APPLY:
                      mandatory: {}
                      optional: {}
                  configurations:
                    template: string
                    settings:
                      direct_debit: false
                      payment_time: ON_ORDER
                      payment_min_amount: 0
                      payment_max_amount: 999999
                      pay_mix: true
                      pay_express: false
                      save_token: true
                      pay_token: true
                      refund_priority: 1
                      refund_type: AUTO
                      refund_backup: MANUAL
                    labels:
                      - complementary
                method_name_2:
                  contracts:
                    INIT:
                      mandatory: {}
                    APPLY:
                      mandatory: {}
                      optional: {}
                  configurations:
                    template: string
                    settings:
                      direct_debit: false
                      payment_time: ON_ORDER
                      payment_min_amount: 0
                      payment_max_amount: 999999
                      pay_mix: true
                      pay_express: false
                      save_token: true
                      pay_token: true
                      refund_priority: 1
                      refund_type: AUTO
                      refund_backup: MANUAL
                    labels:
                      - complementary
          description: For each solution, the requirements to use that solution.
          example:
            partner_name_1:
              method_name:
                contracts:
                  INIT:
                    mandatory: {}
                  APPLY:
                    mandatory: {}
                    optional: {}
                configurations:
                  template: string
                  settings:
                    direct_debit: false
                    payment_time: ON_ORDER
                    payment_min_amount: 0
                    payment_max_amount: 999999
                    pay_mix: true
                    pay_express: false
                    save_token: true
                    pay_token: true
                    refund_priority: 1
                    refund_type: AUTO
                    refund_backup: MANUAL
                  labels:
                    - complementary
            partner_name_2:
              method_name_1:
                contracts:
                  INIT:
                    mandatory: {}
                  APPLY:
                    mandatory: {}
                    optional: {}
                configurations:
                  template: string
                  settings:
                    direct_debit: false
                    payment_time: ON_ORDER
                    payment_min_amount: 0
                    payment_max_amount: 999999
                    pay_mix: true
                    pay_express: false
                    save_token: true
                    pay_token: true
                    refund_priority: 1
                    refund_type: AUTO
                    refund_backup: MANUAL
                  labels:
                    - complementary
              method_name_2:
                contracts:
                  INIT:
                    mandatory: {}
                  APPLY:
                    mandatory: {}
                    optional: {}
                configurations:
                  template: string
                  settings:
                    direct_debit: false
                    payment_time: ON_ORDER
                    payment_min_amount: 0
                    payment_max_amount: 999999
                    pay_mix: true
                    pay_express: false
                    save_token: true
                    pay_token: true
                    refund_priority: 1
                    refund_type: AUTO
                    refund_backup: MANUAL
                  labels:
                    - complementary
        success:
          type: string
          description:
            Where to redirect customer in case of succeeded payment. If
            your system handle a single URL, you can set it to same URL than failure.
          format: url
          example: https://example.com/return-after-payment/order000001
        failure:
          type: string
          description:
            Where to redirect customer in case of failed payment. If your
            system handle a single URL, you can set it to same URL than success.
          format: url
          example: https://example.com/return-after-payment/order000001
        amount:
          type: number
          description: The amount for which the session was created.
          example: 20
        expiration_date:
          type: string
          description:
            The date on which the created session will be marked as expired
            and will not accept payment submissions.
          format: date-time
          example: "2030-08-25T10:42:59+02:00"
      additionalProperties: true
    Settings:
      type: object
      properties:
        save_token:
          type: boolean
          description:
            If true, customer will be able to request the registration
            of his mean of payment. This setting is relevant only for payment able
            to process token payment.
          example: true
        pay_token:
          type: boolean
          description:
            If true, customer will be able to pay with a registred mean
            of payment. This setting is relevant only for payment able to process
            token payment.
          example: true
        refund_priority:
          type: integer
          description: |-
            The priority of this payment experience when doing partial refunds (the higher the value, the lowest the priority).
            Payment API does not check this setting, it has to be evaluated by the merchant.
            Payment API does not check this setting, it has to be evaluated by the merchant.
          format: int32
          example: 0
        payment_max_amount:
          type: number
          description:
            Maximum amount payable with this payment mean. If not defined,
            no maximum amount is appllied.
          example: 199.99
        pay_mix:
          type: boolean
          description:
            If true, customer will be able to mix prepaid and standard
            payment.
          example: true
        pay_express:
          type: boolean
          description:
            If true, customer will be able to pay with this payment mean
            in an express context.
          example: true
        direct_debit:
          type: boolean
          description: |-
            Is the payment captured right after the application or does it need to be asked manually ?
                    This setting is relevant only for payment able to process direct payment without capture request.
                    If payment is only supporting direct payment, this setting is set to true and not editable.
          example: true
        payment_min_amount:
          type: number
          description:
            Minimum amount payable with this payment mean. If not defined,
            no minimum amount is requested.
          example: 79.99
        payment_time:
          type: string
          description: |
            The order's lifecycle instant on which the capture should be requested by merchant according to partner plugin configuration.
            Payment API does not check this setting, it has to be evaluated by the merchant.
            This setting is relevant only for payment requiring a capture request (directDebit = false).
          example: ON_ORDER
          enum:
            - ON_SHIPMENT
            - ON_ORDER
            - ON_PREPARATION
            - ON_DELIVERY
            - POST_DELIVERY
        merchant_specifics:
          type: object
          additionalProperties:
            type: string
            description: |-
              Map of additional settings specific to the merchant.
              Payment API does not validated nor uses these settings, they are only returned to merchant to create some partner-specific workflows.
          description: |-
            Map of additional settings specific to the merchant.
            Payment API does not validated nor uses these settings, they are only returned to merchant to create some partner-specific workflows.
        refund_type:
          type: string
          description: Describes how to refund a payment.
          example: AUTO
          enum:
            - AUTO
            - MANUAL
            - CREDIT
        refund_backup:
          type: string
          description:
            Alternative way to refund a payment if the original attempt
            fails.
          example: MANUAL
          enum:
            - MANUAL
            - CREDIT
      additionalProperties: true
      description:
        Some core settings to manage payment experience features enabling
        and availability
    WalletToken:
      type: object
      properties:
        value:
          type: string
        id:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
        payment_id:
          "$ref": "#/components/schemas/Id"
        expiration_date:
          type: string
          format: date-time
        uniqueness_token:
          type: string
        owner_reference:
          type: string
        merchant:
          type: string
        pin_code:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        description:
          "$ref": "#/components/schemas/WalletTokenDescription"
      additionalProperties: true
    WalletTokenDescription:
      type: object
      properties:
        brand_name:
          type: string
        display_token:
          type: string
        holder_name:
          type: string
      additionalProperties: true
    ListActionResult:
      type: array
      items:
        "$ref": "#/components/schemas/ActionResult"
    WalletApiTokenRequest:
      required:
        - description
        - expiration_date
        - payment_id
        - token
      type: object
      properties:
        token:
          type: string
        uniqueness_token:
          type: string
        pin_code:
          type: string
        expiration_date:
          type: string
          format: date-time
        description:
          $ref: "#/components/schemas/WalletApiTokenDescription"
        payment_id:
          $ref: "#/components/schemas/WalletApiPaymentId"
        reason:
          type: string
      description: Token to add
    WalletApiPaymentId:
      required:
        - method
        - partner
      type: object
      properties:
        partner:
          type: string
        method:
          type: string
    WalletApiSessionProjection:
      type: object
      properties:
        session_id:
          type: string
          format: uuid
        owner_reference:
          type: string
        merchant:
          type: string
        expiration_date:
          type: string
          format: date-time
    WalletApiSessionRequest:
      required:
        - owner_reference
      type: object
      properties:
        owner_reference:
          type: string
          description: Reference or Id of the customer
    WalletApiTokenDescription:
      required:
        - brand_name
        - display_token
      type: object
      properties:
        brand_name:
          type: string
        display_token:
          type: string
        holder_name:
          type: string
    WalletApiTokenProjection:
      type: object
      properties:
        id:
          type: string
          format: uuid
        uniqueness_token:
          type: string
        pin_code:
          type: string
        expiration_date:
          type: string
          format: date-time
        owner_reference:
          type: string
        merchant:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
        description:
          $ref: "#/components/schemas/WalletApiTokenDescription"
        payment_id:
          $ref: "#/components/schemas/WalletApiPaymentId"
        created_at:
          type: string
          format: date-time
        value:
          type: string
        updated_at:
          type: string
          format: date-time
        favorite:
          type: boolean
    WalletApiUpdateStatusRequest:
      required:
        - status
      type: object
      properties:
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
        reason:
          type: string
    DefaultInitPosRequest:
      type: object
      properties:
        method:
          type: string
          description: The method on which this result is associated.
          example: softpos
        partner:
          type: string
          description: The partner on which this result is associated.
          example: illicado
        amount:
          type: number
          description: The total amount of this item including vat.
          example: 399.98
        payment_data:
          "$ref": "#/components/schemas/PaymentDataPosResponse"
    PaymentDataPosResponse:
      type: object
      properties:
        card:
          "$ref": "#/components/schemas/CardPosResponse"
    CardPosResponse:
      type: object
      properties:
        number:
          type: string
          description: Number of the card
    DefaultCapturePosRequest:
      type: object
      properties:
        method:
          type: string
          description: The method on which this result is associated.
          example: softpos
        partner:
          type: string
          description: The partner on which this result is associated.
          example: illicado
        amount:
          type: number
          description: The total amount of this item including vat.
          example: 399.98
        payment_data:
          "$ref": "#/components/schemas/PaymentDataPosResponse"
        order:
          "$ref": "#/components/schemas/OrderDataPos"
    OrderDataPos:
      type: object
      properties:
        reference:
          type: string
          description:
            Merchant reference of the order usually displayed to customer.
            This identifier should be unique per merchant but there is no check in
            the Payment API over it; it is solely used to either search and eventually
            provide it to the payment partner.
        currency_code:
          type: string
          description:
            Currency code of the order (ISO 4217 format). Usually the merchant
            default currency code.
          format: ISO 4217
          example: EUR

  securitySchemes:
    ApiKey:
      type: apiKey
      name: x-api-key
      in: header
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.purse-sandbox.com/payment/v1/oauth/token
          scopes: {}
    BasicAuth:
      type: http
      scheme: basic
    Oauth2TokenResponse:
      description: OAuth2 Response for the request of a Bearer Token
      type: object
      properties:
        access_token:
          description: Access Token to be used in accessing protected endpoints
          type: string
        expires_in:
          description: The lifetime in seconds of the Access Token
          type: integer
        scope:
          description: The scope of the Access Token
          type: string
        token_type:
          description: The type of the Token issued
          type: string
      required:
        - access_token
        - expires_in
        - token_type
      example:
        access_token: 2YotnFZFEjr1zCsicMWpAA
        token_type: Bearer
        expires_in: 3600