openapi: 3.0.1
info:
  title: Payment Queries API
  version: '1'
  description: >-

    __Authentication__ 


    Set your headers:

      ```
        Authorization: {your_credentials}
        Accept: application/vnd.worldpay.payment-queries-v1.hal+json
      ```
    Replace `{your_credentials}` with your base64-encoded Basic Auth username
    and password.


    <br><br>

    __DNS Whitelisting__


    Whitelist the following URLs:

    * `https://try.access.worldpay.com/`

    * `https://access.worldpay.com/`


    Please ensure you use DNS whitelisting, not explicit IP whitelisting.
servers:
  - url: https://try.access.worldpay.com
    description: testing (try)
  - url: https://access.worldpay.com
    description: live
paths:
  /paymentQueries/payments:
    get:
      summary: Query payments
      description: >-
        Query payments within a specified date time range.


        These payments can be filtered by currency, minAmount, maxAmount,
        last4Digits & receivedEvents.


        The API returns data for payments processed after 25 June 2024. For
        payments processed before then use our [query for historical
        payments](/products/access/payment-queries/@v1/query-archive.md).
      operationId: queryByDateRange
      parameters:
        - in: header
          name: Accept
          required: true
          schema:
            type: string
            example: application/vnd.worldpay.payment-queries-v1.hal+json
        - name: startDate
          in: query
          description: >-
            An ISO 8601 date-time supplied as a string. Filters for payments
            that occurred after the specified date-time. Must be supplied
            alongside endDate.
          required: true
          schema:
            type: string
            example: '2024-04-28T21:30:20Z'
        - name: endDate
          in: query
          description: >-
            An ISO 8601 date-time supplied as a string. Filters for payments
            that occurred below the specified date-time. Must be supplied
            alongside startDate.
          required: true
          schema:
            type: string
            example: '2024-05-31T21:30:20Z'
        - name: pageSize
          in: query
          description: >-
            The maximum number of payments to be returned in the response (max
            300).
          required: false
          schema:
            type: string
            example: '10'
        - name: currency
          in: query
          description: The three digit currency code.
          required: false
          schema:
            type: string
            example: GBP
        - name: minAmount
          in: query
          description: >-
            This is a whole number including the currency exponent (e.g. GBP has
            an exponent of 2, so for £2.50 supply:`250`).
          required: false
          schema:
            type: integer
            example: 0
        - name: maxAmount
          in: query
          description: >-
            This is a whole number including the currency exponent (e.g. GBP has
            an exponent of 2, so for £2.50 supply:`250`).
          required: false
          schema:
            type: integer
            example: 100
        - name: last4Digits
          in: query
          description: The last four digits of the card number.
          required: false
          schema:
            type: string
            example: '1111'
        - name: receivedEvents
          in: query
          description: Name of the event.
          required: false
          schema:
            type: string
            example: authorizationRequested, authorizationSucceeded
        - name: transactionReference
          in: query
          description: >-
            A unique reference generated by you, used to identify a payment
            throughout its lifecycle. This shouldn't be used in conjunction with
            the above fields. Use it as a single parameter to query data.
          required: false
          schema:
            type: string
            example: Memory265-13/08/1876
      responses:
        '200':
          description: >-
            Summary information of list of payments within a specified date
            range.
          content:
            application/vnd.worldpay.payment-queries-v1.hal+json:
              schema:
                $ref: '#/components/schemas/pq_querybydaterange_200_response'
              examples:
                Query payments within a specified date time range:
                  description: Query payments within a specified date time range
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&pageSize=5
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:31.410Z&paymentId=44809b32-6b71-4bd0-9b8c-ac29beb65059&pageSize=5
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                        - timestamp: '2024-05-30T09:49:31.410Z'
                          transactionReference: db0eea07-cd96-417f-8f78-90cc3908c81b
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/44809b32-6b71-4bd0-9b8c-ac29beb65059
                Query payments within a specified date time range filtered by currency:
                  description: >-
                    Query payments within a specified date time range filtered
                    by currency
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments within a specified date time range filtered by currency, amount:
                  description: >-
                    Query payments within a specified date time range filtered
                    by currency, amount
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments within a specified date time range filtered by last4Digits:
                  description: >-
                    Query payments within a specified date time range filtered
                    by last4Digits
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments within a specified date time range filtered by receivedEvents:
                  description: >-
                    Query payments within a specified date time range filtered
                    by receivedEvents
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&minAmount=250&maxAmount=300&receivedEvents=authorizationRequested,authorizationSucceeded,refundRequested&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&minAmount=250&maxAmount=300&receivedEvents=authorizationRequested,authorizationSucceeded,refundRequested&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Retrieve a payment by paymentId:
                  description: Querying a payment with a paymentId
                  value:
                    timestamp: '2024-05-30T09:49:45.962Z'
                    transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                    narrative:
                      line1: trading name
                      line2: order number
                    transactionType: oneTime
                    authorizationType: authorization
                    entity: AccessWP
                    paymentInstrument:
                      type: card/plain
                    value:
                      currency: GBP
                      amount: 250
                    events:
                      - eventName: authorizationRequested
                        timestamp: '2024-05-30T09:49:45.962Z'
                      - eventName: authorizationFailed
                        timestamp: '2024-05-30T09:49:46.106Z'
                        error:
                          name: internalErrorOccurred
                          message: Bad request reported downstream
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments by transactionReference:
                  description: Querying a payment with a transactionReference
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?transactionReference=89197aeb-c94a-456e-8014-1272fbcb64eb
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          narrative:
                            line1: trading name
                            line2: order number
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query historical payments with a transactionReference & entityReference:
                  description: >-
                    Query historical payments with a transactionReference &
                    entityReference
                  value:
                    _embedded:
                      payments:
                        - lastEvent: Authorized
                          value:
                            amount: 500
                            currency: GBP
                          paymentInstrument:
                            type: card/plain
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                          _links:
                            payments:cancel:
                              href: >-
                                https://try.access.worldpay.com/payments/authorizations/cancellations/eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GeDrCwEtsymFb5gQw9WlrStDTK3eIWPy93y:7njc4649JSrU7+vFDl1J36+cwOkX0lW4Z+fnZKMutoUGX3m1:miQ42Na870582T9ERg+1ZUryhkE+qW88hu1DdDl2T76sf:VXab5cMYWO6LS0UzlfoW8PkXm9A8Gx:X:2vAwKFXFzKnt23AOHd1MAcGi2rYDmNWql5dV+zBj9zyT7GZXrLmjasoJJfxtEasqXGr:dzHa6q9jMukzvEX+SLmppl6itAGDMxqvmBKsIqEipLj126
                            payments:settle:
                              href: >-
                                https://try.access.worldpay.com/payments/settlements/full/eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GeDrCwEtsymFb5gQw9WlrStDTK3eIWPy93y:7njc4649JSrU7+vFDl1J36+cwOkX0lW4Z+fnZKMutoUGX3m1:miQ42Na870582T9ERg+1ZUryhkE+qW88hu1DdDl2T76sf:VXab5cMYWO6LS0UzlfoW8PkXm9A8Gx:X:2vAwKFXFzKnt23AOHd1MAcGi2rYDmNWql5dV+zBj9zyT7GZXrLmjasoJJfxtEasqXGr:dzHa6q9jMukzvEX+SLmppl6itAGDMxqvmBKsIqEipLj126
                            payments:partialSettle:
                              href: >-
                                https://try.access.worldpay.com/payments/settlements/partials/eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GeDrCwEtsymFb5gQw9WlrStDTK3eIWPy93y:7njc4649JSrU7+vFDl1J36+cwOkX0lW4Z+fnZKMutoUGX3m1:miQ42Na870582T9ERg+1ZUryhkE+qW88hu1DdDl2T76sf:VXab5cMYWO6LS0UzlfoW8PkXm9A8Gx:X:2vAwKFXFzKnt23AOHd1MAcGi2rYDmNWql5dV+zBj9zyT7GZXrLmjasoJJfxtEasqXGr:dzHa6q9jMukzvEX+SLmppl6itAGDMxqvmBKsIqEipLj126
                    _links:
                      self:
                        href: >-
                          /paymentQueries/archivedPayments?entityReference=AccessWP&transactionReference=Test123
  /paymentQueries/payments/{paymentId}:
    get:
      summary: Retrieve a payment
      description: >-
        Retrieve a payment by payment ID.


        The API returns detailed data for payments processed after 25 June 2024.
        For payments processed before then use our [query for historical
        payments](/products/access/payment-queries/@v1/query-archive.md).
      operationId: retrieveByPaymentId
      parameters:
        - in: header
          name: Accept
          required: true
          schema:
            type: string
            example: application/vnd.worldpay.payment-queries-v1.hal+json
        - name: paymentId
          in: path
          description: Unique paymentId generated for each payment
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            Retrieve complete details of a payment including the event history &
            next action links.
          content:
            application/vnd.worldpay.payment-queries-v1.hal+json:
              schema:
                $ref: '#/components/schemas/pq_querybypaymentid_200_response'
              examples:
                Query payments within a specified date time range:
                  description: Query payments within a specified date time range
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&pageSize=5
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:31.410Z&paymentId=44809b32-6b71-4bd0-9b8c-ac29beb65059&pageSize=5
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                        - timestamp: '2024-05-30T09:49:31.410Z'
                          transactionReference: db0eea07-cd96-417f-8f78-90cc3908c81b
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/44809b32-6b71-4bd0-9b8c-ac29beb65059
                Query payments within a specified date time range filtered by currency:
                  description: >-
                    Query payments within a specified date time range filtered
                    by currency
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments within a specified date time range filtered by currency, amount:
                  description: >-
                    Query payments within a specified date time range filtered
                    by currency, amount
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments within a specified date time range filtered by last4Digits:
                  description: >-
                    Query payments within a specified date time range filtered
                    by last4Digits
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments within a specified date time range filtered by receivedEvents:
                  description: >-
                    Query payments within a specified date time range filtered
                    by receivedEvents
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&minAmount=250&maxAmount=300&receivedEvents=authorizationRequested,authorizationSucceeded,refundRequested&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&minAmount=250&maxAmount=300&receivedEvents=authorizationRequested,authorizationSucceeded,refundRequested&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Retrieve a payment by paymentId:
                  description: Querying a payment with a paymentId
                  value:
                    timestamp: '2024-05-30T09:49:45.962Z'
                    transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                    narrative:
                      line1: trading name
                      line2: order number
                    transactionType: oneTime
                    authorizationType: authorization
                    entity: AccessWP
                    paymentInstrument:
                      type: card/plain
                    value:
                      currency: GBP
                      amount: 250
                    events:
                      - eventName: authorizationRequested
                        timestamp: '2024-05-30T09:49:45.962Z'
                      - eventName: authorizationFailed
                        timestamp: '2024-05-30T09:49:46.106Z'
                        error:
                          name: internalErrorOccurred
                          message: Bad request reported downstream
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments by transactionReference:
                  description: Querying a payment with a transactionReference
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?transactionReference=89197aeb-c94a-456e-8014-1272fbcb64eb
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          narrative:
                            line1: trading name
                            line2: order number
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query historical payments with a transactionReference & entityReference:
                  description: >-
                    Query historical payments with a transactionReference &
                    entityReference
                  value:
                    _embedded:
                      payments:
                        - lastEvent: Authorized
                          value:
                            amount: 500
                            currency: GBP
                          paymentInstrument:
                            type: card/plain
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                          _links:
                            payments:cancel:
                              href: >-
                                https://try.access.worldpay.com/payments/authorizations/cancellations/eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GeDrCwEtsymFb5gQw9WlrStDTK3eIWPy93y:7njc4649JSrU7+vFDl1J36+cwOkX0lW4Z+fnZKMutoUGX3m1:miQ42Na870582T9ERg+1ZUryhkE+qW88hu1DdDl2T76sf:VXab5cMYWO6LS0UzlfoW8PkXm9A8Gx:X:2vAwKFXFzKnt23AOHd1MAcGi2rYDmNWql5dV+zBj9zyT7GZXrLmjasoJJfxtEasqXGr:dzHa6q9jMukzvEX+SLmppl6itAGDMxqvmBKsIqEipLj126
                            payments:settle:
                              href: >-
                                https://try.access.worldpay.com/payments/settlements/full/eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GeDrCwEtsymFb5gQw9WlrStDTK3eIWPy93y:7njc4649JSrU7+vFDl1J36+cwOkX0lW4Z+fnZKMutoUGX3m1:miQ42Na870582T9ERg+1ZUryhkE+qW88hu1DdDl2T76sf:VXab5cMYWO6LS0UzlfoW8PkXm9A8Gx:X:2vAwKFXFzKnt23AOHd1MAcGi2rYDmNWql5dV+zBj9zyT7GZXrLmjasoJJfxtEasqXGr:dzHa6q9jMukzvEX+SLmppl6itAGDMxqvmBKsIqEipLj126
                            payments:partialSettle:
                              href: >-
                                https://try.access.worldpay.com/payments/settlements/partials/eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GeDrCwEtsymFb5gQw9WlrStDTK3eIWPy93y:7njc4649JSrU7+vFDl1J36+cwOkX0lW4Z+fnZKMutoUGX3m1:miQ42Na870582T9ERg+1ZUryhkE+qW88hu1DdDl2T76sf:VXab5cMYWO6LS0UzlfoW8PkXm9A8Gx:X:2vAwKFXFzKnt23AOHd1MAcGi2rYDmNWql5dV+zBj9zyT7GZXrLmjasoJJfxtEasqXGr:dzHa6q9jMukzvEX+SLmppl6itAGDMxqvmBKsIqEipLj126
                    _links:
                      self:
                        href: >-
                          /paymentQueries/archivedPayments?entityReference=AccessWP&transactionReference=Test123
  /paymentQueries/archivedPayments:
    get:
      summary: Query historical payments
      description: >-
        Query payments processed before 25 June 2024.


        Provide a `transactionReference` and `entityReference` for a payment to
        find the payment matching that information in the archive.
      operationId: queryArchivedPayments
      parameters:
        - in: header
          name: Accept
          required: true
          schema:
            type: string
            example: application/vnd.worldpay.payment-queries-v1.hal+json
        - name: transactionReference
          in: query
          description: >-
            A unique reference generated by you, used to identify a payment
            throughout its lifecycle.
          required: true
          schema:
            type: string
            example: 89197aeb-c94a-456e-8014-1272fbcb64eb
        - name: entityReference
          in: query
          description: A merchant entity.
          required: true
          schema:
            type: string
            example: testEntity
      responses:
        '200':
          description: Summary information of a payment.
          content:
            application/vnd.worldpay.payment-queries-v1.hal+json:
              schema:
                $ref: '#/components/schemas/pq_queryhistoricalpayments_200_response'
              examples:
                Query payments within a specified date time range:
                  description: Query payments within a specified date time range
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&pageSize=5
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:31.410Z&paymentId=44809b32-6b71-4bd0-9b8c-ac29beb65059&pageSize=5
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                        - timestamp: '2024-05-30T09:49:31.410Z'
                          transactionReference: db0eea07-cd96-417f-8f78-90cc3908c81b
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/44809b32-6b71-4bd0-9b8c-ac29beb65059
                Query payments within a specified date time range filtered by currency:
                  description: >-
                    Query payments within a specified date time range filtered
                    by currency
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments within a specified date time range filtered by currency, amount:
                  description: >-
                    Query payments within a specified date time range filtered
                    by currency, amount
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments within a specified date time range filtered by last4Digits:
                  description: >-
                    Query payments within a specified date time range filtered
                    by last4Digits
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&minAmount=250&maxAmount=300&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments within a specified date time range filtered by receivedEvents:
                  description: >-
                    Query payments within a specified date time range filtered
                    by receivedEvents
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-31T21:30:20Z&minAmount=250&maxAmount=300&receivedEvents=authorizationRequested,authorizationSucceeded,refundRequested&currency=GBP&pageSize=4
                      next:
                        href: >-
                          /paymentQueries/payments?startDate=2024-04-28T21:30:20Z&endDate=2024-05-30T09:49:45.962Z&paymentId=5cee1a06-2f74-48ab-9fdf-395907aa5389&minAmount=250&maxAmount=300&receivedEvents=authorizationRequested,authorizationSucceeded,refundRequested&currency=GBP&pageSize=4
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T19:44:19.836Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/1da375d7-2012-4992-88b3-f7bf3ab2b368
                        - timestamp: '2024-05-30T09:50:17.051Z'
                          transactionReference: Memory265-13/08/1876
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/network
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/d518b03f-991a-4735-885b-303a14071afc
                        - timestamp: '2024-05-30T09:49:49.843Z'
                          transactionReference: 7a5d0292-251f-48ed-a5c0-13c4c78d4487
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain+masked
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                              fundingType: credit
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/251a21ba-0360-4289-bd1f-0ec41fe96069
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Retrieve a payment by paymentId:
                  description: Querying a payment with a paymentId
                  value:
                    timestamp: '2024-05-30T09:49:45.962Z'
                    transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                    narrative:
                      line1: trading name
                      line2: order number
                    transactionType: oneTime
                    authorizationType: authorization
                    entity: AccessWP
                    paymentInstrument:
                      type: card/plain
                    value:
                      currency: GBP
                      amount: 250
                    events:
                      - eventName: authorizationRequested
                        timestamp: '2024-05-30T09:49:45.962Z'
                      - eventName: authorizationFailed
                        timestamp: '2024-05-30T09:49:46.106Z'
                        error:
                          name: internalErrorOccurred
                          message: Bad request reported downstream
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query payments by transactionReference:
                  description: Querying a payment with a transactionReference
                  value:
                    _links:
                      self:
                        href: >-
                          /paymentQueries/payments?transactionReference=89197aeb-c94a-456e-8014-1272fbcb64eb
                    _embedded:
                      payments:
                        - timestamp: '2024-05-30T09:49:45.962Z'
                          transactionReference: 89197aeb-c94a-456e-8014-1272fbcb64eb
                          narrative:
                            line1: trading name
                            line2: order number
                          transactionType: oneTime
                          authorizationType: authorization
                          entity: AccessWP
                          paymentInstrument:
                            type: card/plain
                          value:
                            currency: GBP
                            amount: 250
                          _links:
                            self:
                              href: >-
                                /paymentQueries/payments/5cee1a06-2f74-48ab-9fdf-395907aa5389
                Query historical payments with a transactionReference & entityReference:
                  description: >-
                    Query historical payments with a transactionReference &
                    entityReference
                  value:
                    _embedded:
                      payments:
                        - lastEvent: Authorized
                          value:
                            amount: 500
                            currency: GBP
                          paymentInstrument:
                            type: card/plain
                            card:
                              number:
                                last4Digits: '1111'
                              brand: visa
                          _links:
                            payments:cancel:
                              href: >-
                                https://try.access.worldpay.com/payments/authorizations/cancellations/eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GeDrCwEtsymFb5gQw9WlrStDTK3eIWPy93y:7njc4649JSrU7+vFDl1J36+cwOkX0lW4Z+fnZKMutoUGX3m1:miQ42Na870582T9ERg+1ZUryhkE+qW88hu1DdDl2T76sf:VXab5cMYWO6LS0UzlfoW8PkXm9A8Gx:X:2vAwKFXFzKnt23AOHd1MAcGi2rYDmNWql5dV+zBj9zyT7GZXrLmjasoJJfxtEasqXGr:dzHa6q9jMukzvEX+SLmppl6itAGDMxqvmBKsIqEipLj126
                            payments:settle:
                              href: >-
                                https://try.access.worldpay.com/payments/settlements/full/eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GeDrCwEtsymFb5gQw9WlrStDTK3eIWPy93y:7njc4649JSrU7+vFDl1J36+cwOkX0lW4Z+fnZKMutoUGX3m1:miQ42Na870582T9ERg+1ZUryhkE+qW88hu1DdDl2T76sf:VXab5cMYWO6LS0UzlfoW8PkXm9A8Gx:X:2vAwKFXFzKnt23AOHd1MAcGi2rYDmNWql5dV+zBj9zyT7GZXrLmjasoJJfxtEasqXGr:dzHa6q9jMukzvEX+SLmppl6itAGDMxqvmBKsIqEipLj126
                            payments:partialSettle:
                              href: >-
                                https://try.access.worldpay.com/payments/settlements/partials/eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GeDrCwEtsymFb5gQw9WlrStDTK3eIWPy93y:7njc4649JSrU7+vFDl1J36+cwOkX0lW4Z+fnZKMutoUGX3m1:miQ42Na870582T9ERg+1ZUryhkE+qW88hu1DdDl2T76sf:VXab5cMYWO6LS0UzlfoW8PkXm9A8Gx:X:2vAwKFXFzKnt23AOHd1MAcGi2rYDmNWql5dV+zBj9zyT7GZXrLmjasoJJfxtEasqXGr:dzHa6q9jMukzvEX+SLmppl6itAGDMxqvmBKsIqEipLj126
                    _links:
                      self:
                        href: >-
                          /paymentQueries/archivedPayments?entityReference=AccessWP&transactionReference=Test123
