openapi: 3.0.3
info:
  title: Wallet API
  description: API for managing wallet tokens
  version: v2
servers:
  - url: https://api.purse-sandbox.com/wallet
    description: Wallet API
tags: 
  - name: Widget Wallet API
    description: API for managing wallet sessions and tokens in the widget context
paths:
  /v2/session:
    servers:
      - url: https://api.purse-sandbox.com/wallet  
    post:
      tags:
        - Widget Wallet API
      summary: Create a  widget wallet session
      operationId: createWidetWalletSession
      parameters:
        - name: x-merchant-id
          in: header
          required: true
          description: Specific id of the merchant
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WalletApiSessionRequest"
        required: true
      responses:
        "201":
          description: Created
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/WalletApiSessionProjection"
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/ApiError"
      security:
        - OAuth2: []
        - ApiKey: []
  /v2/{{customer_id}}/sessions/{{wallet_session_id}}/tokens?vault=true:
    servers:
      - url: https://api.purse-sandbox.com/wallet    
    get:
      tags:
        - Widget Wallet API
      summary: Get tokens of an owner
      operationId: getTokens
      parameters:
        - name: x-merchant-id
          in: header
          description: Specific id of the merchant
          required: true
          schema:
            type: string
        - name: customer_id
          description: Reference or Id of the customer
          in: path
          required: true
          schema:
            type: string
        - name: wallet_session_id
          description: Id of the wallet Session
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - ACTIVE
              - INACTIVE
      responses:
        "200":
          description: The list of tokens
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/WalletApiTokenProjection"
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/ApiError"
      security:
        - OAuth2: []
        - ApiKey: []
  /v2/{customer_id}/tokens/{token_id}:
    servers:
      - url: https://api.purse-sandbox.com/wallet    
    delete:
      tags:
        - Widget Wallet API
      summary: Delete one single token of an owner
      operationId: deleteOneToken
      parameters:
        - name: x-merchant-id
          in: header
          description: Specific id of the merchant
          required: true
          schema:
            type: string
        - name: customer_id
          description: Reference or Id of the customer
          in: path
          required: true
          schema:
            type: string
        - name: token_id
          description: Id of the token
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "204":
          description: The token has been deleted
        "400":
          description: Bad Request
          content:
            "*/*":
              schema:
                $ref: "#/components/schemas/ApiError"
      security:
        - OAuth2: []
        - ApiKey: []
  /v2/{{customer_id}}/sessions/{{wallet_session_id}}/token/{{tokenId}}/favorite:
    servers:
      - url: https://api.purse-sandbox.com/wallet    
    patch:
      tags:
        - Widget Wallet API
      summary: Set a token as favorite
      operationId: setFavorite
      parameters:
        - name: x-merchant-id
          in: header
          description: Specific id of the merchant
          required: true
          schema:
            type: string
        - name: customer_id
          description: Reference or Id of the customer
          in: path
          required: true
          schema:
            type: string
        - name: wallet_session_id
          in: path
          description: Id of the Wallet Session of the customer
          required: true
          schema:
            type: string
            format: uuid
        - name: token_id
          in: path
          description: Id of the token
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: The token has been updated
        "400":
          description: The token does not exist or is already favorite
      security:
        - OAuth2: []
        - ApiKey: []