components:
  schemas:
    pq_querybypaymentid_200_response:
      type: object
      properties:
        timestamp:
          type: string
          description: Payment initial authorization time.
        transactionReference:
          type: string
          description: >-
            A unique reference generated by you, used to identify a payment
            throughout its lifecycle.
        narrative:
          required:
            - line1
          type: object
          description: >-
            An object that contains identification and further details of the
            merchant.
          properties:
            line1:
              type: string
              description: First line of text that appears on your customer's statement.
            line2:
              type: string
              description: Second line of text that appears on your customer's statement.
        transactionType:
          enum:
            - oneTime
            - cardOnFile
            - recurring
          type: string
          description: An object that contains transaction type.
        authorizationType:
          enum:
            - authorization
            - sale
          type: string
          description: An object that contains authorization type.
        entity:
          type: string
          description: Merchant entity name.
        paymentInstrument:
          type: object
          description: An object that contains information about the payment type.
          properties:
            type:
              enum:
                - card/plain
                - card/network
                - card/networkToken
                - card/networkToken+applepay
                - card/networkToken+googlepay
                - card/plain+masked
              type: string
              description: An object that contains information about the payment type.
            card:
              type: object
              description: An object that contains information about the card used.
              properties:
                number:
                  type: object
                  description: An object that contains information about the card number.
                  properties:
                    last4Digits:
                      type: string
                      description: last4Digits of the card number used.
                brand:
                  type: object
                  description: >-
                    An object that contains information about the brand. The
                    brand values can be Visa, Mastercard etc.
                fundingType:
                  type: object
                  description: >-
                    An object that contains information about the card funding
                    type. The funding type can be either credit or debit.
        value:
          required:
            - amount
            - currency
          type: object
          description: An object that contains payment amount and currency.
          properties:
            amount:
              type: integer
              description: >-
                This is a whole number including the currency exponent (e.g. GBP
                has an exponent of 2, so for £2.50 supply:`250`)
            currency:
              type: string
              description: The 3 digit currency code.
        events:
          required:
            - eventName
            - timestamp
          type: array
          description: An array that contains the history of events of a payment.
          items:
            type: object
            properties:
              eventName:
                type: string
                description: Name of the event.
              timestamp:
                type: string
                description: The time when the event is created.
              outcome:
                type: string
                description: Outcome of the event.
        _links:
          required:
            - self
          type: object
          description: Self link and next action links.
          properties:
            self:
              type: object
              description: Self link to the page.
              properties:
                href:
                  type: string
                  description: Self link to the page.
            payments:cancel:
              type: object
              description: Next action links.
              properties:
                href:
                  type: string
                  description: Next action links.
            payments:events:
              type: object
              description: Next action links.
              properties:
                href:
                  type: string
                  description: Next action links.
            payments:settle:
              type: object
              description: Next action links.
              properties:
                href:
                  type: string
                  description: Next action links.
            payments:partialSettle:
              type: object
              description: Next action links.
              properties:
                href:
                  type: string
                  description: Next action links.
    pq_querybydaterange_200_response:
      required:
        - _links
        - _embedded
      type: object
      properties:
        _links:
          required:
            - self
          type: object
          description: links to the pages.
          properties:
            self:
              type: object
              description: Self link to the page.
              properties:
                href:
                  type: string
                  description: First page as per the pageSize.
            next:
              type: object
              description: Next page link if the response contains more pages.
              properties:
                href:
                  type: string
                  description: Second page as per the pageSize.
        _embedded:
          type: object
          properties:
            payments:
              type: array
              required:
                - timestamp
                - transactionReference
                - entity
              description: Array of payments within the date range.
              items:
                type: object
                properties:
                  timestamp:
                    type: string
                    description: Payment initial authorization time.
                  transactionReference:
                    type: string
                    description: >-
                      A unique reference generated by you, used to identify a
                      payment throughout its lifecycle.
                  narrative:
                    type: object
                    description: >-
                      An object that contains identification and further details
                      of the merchant.
                    properties:
                      line1:
                        type: string
                        description: >-
                          First line of text that appears on your customer's
                          statement.
                      line2:
                        type: string
                        description: >-
                          Second line of text that appears on your customer's
                          statement.
                  transactionType:
                    enum:
                      - oneTime
                      - cardOnFile
                      - recurring
                    type: string
                    description: An object that contains transaction type.
                  authorizationType:
                    enum:
                      - authorization
                      - sale
                    type: string
                    description: An object that contains authorization type.
                  entity:
                    type: string
                    description: Merchant entity name.
                  paymentInstrument:
                    type: object
                    description: >-
                      An object that contains information about the payment
                      type.
                    properties:
                      type:
                        enum:
                          - card/plain
                          - card/network
                          - card/networkToken
                          - card/networkToken+applepay
                          - card/networkToken+googlepay
                          - card/plain+masked
                        type: string
                        description: >-
                          An object that contains information about the payment
                          type.
                      card:
                        type: object
                        description: >-
                          An object that contains information about the card
                          used.
                        properties:
                          number:
                            type: object
                            description: >-
                              An object that contains information about the card
                              number.
                            properties:
                              last4Digits:
                                type: string
                                description: last4Digits of the card number used.
                          brand:
                            type: object
                            description: >
                              An object that contains information about the
                              brand.

                              The brand values can be Visa, Mastercard etc.
                          fundingType:
                            type: object
                            description: >-
                              An object that contains information about the card
                              funding type. The funding type can be either
                              credit or debit.
                  value:
                    required:
                      - amount
                      - currency
                    type: object
                    description: An object that contains payment amount and currency.
                    properties:
                      amount:
                        type: integer
                        description: >-
                          This is a whole number including the currency exponent
                          (e.g. GBP has an exponent of 2, so for £2.50
                          supply:`250`)
                      currency:
                        type: string
                        description: The 3 digit currency code.
    pq_queryhistoricalpayments_200_response:
      required:
        - _links
        - _embedded
      type: object
      properties:
        _links:
          required:
            - self
          type: object
          description: >-
            Self link and next action links.The Next action links are dependant
            on the lastEvent, refer to 'query for historical payments Response'
            section for more details.
          properties:
            self:
              type: object
              description: Self link to the page.
              properties:
                href:
                  type: string
                  description: Self link to the page.
            payments:cancel:
              type: object
              description: Next action links.
              properties:
                href:
                  type: string
                  description: Next action links.
            payments:settle:
              type: object
              description: Next action links.
              properties:
                href:
                  type: string
                  description: Next action links.
            payments:partialSettle:
              type: object
              description: Next action links.
              properties:
                href:
                  type: string
                  description: Next action links.
        _embedded:
          type: object
          properties:
            payments:
              type: array
              description: Array of payments.
              items:
                type: object
                properties:
                  lastEvent:
                    type: string
                    description: >-
                      The last event of a payment. Possible event values
                      are:<ul><li>`Authorized`</li><li>`Refused`</li><li>`Sent
                      for Cancellation`</li><li>`Sent for Refund`</li><li>`Sent
                      for Settlement`</li><li>`Unknown`</li></ul>
                  paymentInstrument:
                    type: object
                    description: >-
                      An object that contains information about the payment
                      type.
                    properties:
                      type:
                        enum:
                          - card/plain
                          - card/network
                          - card/networkToken
                          - card/networkToken+applepay
                          - card/networkToken+googlepay
                          - card/plain+masked
                        type: string
                        description: >-
                          An object that contains information about the payment
                          type.
                      card:
                        type: object
                        description: >-
                          An object that contains information about the card
                          used.
                        properties:
                          number:
                            type: object
                            description: >-
                              An object that contains information about the card
                              number.
                            properties:
                              last4Digits:
                                type: string
                                description: last4Digits of the card number used.
                          brand:
                            type: object
                            description: >-
                              An object that contains information about the
                              brand. The brand values can be Visa, Mastercard
                              etc.
                  value:
                    required:
                      - amount
                      - currency
                    type: object
                    description: An object that contains payment amount and currency.
                    properties:
                      amount:
                        type: integer
                        description: >-
                          This is a whole number including the currency exponent
                          (e.g. GBP has an exponent of 2, so for £2.50
                          supply:`250`)
                      currency:
                        type: string
                        description: The 3 digit currency code.
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
security:
  - BasicAuth: []