components:
  securitySchemes:
    purse_oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.purse-live.com/oauth2/token
          scopes:
            payment-api: use payment-api
    api_key:
      type: apiKey
      name: api_key
      in: header
  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  
    AbortClientSessionApplication:
      type: object
      description: Contextual information in order to abort the client session
      required:
        - status
      properties:
        status:
          description: The new status of the aborted client session.
          type: string
          enum:
            - ABORTED_BY_CUSTOMER
            - ABORTED_BY_MERCHANT
      example:
        status: 'ABORTED_BY_CUSTOMER'
    Currency:
      type: string
      description: ISO 4217 currency code
      enum:
        - CHF
        - EUR
        - GBP
        - JPY
        - USD
      example: EUR
    CaptureMode:
      type: string
      enum:
        - MANUAL
        - AUTOMATIC
      default: MANUAL
      example: MANUAL
      description: |
        Capture mode for the payment.
        * `MANUAL` - The merchant will manually capture the payment.
        * `AUTOMATIC` - The payment will be automatically captured.
    IntegrationMode:
      type: string
      enum:
        - EMBEDDED
        - HOSTED_PAGE
      default: EMBEDDED
      example: HOSTED_PAGE
      description: |
        Integration mode for the payment.
        * `EMBEDDED` - Widget will be setup by the merchant on its own page.
        * `HOSTED_PAGE` - Widget will be hosted and setup by Purse.
    ItemLine:
      type: object
      description: Information regarding the item.
      properties:
        type:
          type: string
          description: Type of item
          example: PHYSICAL
          enum:
            - PHYSICAL
            - DIGITAL
            - SHIPPING_FEES
        sku_reference:
          type: string
          description: Reference of the item for the merchant system
          example: SKU_01
        name:
          type: string
          description: Name of the item
          example: My awesome product
        brand:
          type: string
          description: Brand of the item
          example: My awesome brand
        unit_gross_price:
          type: integer
          description: |
            Gross price of the item in currency minor unit.
            Unit price excluding taxes and discounts.
          example: 1099
        net_amount:
          type: integer
          description: |
            Net amount of the item line in currency minor unit.
            Including taxes and discounts.
          example: 4299
        discount_amount:
          type: integer
          description: |
            Discount amount of the item line in currency minor unit
          deprecated: true
          example: 0
        quantity:
          type: integer
          description: Quantity of the item
          example: 4
        tax_amount:
          type: integer
          description: Tax amount of the item line in currency minor unit.
          example: 399
        tax_rate:
          type: number
          description: Tax rate of the item line.
          example: 20
        seller_reference:
          type: string
          description: Reference of the seller for the merchant system
          example: SELLER_01
        seller_name:
          type: string
          description: Name of the seller
          example: My awesome seller
        is_marketplace_seller:
          type: boolean
          description: Is the item sold by a marketplace seller
          example: true
    Shipment:
      type: object
      description: Information regarding shipping / delivery and the items to be shipped.
      properties:
        net_amount:
          type: integer
          description: Total amount of the shipment in currency minor unit.
          example: 4299
        delivery_type:
          type: string
          description: Type of shipment
          example: USER_DELIVERY
          enum:
            - USER_DELIVERY
            - STORE_PICKUP
            - EXTERNAL_PICKUP
            - SHELF_PICKUP
            - DIGITAL_DELIVERY
        delivery_quickness:
          type: string
          description: Quickness of the shipment
          example: EXPRESS
          enum:
            - IMMEDIATE
            - EXPRESS
            - SAME_DAY
            - REGULAR
        delivery_method_reference:
          type: string
          description: Reference of the delivery method for the merchant system
          example: DHL
        estimated_delivery_date_time:
          type: string
          description: Estimated delivery date
          format: date-time
          example: '2020-08-25T10:42:59+02:00'
        shipping_address:
          type: object
          properties:
            company_name:
              type: string
              example: ACME
            gender:
              type: string
              enum:
                - MALE
                - FEMALE
                - UNKNOWN
            first_name:
              type: string
              example: Emily
            middle_name:
              type: string
              example: Rose
            last_name:
              type: string
              example: Parker
            address_lines:
              type: array
              items:
                type: string
                example: 1st Street
              maxItems: 5
            city:
              type: string
              example: New York
            postal_code:
              type: string
              example: '10001'
            country_code:
              type: string
              example: US
              description: ISO 3166-1 alpha-2 country code
            province_code:
              type: string
              example: NY
              description: ISO 3166-2 country subdivision code
            phone_number:
              type: string
              example: '+526645951538'
              format: EP-164
              description: |
                The customer's phone number at this address.
                The phone number must be in the E.164 format, for example, +526645951538.
            mobile_phone_number:
              type: string
              example: '+526645951538'
              format: EP-164
              description: |
                The customer's mobile phone number at this address.
                The phone number must be in the E.164 format, for example, +526645951538.
            work_phone_number:
              type: string
              example: '+526645951538'
              format: EP-164
              description: |
                The customer's work phone number at this address.
                The phone number must be in the E.164 format, for example, +526645951538.
            delivery_point_name:
              type: string
              description: Name of the delivery point
              example: Le Trop Quai.
        item_lines:
          type: array
          description: List of all items for the shipment.
          items:
            $ref: '#/components/schemas/ItemLine'
    Address:
      type: object
      properties:
        company_name:
          type: string
          example: Company name
        gender:
          type: string
          enum:
            - MALE
            - FEMALE
            - UNKNOWN
        first_name:
          type: string
          example: Miles
        middle_name:
          type: string
          example: Eva
        last_name:
          type: string
          example: Morales
        address_lines:
          type: array
          items:
            type: string
            example: 1st Street
          maxItems: 5
        city:
          type: string
          example: New York
        postal_code:
          type: string
          example: '10001'
        country_code:
          type: string
          example: US
          description: ISO 3166-1 alpha-2 country code
        province_code:
          type: string
          example: NY
          description: ISO 3166-2 country subdivision code
        phone_number:
          type: string
          example: '+526645951538'
          format: EP-164
          description: |
            The customer's phone number at this address.
            The phone number must be in the E.164 format, for example, +526645951538.
        mobile_phone_number:
          type: string
          example: '+526645951538'
          format: EP-164
          description: |
            The customer's mobile phone number at this address.
            The phone number must be in the E.164 format, for example, +526645951538.
        work_phone_number:
          type: string
          example: '+526645951538'
          format: EP-164
          description: |
            The customer's work phone number at this address.
            The phone number must be in the E.164 format, for example, +526645951538.
    Order:
      type: object
      description: Information regarding the order and the items to be purchased.
      required:
        - reference
      properties:
        reference:
          type: string
          example: order_01
          description: Reference used to identify the order in the merchant system. Whenever possible, this reference will be propagated to the payment partners.
        net_amount:
          type: integer
          minimum: 1
          description: Total amount of the order in currency minor unit. Including taxes and discounts. Order amount must be greater or equal than payment amount.
          example: 4299
        discount_amount:
          type: integer
          minimum: 0
          description: Discount amount of the order in currency minor unit. If discounts are provided at item_line level, this amount must be equal to the sum of all item_line discount_amount.
          deprecated: true
          example: 500
        tax_amount:
          type: integer
          minimum: 0
          description: Tax amount of the order in currency minor unit. If taxes are provided at item_line level, this amount must be equal to the sum of all item_line tax_amount.
          example: 3582
        shipments:
          type: array
          description: List of all shipments for the order.
          items:
            $ref: '#/components/schemas/Shipment'
        billing_address:
          $ref: '#/components/schemas/Address'
        discounts:
          type: array
          items:
            $ref: '#/components/schemas/Discount'
    
    Account:
      type: object
      description: Additional information of customer (account, history with the merchant...).
      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'
        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
    Customer:
      type: object
      description: Information regarding the customer purchasing the order.
      properties:
        reference:
          type: string
          example: customer_01
          description: This reference will be used to identify the customer in the merchant system.
        email:
          type: string
          format: email
          example: eva.morales@example.org
        type:
          type: string
          enum:
            - PERSON
            - COMPANY
          example: PERSON
        company_identifier:
          type: string
          description: National company identification number (country specific).
          example: "12345678900012"  
        company_name:
          type: string
          example: Company name
        gender:
          type: string
          enum:
            - MALE
            - FEMALE
            - UNKNOWN
        first_name:
          type: string
          example: Miles
        middle_name:
          type: string
          example: Eva
        last_name:
          type: string
          example: Morales
        national_identifier:
          type: string
          description: National identification number of the customer (country specific).
          example: "MX-1234567890"  
        birth_date:
          type: string
          format: date
          example: '1980-01-01'
        ip_address:
          type: string
          example: 45.15.207.98
          description: Customer IP address, V4 or V6
        locale:
          type: string
          example: en-US
          description: Customer locale, BCP 47
        account:
          $ref: '#/components/schemas/Account'
      
    PaymentThreeDsAuthenticationOptions:
      type: object
      description: Options for 3DS authentication.
      properties:
        challenge_indicator:
          type: string
          enum:
            - NO_PREFERENCE
            - NO_CHALLENGE_REQUESTED
            - CHALLENGE_REQUESTED_BY_MERCHANT
            - CHALLENGE_REQUESTED_BY_MANDATE
            - NO_CHALLENGE_REQUESTED_RISK_ANALYSIS_ALREADY_PERFORMED
            - NO_CHALLENGE_REQUESTED_DATA_SHARE_ONLY
            - NO_CHALLENGE_REQUESTED_STRONG_AUTHENTICATION_ALREADY_PERFORMED
            - NO_CHALLENGE_REQUESTED_BY_TRUST_LIST
            - CHALLENGE_REQUESTED_BY_TRUST_LIST
          example: NO_PREFERENCE
        challenge_exemption:
          type: string
          enum:
            - TRANSACTION_RISK_ANALYSIS
            - TRUSTED_BENEFICIARY
            - LOW_VALUE
            - SECURE_CORPORATE
          example: LOW_VALUE
      
    Webhook:
      type: object
      description: If provided, merchant will receive webhook requests on the provided URL after each change in the client session status.
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          example: https://www.example.org/payment-hook?order_id=123456789
          description: URL to which webhooks will be sent via a POST request.
        headers:
          type: array
          description: Optional headers to be sent with the webhook request.
          items:
            type: object
            required:
              - name
              - values
            properties:
              name:
                type: string
                example: x-order-id
              values:
                type: array
                minItems: 1
                items:
                  type: string
                  example: 123456789
    ClientSessionApplication:
      description: Application used to create a client session.
      type: object
      required:
        - entity_id
        - amount
        - currency
        - order
        - shopper_redirection_url
      properties:
        entity_id:
          type: string
          format: uuid
          description: |
            ID of the entity that is using the orchestration API.
            This ID is provided by Purse.
        amount:
          type: integer
          example: 4299
          minimum: 0
          exclusiveMinimum: true
          description: Amount to be payed in currency minor unit. For example, 4299 is 42.99 EUR
        currency:
          $ref: '#/components/schemas/Currency'
        capture_mode:
          $ref: '#/components/schemas/CaptureMode'
        integration_mode:
          $ref: '#/components/schemas/IntegrationMode'
        allow_future_usage:
          default: false
          type: boolean
          description: |
            When `true`, the payment associated to the client-session might be used to create future MIT.
            For creditcard payment `/three_ds_authentication_options/challenge_indicator` must be sent as `CHALLENGE_REQUESTED_BY_MERCHANT`
        shopper_redirection_url:
          type: string
          format: uri
          example: https://www.example.org/payment-callback?order_id=123456789
          description: |
            URL to which the shopper will be redirected after the payment process.
            Redirection will use HTTP GET
        order:
          $ref: '#/components/schemas/Order'
        customer:
          $ref: '#/components/schemas/Customer'
        three_ds_authentication_options:
          $ref: '#/components/schemas/PaymentThreeDsAuthenticationOptions'
        webhook:
          $ref: '#/components/schemas/Webhook'
      example:
        entity_id: 5e3a0862-7cc3-4427-92ba-9e1e9595f571
        amount: 12000
        currency: EUR
        capture_mode: MANUAL
        allow_future_usage: false
        shopper_redirection_url: https://example.org/redirect?order_id=123456789
        customer:
          reference: '2090000000000'
          type: PERSON
          email: emily.rose.parker@example.org
          gender: FEMALE
          first_name: Emily
          middle_name: Rose
          last_name: PARKER
          national_identifier: 'MX-1234567890'
          birth_date: '1995-08-25'
          ip_address: 203.0.113.195
          locale: fr-FR
          account:
            creation_date_time: '2017-06-15T15:30:00+02:00'
            update_date_time: '2023-02-20T20:54:00+01:00'
            password_update_date_time: '2023-02-20T20:54:00+01:00'
            purchase_count_last_day: 0
            purchase_count_last_six_months: 3
            purchase_count_last_year: 8
            authentication_method: MERCHANT_CREDENTIALS
            authentication_date_time: '2023-10-30T15:33:00+02:00'
            age_indicator: MORE_60_DAYS
            change_indicator: MORE_60_DAYS
            password_change_indicator: MORE_60_DAYS
        order:
          reference: '123456789'
          net_amount: 12000
          tax_amount: 2000
          billing_address:
            gender: FEMALE
            first_name: Emily
            middle_name: Rose
            last_name: PARKER
            address_lines:
              - NextNow
              - 67 Rue de Luxembourg
            city: Lille
            postal_code: '59777'
            country_code: FR
            province_code: FR-HDF
            phone_number: '+33111111111'
            mobile_phone_number: '+33222222222'
            work_phone_number: '+33444444444'
          shipments:
            - net_amount: 12000
              delivery_type: EXTERNAL_PICKUP
              delivery_quickness: REGULAR
              delivery_method_reference: '#1123-pickup'
              estimated_delivery_date_time: '2023-10-30T15:40:00+02:00'
              shipping_address:
                gender: FEMALE
                first_name: Rodriguez
                middle_name: Eios
                last_name: DESANTONS
                address_lines:
                  - Av. de la roja 1676
                city: Porto
                postal_code: '22000'
                country_code: PT
                province_code: PT-13
                phone_number: '+33555555555'
                mobile_phone_number: '+33666666666'
                work_phone_number: '+33777777777'
                delivery_point_name: home
              item_lines:
                - type: PHYSICAL
                  sku_reference: '2600218'
                  name: Camiseta100 niño GYM
                  brand: Quivio
                  unit_gross_price: 5000
                  net_amount: 12000
                  quantity: 2
                  tax_amount: 2000
                  tax_rate: 20
                  seller_reference: '#42-ACME'
                  seller_name: Acme Corp
                  is_marketplace_seller: true
                - type: SHIPPING_FEES
                  name: Transporte
                  net_amount: 0
                  unit_gross_price: 0
                  quantity: 1
                  tax_amount: 0
                  tax_rate: 0
        three_ds_authentication_options:
          challenge_indicator: NO_CHALLENGE_REQUESTED
        webhook:
          url: https://www.example.org/payment-hook
          headers:
            - name: x-order-id
              values:
                - '123456789'
    EligibleSolution:
      type: object
      description: Eligible solution for the client session.
      required:
        - partner
        - method
      properties:
        partner:
          type: string
          description: Payment solution partner.
        method:
          type: string
          description: Payment solution method.
    AuthorizationStatus:
      type: string
      description: Status for an authorization transaction.
      enum:
        - AUTHORIZED
        - PENDING
        - UNCERTAIN
        - ERROR
        - ABORTED
        - REFUSED
    PartnerTransaction:
      type: object
      required:
        - id
        - created_at
        - updated_at
        - amount
        - partner
        - method
      description: Representation of the partner transaction.
      properties:
        id:
          description: Id of the partner transaction (provided by Purse).
          type: string
          format: uuid
          example: e3a6516b-0ec4-4a5b-92b0-7bb9693e82c1
        created_at:
          description: Partner transaction creation date time.
          type: string
          format: date-time
        updated_at:
          description: Partner transaction updated date time.
          type: string
          format: date-time
        amount:
          description: Amount of the partner transaction in currency minor unit.
          type: integer
          example: 4299
        partner:
          description: Partner that processed the transaction.
          type: string
          example: ingenico
        method:
          description: Method used to process the transaction.
          type: string
          example: creditcard
        partner_reference:
          description: Reference of the transaction in the partner system.
          type: string
          example: AE0002ZCF7652QFF
        partner_status:
          description: Status of the transaction in the partner system.
          type: string
          example: 000.000.000
        partner_status_description:
          description: Description of the status of the transaction in the partner system.
          type: string
          example: Transaction succeeded
        partner_token:
          description: Token of the transaction in the partner system.
          type: string
          example: f8a333e9-cdc2-45d1-b9e5-dba95e00fa95
    ThreeDSOutcome:
      description: 3DS information for the partner transaction (only provided for authorization transactions).
      type: object
      required:
        - eci
        - version
        - flow
        - ds_transaction_id
        - acs_transaction_id
      properties:
        eci:
          description: Electronic Commerce Indicator. Payment System-specific value provided by the ACS or DS to indicate the results of the attempt to authenticate the Cardholder
          type: string
          enum:
            - '00'
            - '01'
            - '02'
            - '05'
            - '06'
            - '07'
          example: '01'
        version:
          description: 3DS version used to process the authentication.
          type: string
          example: 2.2.0
        flow:
          description: 3DS flow used to process the authentication.
          type: string
          enum:
            - CHALLENGE
            - FRICTIONLESS
          example: CHALLENGE
        ds_transaction_id:
          description: Universally unique transaction identifier assigned by the DS (Directory Server) to identify a single transaction.
          type: string
          example: f8a333e9-cdc2-45d1-b9e5-dba95e00fa95
        acs_transaction_id:
          description: Universally Unique transaction identifier assigned by the ACS (Access Control Server) to identify a single transaction.
          type: string
          example: f8a333e9-cdc2-45d1-b9e5-dba95e00fa95
    Card:
      description: Card used to process the partner transaction (only provided for authorization transactions).
      type: object
      required:
        - bin
        - last_four_digits
        - holder_name
        - expiry_month
        - expiry_year
        - selected_network
        - three_ds
      properties:
        bin:
          description: First 6/8 digits of the card number. (Bank Identification Number)
          type: string
          example: '513842'
        last_four_digits:
          description: Last 4 digits of the card number.
          type: string
          example: '1234'
        holder_name:
          description: Name of the card holder.
          type: string
          example: John Doe
        expiry_month:
          description: Expiry month of the card. String with two digits.
          type: string
          example: '01'
        expiry_year:
          description: Expiry year of the card. String with two digits.
          type: string
          example: '24'
        selected_network:
          description: Network selected by the shopper to process the transaction.
          type: string
          enum:
            - VISA
            - MASTERCARD
            - CARTE_BANCAIRE
            - AMERICAN_EXPRESS
            - ONEY
          example: VISA
        three_ds:
          $ref: '#/components/schemas/ThreeDSOutcome'
    AuthorizePartnerTransaction:
      description: Representation of the authorize operation partner transaction.
      allOf:
        - $ref: '#/components/schemas/PartnerTransaction'
        - type: object
          properties:
            status:
              $ref: '#/components/schemas/AuthorizationStatus'
            card:
              $ref: '#/components/schemas/Card'
            remaining_amount:
              description: Remaining amount to be captured for the transaction in currency minor unit.
              type: integer
              example: 4299
    Authorization:
      type: object
      description: Authorization information for a payment or client-session.
      properties:
        updated_at:
          description: Authorization updated date time.
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/AuthorizationStatus'
        partner_transactions:
          type: array
          items:
            $ref: '#/components/schemas/AuthorizePartnerTransaction'
    Link:
      type: object
      description: HATEOAS link.
      properties:
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - DELETE
            - PATCH
        href:
          type: string
          format: uri
      example:
        href: /v2/client-sessions/9a14962c-bdcf-49d1-8673-e75dfb48013f
        method: GET
    ClientSessionLinks:
      type: object
      description: HATEOAS links for a client session.
      required:
        - self
      properties:
        self:
          description: Link to the client session resource.
          allOf:
            - $ref: '#/components/schemas/Link'
            - example:
                href: /v2/client-sessions/9a14962c-bdcf-49d1-8673-e75dfb48013f
                method: GET
        abort:
          description: Link to abort the client session.
          allOf:
            - $ref: '#/components/schemas/Link'
            - example:
                href: /v2/client-sessions/9a14962c-bdcf-49d1-8673-e75dfb48013f/abort
                method: POST
        payment:
          description: Link to the payment resource.
          allOf:
            - $ref: '#/components/schemas/Link'
            - example:
                href: /v2/payments/03e0833d-ca1c-4ea6-8af1-23b5a96ae288
                method: GET
        hosted_page:
          description: Link to the hosted page.
          allOf:
            - $ref: '#/components/schemas/Link'
            - example:
                href: https://pay.purse-env.com/entities/8f093776-fb6d-11ef-b0f9-e6c49ab1fb0a/sessions/03e0833d-ca1c-4ea6-8af1-23b5a96ae288
                method: 'GET'
    ClientSession:
      type: object
      description: Object used by the front office to initiate a payment along with the widget.
      required:
        - id
        - entity_id
        - status
        - amount
        - currency
        - shopper_redirection_url
        - capture_mode
        - expires_at
        - widget
        - eligible_solutions
      properties:
        id:
          type: string
          format: uuid
          example: 9753ec77-fc16-4886-92af-c7dcf9b7352d
        status:
          type: string
          enum:
            - CREATED
            - CHOICE_IN_PROGRESS
            - SUBMITTED
            - EXPIRED
        amount:
          type: integer
          example: 4299
          description: Amount to be payed in currency minor unit. For example, 4299 is 42.99 EUR
        currency:
          $ref: '#/components/schemas/Currency'
        capture_mode:
          $ref: '#/components/schemas/CaptureMode'
        integration_mode:
          $ref: '#/components/schemas/IntegrationMode'
        allow_future_usage:
          type: boolean
          description: |
            Default value is `false`.
            When `true`, the payment associated to the client-session might be used to create future MIT.
            For creditcard payment `/three_ds_authentication_options/challenge_indicator` must be sent as `CHALLENGE_REQUESTED_BY_MERCHANT`
        customer:
          $ref: '#/components/schemas/Customer'
        order:
          $ref: '#/components/schemas/Order'
        expires_at:
          type: string
          format: date-time
          example: '2024-08-25T10:42:59.123+02:00'
        entity_id:
          type: string
          format: uuid
          description: Entity ID for this ClientSession.
        shopper_redirection_url:
          type: string
          format: uri
          example: https://www.example.org/payment-callback?order_id=123456789
          description: |
            URL to which the shopper will be redirected after the payment process.
            Redirection will use HTTP GET
        widget:
          description: Widget information to be provided to the frontend.
          type: object
          required:
            - data
            - js_url
          properties:
            data:
              type: string
              example: w9R5pLx2E7fqA3B1cV8z0YeL
              description: Data to be provided to the widget
            js_url:
              description: URL of the widget script to be loaded by the frontend.
              type: string
              format: uri
              example: https://cdn.purse-secure.com/dropin/v3-stable/purse.js
        payment_id:
          description: ID of the payment created by the client session Only provided when the client session is in status SUBMITTED.
          type: string
          format: uuid
          example: 05c0d03f-2404-48c5-a521-bd5a57d3b355
        eligible_solutions:
          description: List of eligible solutions for the client session.
          type: array
          items:
            $ref: '#/components/schemas/EligibleSolution'
        authorization:
          $ref: '#/components/schemas/Authorization'
        links:
          $ref: '#/components/schemas/ClientSessionLinks'
    OperationIdempotencyProblemDetail:
      allOf:
        - $ref: '#/components/schemas/IdempotencyProblemDetail'
        - type: object
          properties:
            resource_id:
              type: string
              format: uuid
              description: The `resource_id` corresponds to a payment operation ID (capture/void/refund) that has already been processed with the specified idempotency key.
              example: 2e3a6516b-0ec4-4a5b-92b0-7bb9693e82c1
    PaymentIdempotencyProblemDetail:
      allOf:
        - $ref: '#/components/schemas/IdempotencyProblemDetail'
        - type: object
          properties:
            resource_id:
              type: string
              format: uuid
              description: The `resource_id` corresponds to a payment ID that has already been processed with the specified idempotency key.
              example: 1a14962c-bdcf-49d1-8673-e75dfb48013f
    IdempotencyProblemDetail:
        title: An RFC 7807 problem object
        type: object
        properties:
          type:
            type: string
            format: uri-reference
            description: A URI reference that identifies the problem type.
          title:
            type: string
            description: A short, human-readable summary of the problem type.
          status:
            type: integer
            description: |
                The HTTP status code generated by the origin server for this occurrence
                of the problem.
            minimum: 100
            maximum: 599
          instance:
            type: string
            format: uri-reference
            description: |
                A URI reference that identifies the  specific occurrence of the problem.
                It may or may not yield further information if dereferenced.
    ProblemDetail:
      title: An RFC 7807 problem object
      type: object
      properties:
        type:
          type: string
          format: uri-reference
          description: A URI reference that identifies the problem type.
        title:
          type: string
          description: A short, human-readable summary of the problem type.
        status:
          type: integer
          description: |
            The HTTP status code generated by the origin server for this occurrence
            of the problem.
          minimum: 100
          maximum: 599
        detail:
          type: string
          description: A human-readable explanation specific to this occurrence of the problem.
        instance:
          type: string
          format: uri-reference
          description: |
            A URI reference that identifies the  specific occurrence of the problem.
            It may or may not yield  further information if dereferenced.
        error:
          description: Single error detail
        errors:
          type: array
          description: Error details
          items:
            type: object
            properties:
              detail:
                type: string
                description: Error detail
              pointer:
                type: string
                description: JSON Pointer for the field
    PaymentTag:
      type: string
      description: |
        Overview :
         * `NOT` - No action performed
         * `PARTIALLY` - Action performed on partial available amount
         * `TOTALLY` - Action performed on total available amount
      enum:
        - NOT
        - PARTIALLY
        - TOTALLY
    PaymentTriggerOrigin:
      type: string
      description: |
        * `MERCHANT` - Operation triggered by an action from the merchant
        * `AUTHORIZATION` - Operation triggered by one step transaction (capture)
        * `ORCHESTRATOR` - Operation triggered by compensating transactions (void, refund)
      enum:
        - MERCHANT
        - AUTHORIZATION
        - ORCHESTRATOR
      example: MERCHANT
    PaymentOperationStatus:
      type: string
      description: Status for a payment action.
      enum:
        - SUCCESS
        - FAILURE
        - PENDING
        - CONFLICT
        - UNCERTAIN
    PaymentTransactionStatus:
      type: string
      description: Status of the partner transaction.
      enum:
        - SUCCESS
        - FAILURE
        - PENDING
        - UNCERTAIN
      example: SUCCESS
    OperationPartnerTransaction:
      description: Representation of a payment operation partner transaction. (capture, refund, void)
      allOf:
        - $ref: '#/components/schemas/PartnerTransaction'
        - properties:
            status:
              $ref: '#/components/schemas/PaymentTransactionStatus'
            remaining_amount:
              description: Remaining amount to be processed for the transaction in currency minor unit.
              type: integer
              example: 4299
          required:
            - status
    PaymentOperation:
      type: object
      required:
        - id
        - created_at
        - updated_at
        - amount
        - status
        - partner_transactions
        - triggered_by
      description: The operation can be a capture, a refund or a void. The operation can be split in multiple partner transactions.
      properties:
        id:
          description: ID of the operation (provided by Purse).
          type: string
          format: uuid
          example: e3a6516b-0ec4-4a5b-92b0-7bb9693e82c1
        amount:
          description: Amount of the operation in currency minor unit.
          type: integer
          example: 4299
        created_at:
          description: Operation creation date time.
          type: string
          format: date-time
          example: '2020-08-25T10:42:59.123+02:00'
        updated_at:
          description: Operation update date time.
          type: string
          format: date-time
          example: '2020-08-25T10:42:59.123+02:00'
        triggered_by:
          $ref: '#/components/schemas/PaymentTriggerOrigin'
        merchant_reference:
          description: Reference of the operation in the merchant system.
          type: string
          example: CAP#1223445
        status:
          $ref: '#/components/schemas/PaymentOperationStatus'
        partner_transactions:
          description: List of all partner transactions for the operation.
          type: array
          items:
            $ref: '#/components/schemas/OperationPartnerTransaction'
        order:
            $ref: '#/components/schemas/PaymentOperationOrder'
    Captures:
      description: List of all capture operations for a payment.
      type: array
      items:
        $ref: '#/components/schemas/PaymentOperation'
    Voids:
      description: List of all void operations for a payment.
      type: array
      items:
        $ref: '#/components/schemas/PaymentOperation'
    Refunds:
      description: List of all refund operations for a payment.
      type: array
      items:
        $ref: '#/components/schemas/PaymentOperation'
    PaymentAmounts:
      type: object
      description: Amount details for a payment.
      required:
        - authorize_pending
        - total_authorized
        - total_voided
        - available_to_void
        - total_captured
        - available_to_capture
        - total_refunded
        - available_to_refund
      properties:
        authorize_pending:
          description: Total amount waiting for authorization. This amount is not yet authorized.
          type: integer
          example: 0
        total_authorized:
          description: Total amount authorized for the payment. This amount does not change once the payment is authorized.
          type: integer
          example: 4299
        total_voided:
          description: Total amount voided for the payment. Only includes voided amounts that have been successfully processed.
          type: integer
          example: 299
        available_to_void:
          description: Total amount available to be voided for the payment.
          type: integer
          example: 1000
        total_captured:
          description: Total amount captured for the payment. Only includes captured amounts that have been successfully processed.
          type: integer
          example: 3000
        available_to_capture:
          description: Total amount available to be captured or void for this partner transaction.
          type: integer
          example: 1000
        total_refunded:
          description: Total amount refunded for the payment. Only includes refunded amounts that have been successfully processed.
          type: integer
          example: 0
        available_to_refund:
          description: Total amount available to be refunded for the payment.
          type: integer
          example: 3000
      example:
        total_authorized: 4299
        total_voided: 299
        available_to_void: 1000
        total_captured: 3000
        available_to_capture: 1000
        total_refunded: 0
        available_to_refund: 3000
    PaymentLinks:
      type: object
      description: HATEOAS links for a payment.
      required:
        - self
      properties:
        self:
          description: Link to the payment resource.
          allOf:
            - $ref: '#/components/schemas/Link'
            - example:
                href: /v2/client-sessions/9a14962c-bdcf-49d1-8673-e75dfb48013f
                method: GET
        capture:
          description: Link to capture the payment.
          allOf:
            - $ref: '#/components/schemas/Link'
            - example:
                href: /v2/payments/9a14962c-bdcf-49d1-8673-e75dfb48013f/captures
                method: POST
        refund:
          description: Link to refund the payment.
          allOf:
            - $ref: '#/components/schemas/Link'
            - example:
                href: /v2/payments/9a14962c-bdcf-49d1-8673-e75dfb48013f/refunds
                method: POST
        void:
          description: Link to void the payment.
          allOf:
            - $ref: '#/components/schemas/Link'
            - example:
                href: /v2/payments/9a14962c-bdcf-49d1-8673-e75dfb48013f/voids
                method: POST
    PaymentSplitElement:
      type: object
      description: Split of a payment over a single payment partner/solution.
      properties:
        partner:
          description: Payment partner used to process the payment.
          type: string
          example: ingenico
        method:
          description: Payment method used to process the payment.
          type: string
          example: creditcard
        amount:
          description: Amount of the payment in currency minor unit.
          type: integer
          example: 4299
        parent_partner_transaction_id:
          description: ID of the previously authorized partner transaction.
          type: string
          format: uuid
          example: '1a2b3c4d-1a2b-abcd-1234-123456789abc'
        parent_payment_id:
          description: ID of the previously authorized payment.
          type: string
          format: uuid
          example: '9399c938-80e1-11ef-9de7-327d4a6ae82c'
        parent_partner_token:
          description: Token generated by partner from a previous transaction
          type: string
          example: 64837-39372-32188
        parent_partner_reference:
          description: Partner reference from a previous transaction
          type: string
          example: 123456789
    Payment:
      description: Representation of a payment.
      type: object
      required:
        - id
        - created_at
        - amount
        - currency
        - version
        - entity_id
        - overview
        - capture_mode
        - authorization
        - captures
        - voids
        - refunds
        - amounts
        - split
        - links
      properties:
        id:
          description: ID of the payment provided by Purse.
          type: string
          format: uuid
        created_at:
          description: Payment creation date time.
          type: string
          format: date-time
        overview:
          type: object
          required:
            - consumed
            - captured
            - voided
            - refunded
          properties:
            consumed:
              $ref: '#/components/schemas/PaymentTag'
            captured:
              $ref: '#/components/schemas/PaymentTag'
            voided:
              $ref: '#/components/schemas/PaymentTag'
            refunded:
              $ref: '#/components/schemas/PaymentTag'
        client_session_id:
          description: ID of the client session that created the payment.
          type: string
          format: uuid
        entity_id:
          type: string
          format: uuid
          description: Entity ID for this ClientSession.
        version:
          type: integer
          example: 3
          description: Version of the payment resource.
        order_reference:
          description: Reference of the order provided by the merchant.
          type: string
          example: order_01
        order:
          $ref: '#/components/schemas/Order'  
        amount:
          description: Amount of the payment in currency minor unit.
          type: integer
          example: 4299
        currency:
          $ref: '#/components/schemas/Currency'
        capture_mode:
          $ref: '#/components/schemas/CaptureMode'
        allow_future_usage:
          type: boolean
          description: |
            Default value is `false`.
            When `true`, the payment associated to the client-session might be used to create future MIT,
            and `/three_ds_authentication_options/challenge_indicator` must be sent as `CHALLENGE_REQUESTED_BY_MERCHANT`
        captures:
          $ref: '#/components/schemas/Captures'
        voids:
          $ref: '#/components/schemas/Voids'
        refunds:
          $ref: '#/components/schemas/Refunds'
        authorization:
          $ref: '#/components/schemas/Authorization'
        amounts:
          $ref: '#/components/schemas/PaymentAmounts'
        links:
          $ref: '#/components/schemas/PaymentLinks'
        split:
          type: array
          description: How payment was split over payment partners.
          items:
            $ref: '#/components/schemas/PaymentSplitElement'
        webhook:
          $ref: '#/components/schemas/Webhook'
    PaymentOperationApplication:
      type: object
      required:
        - amount
      properties:
        amount:
          type: integer
          example: 10
          minimum: 0
          exclusiveMinimum: true
          description: Amount to be processed for the called operation.
        order:
          $ref: '#/components/schemas/PaymentOperationOrder'
        priority:
          description: List of eligible solutions that prioritize the methods of payment to use for payment operations.
          type: array
          items:
            $ref: '#/components/schemas/EligibleSolution'
        merchant_reference:
          type: string
          example: CAP#1223445
          description: Reference of the operation in the merchant system.
    PaymentOperationOrder:
      type: object
      description: Information regarding the order and the items related to this operation. This object is only valued for payment operations and only required for some payment methods.
      properties:
        shipments:
          type: array
          description: List of all shipments for the order.
          items:
            $ref: '#/components/schemas/PaymentOperationShipment'
    Discount:
      type: object
      required:
        - net_amount
        - tax_amount
      properties:
        net_amount:
          type: integer
          description: Amount of the discount in currency minor unit.
          example: 0
        tax_amount:
          type: integer
          description: Tax amount of the discount in currency minor unit.
          example: 0
        coupon_code:
          type: string
          description: Coupon code used during the order.
          example: "BLACK_FRIDAY"
        seller_reference:
          type: string
          description: Reference of the seller for the merchant system
          example: 'SELLER_01'
    PaymentOperationShipment:
      type: object
      description: Information regarding shipping / delivery and the items to be shipped. This object is only valued for payment operations.
      properties:
        net_amount:
          type: integer
          description: Total amount of the shipment in currency minor unit.
          example: 4299
        item_lines:
          type: array
          description: List of all items for the shipment.
          items:
            $ref: '#/components/schemas/ItemLine'
    CreatePaymentApplication:
      description: Create payment
      type: object
      required:
        - amount
        - currency
        - entity_id
        - order
      properties:
        amount:
          description: |
            Amount to be payed in currency minor unit.
            For example, 4299 is 42.99 EUR
          type: integer
          example: 4299
          minimum: 0
          exclusiveMinimum: true
        currency:
          $ref: '#/components/schemas/Currency'
        entity_id:
          type: string
          format: uuid
          description: |
            ID of the entity that is using the orchestration API.
            This ID is provided by Purse.
        capture_mode:
          $ref: '#/components/schemas/CaptureMode'
        allow_future_usage:
          type: boolean
          description: |
            Default value is `false`.
            When `true`, this payment might be used to create future MIT,
            and `/three_ds_authentication_options/challenge_indicator` must be sent as `CHALLENGE_REQUESTED_BY_MERCHANT`
        order:
          $ref: '#/components/schemas/Order'
        customer:
          $ref: '#/components/schemas/Customer'
        webhook:
          $ref: '#/components/schemas/Webhook'
        split:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/DuplicateAuthorizationCandidate'
              - $ref: '#/components/schemas/DuplicateForeignAuthorizationCandidate'
      #          - $ref: '#/NewAuthorizationCandidate' # TODO SVC-1176: Server 2 server
      example:
        entity_id: 5e3a0862-7cc3-4427-92ba-9e1e9595f571
        amount: 12000
        currency: EUR
        capture_mode: MANUAL
        allow_future_usage: false
        order:
          reference: '123456789'
          net_amount: 12000
          tax_amount: 2000
          billing_address:
            gender: FEMALE
            first_name: Emily
            middle_name: Rose
            last_name: PARKER
            address_lines:
              - NextNow
              - 67 Rue de Luxembourg
            city: Lille
            postal_code: '59777'
            country_code: FR
            province_code: FR-HDF
            phone_number: "+33111111111"
            mobile_phone_number: "+33222222222"
            work_phone_number: "+33444444444"
          shipments:
            - net_amount: 12000
              delivery_type: EXTERNAL_PICKUP
              delivery_quickness: REGULAR
              delivery_method_reference: '#1123-pickup'
              estimated_delivery_date_time: '2023-10-30T15:40:00+02:00'
              shipping_address:
                gender: FEMALE
                first_name: Rodriguez
                middle_name: Eios
                last_name: DESANTONS
                address_lines:
                  - Av. de la roja 1676
                city: Porto
                postal_code: '22000'
                country_code: PT
                province_code: PT-13
                phone_number: "+33555555555"
                mobile_phone_number: "+33666666666"
                work_phone_number: "+33777777777"
                delivery_point_name: home
              item_lines:
                - type: PHYSICAL
                  sku_reference: '2600218'
                  name: Camiseta100 niño GYM
                  brand: Quivio
                  unit_gross_price: 5000
                  net_amount: 12000
                  quantity: 2
                  tax_amount: 2000
                  tax_rate: 20.00
                  seller_reference: '#42-ACME'
                  seller_name: 'Acme Corp'
                  is_marketplace_seller: true
                - type: SHIPPING_FEES
                  name: Transporte
                  net_amount: 0
                  unit_gross_price: 0
                  quantity: 1
                  tax_amount: 0
                  tax_rate: 0
        customer:
          reference: '2090000000000'
          type: PERSON
          email: emily.rose.parker@example.org
          gender: FEMALE
          first_name: Emily
          middle_name: Rose
          last_name: PARKER
          birth_date: '1995-08-25'
          ip_address: 203.0.113.195
          locale: fr-FR
          account:
            creation_date_time: '2017-06-15T15:30:00+02:00'
            update_date_time: '2023-02-20T20:54:00+01:00'
            password_update_date_time: '2023-02-20T20:54:00+01:00'
            purchase_count_last_day: 0
            purchase_count_last_six_months: 3
            purchase_count_last_year: 8
            authentication_method: MERCHANT_CREDENTIALS
            authentication_date_time: '2023-10-30T15:33:00+02:00'
            age_indicator: MORE_60_DAYS
            change_indicator: MORE_60_DAYS
            password_change_indicator: MORE_60_DAYS
        split:
          - amount: 3299
            parent_payment_id: a1b2c3d4-abcd-1234-a1b2-123456abcdef
          - amount: 1000
            method: giftcard
            partner: illicado

    DuplicateAuthorizationCandidate:
      description: Authorization to duplicate for this payment
      type: object
      required:
        - amount
      properties:
        amount:
          description: |
            Amount to be payed in currency minor unit.
            For example, 4299 is 42.99 EUR
          type: integer
          example: 4299
          minimum: 0
          exclusiveMinimum: true
        parent_partner_transaction_id:
          description: ID of the previously authorized partner transaction.
          type: string
          format: uuid
          example: '1a2b3c4d-1a2b-abcd-1234-123456789abc'
        parent_payment_id:
          description: ID of the previously authorized payment.
          type: string
          format: uuid
          example: '9399c938-80e1-11ef-9de7-327d4a6ae82c'

    DuplicateForeignAuthorizationCandidate:
      description: Foreign authorization to duplicate for this payment
      type: object
      required:
        - amount
        - partner
        - method
      properties:
        amount:
          description: |
            Amount to be payed in currency minor unit.
            For example, 4299 is 42.99 EUR
          type: integer
          example: 4299
          minimum: 0
          exclusiveMinimum: true
        partner:
          description: Partner that processed the transaction.
          type: string
          example: 'ingenico'
        method:
          description: Method used to process the transaction.
          type: string
          example: 'creditcard'
        parent_partner_token:
          description: Token generated by partner from a previous transaction
          type: string
          example: 64837-39372-32188
        parent_partner_reference:
          description: Partner reference from a previous transaction
          type: string
          example: 123456789

    WalletToken:
      type: object
      properties:
        value:
          type: string
        id:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
        payment_id:
          "$ref": "#/components/schemas/WalletApiPaymentId"
        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

    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 entity 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 responses, 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

    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
            - UNCERTAIN
        description:
          type: string
          description: The description related to this status.
      additionalProperties: true


    PluginResultActionResult:
      type: object
      properties:
        currency_code:
          type: string
          description: The currency code which was actually interpreted by the partner.
          example: EUR
        token:
          type: string
          description: The partner token in case the customer wanted to register their payment method for faster further payments.
          nullable: true
          deprecated: true
        status:
          type: string
          description: The status code as returned by the partner.
          example: 000.100.200
        integrated_token:
          type: array
          description: Token to be registered into the 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 the partner. Sometimes, it can be different than the 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 the plugin wants to forward to the merchant. These are not handled by the Payment API.
          nullable: true
        partner_data:
          $ref: "#/components/schemas/PartnerDataResponse"
        loyalty:
          type: string
          description: The partner token unique identifier in case the customer wanted to register their payment method for faster further payments.
          nullable: true
          deprecated: true
      additionalProperties: true
      description: The result returned by the plugin code.

    Token:
      type: object
      properties:
        id:
          type: string
          description: Customer account token registered in the merchant wallet. This represents the token to register in case the customer wants to save their data for a faster payment experience next time.
          example: sl-23S-Dxc
        loyalty:
          type: string
          description: The partner token unique identifier in case the customer wanted to register their payment method for faster further payments.
          nullable: true
          deprecated: true
        uniqueness_token:
          type: string
          description: The partner token unique identifier in case the customer wanted to register their payment method for faster further payments.
          nullable: true
        pin_code:
          type: string
          description: The partner token pin code to prefill it if applicable anyhow.
          nullable: true
          example: "1234"
        expiration_date:
          type: string
          description: The partner token expiration date. When outdated, a token is no longer 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


    PaymentDataResponse:
      type: object
      properties:
        token:
          type: string
          description: Customer account token registered in the merchant wallet. This represents the token to register in case the customer wants to save their data for a faster payment experience next time.
          example: sl-23S-Dxc
        holder:
          type: string
          description: Payment solution holder name (cardholder, PayPal account holder, etc.).
          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

    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 the 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 the 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 the 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 sent back to the partner's API.
      nullable: 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.
    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.

    Description:
      type: object
      properties:
        brand_name:
          type: string
          description: >
            The partner token brand name. Usually used for credit cards, where the token can be registered for various brands (e.g., VISA, MasterCard).
          nullable: true
          example: VISA
        display_token:
          type: string
          description: >
            The partner token displayed for the customer to distinguish this specific token from another token they might have registered.
          nullable: true
          example: "**** 4169"
        holder_name:
          type: string
          description: >
            The partner token holder name. This is usually used in bank transactions through cards, where the customer needs to provide a cardholder name, 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 it is used to present the token to the customer next time they pay (e.g., this can hold the last 4 digits of the card number, the whole card number, etc., depending on the partner).        

                  
