openapi: 3.0.1
info:
  title: Hosted Payment Pages (HPP) API
  description: Our low-code integration to take payments securely.
  license:
    name: Worldpay
    url: developers.worldpay.com/license
  version: '1'
servers:
  - url: https://try.access.worldpay.com
    description: Try
  - url: https://access.worldpay.com
    description: Live
security:
  - BasicAuth: []
paths:
  /payment_pages:
    post:
      summary: Create a new transaction
      operationId: create
      parameters:
        - name: User-Agent
          in: header
          description: The name of the client calling the API.
          schema:
            type: string
      requestBody:
        description: The Transaction to create
        content:
          application/vnd.worldpay.payment_pages-v1.hal+json:
            schema:
              $ref: '#/components/schemas/Transaction'
            examples:
              New payment (full):
                description: Create transaction request, required key:values
                value:
                  transactionReference: MyTransaction123
                  merchant:
                    entity: POxxxxxxxxx
                  narrative:
                    line1: ''
                  value:
                    currency: GBP
                    amount: 123
                  description: Mind Palace Ltd
                  billingAddressName: Sherlock Holmes
                  billingAddress:
                    address1: 221B Baker Street
                    address2: Marylebone
                    address3: Westminster
                    postalCode: NW1 6XE
                    city: London
                    state: Greater London
                    countryCode: GB
                  resultURLs:
                    successURL: https://mindpalace-website/result/success
                    pendingURL: https://mindpalace-website/result/pending
                    failureURL: https://mindpalace-website/result/failure
                    errorURL: https://mindpalace-website/result/error
                    cancelURL: https://mindpalace-website/result/cancel
                    expiryURL: https://mindpalace-website/result/expiry
                  riskData:
                    shipping:
                      firstName: James
                      lastName: Moriarty
                      address:
                        city: Durham
                        address1: The Palatine Centre
                        address2: Durham University
                        address3: Stockton Road
                        state: County Durham
                        countryCode: GB
                        postalCode: DH1 3LE
                        phoneNumber: '01189998819999197253'
                      method: verifiedAddress
                      nameMatchesAccountName: false
                      email: james.moriarty@example.com
                      timeFrame: nextDay
                    custom:
                      string1: foo
                      number1: '1'
                      string2: foo
                      number2: '1'
                      string3: foo
                      number3: '1'
                      string4: foo
                      number4: '1'
                      string5: foo
                      number5: '1'
                      string6: foo
                      number6: '1'
                      string7: foo
                      number7: '1'
                      string8: foo
                      number8: '1'
                      string9: foo
                      number9: '1'
                    account:
                      dateOfBirth: '1835-04-01'
                      history:
                        createdAt: '1876-06-01'
                        modifiedAt: '1876-08-13'
                        paymentAccountEnrolledAt: '1876-06-01'
                        passwordModifiedAt: '1876-06-01'
                      type: fidoAuthenticator
                      previousSuspiciousActivity: false
                      email: sherlock.holmes@example.com
                    transaction:
                      firstName: James
                      lastName: Moriarty
                      phoneNumber: '01189998819999197253'
                      preOrderDate: '1876-08-13'
                      reorder: false
                      history:
                        attemptsLastYear: 3
                        completedLastSixMonths: 4
                        attemptsLastDay: 2
                        shippingAddressFirstUsedAt: '1876-06-01'
                        addCardsLastDay: 1
                      giftCardsPurchase:
                        totalValue:
                          amount: 10000
                          currency: GBP
                        quantity: 1
                  expiry: '600'
              New payment (minimum):
                description: Create transaction request, all key:values
                value:
                  transactionReference: MyTransaction123
                  merchant:
                    entity: POxxxxxxxxx
                  narrative:
                    line1: Mind Palace Ltd
                  value:
                    currency: GBP
                    amount: 123
              Save a card (full):
                description: Save a card for future customer initiated transactions (full)
                value:
                  transactionReference: MyTransaction123
                  merchant:
                    entity: POxxxxxxxxx
                  narrative:
                    line1: Mind Palace Ltd
                  value:
                    currency: GBP
                    amount: 123
                  description: Optional text displayed on HPP to your customer
                  billingAddress:
                    address1: 221B Baker Street
                    address2: Marylebone
                    address3: Westminster
                    postalCode: NW1 6XE
                    city: London
                    state: Greater London
                    countryCode: GB
                  resultURLs:
                    successURL: https://mindpalace-website/result/success
                    pendingURL: https://mindpalace-website/result/pending
                    failureURL: https://mindpalace-website/result/failure
                    errorURL: https://mindpalace-website/result/error
                    cancelURL: https://mindpalace-website/result/cancel
                    expiryURL: https://mindpalace-website/result/expiry
                  riskData:
                    shipping:
                      firstName: James
                      lastName: Moriarty
                      address:
                        city: Durham
                        address1: The Palatine Centre
                        address2: Durham University
                        address3: Stockton Road
                        state: County Durham
                        countryCode: GB
                        postalCode: DH1 3LE
                        phoneNumber: '01189998819999197253'
                      method: verifiedAddress
                      nameMatchesAccountName: false
                      email: james.moriarty@example.com
                      timeFrame: nextDay
                    custom:
                      string1: foo
                      number1: '1'
                      string2: foo
                      number2: '1'
                      string3: foo
                      number3: '1'
                      string4: foo
                      number4: '1'
                      string5: foo
                      number5: '1'
                      string6: foo
                      number6: '1'
                      string7: foo
                      number7: '1'
                      string8: foo
                      number8: '1'
                      string9: foo
                      number9: '1'
                    account:
                      dateOfBirth: '1835-04-01'
                      history:
                        createdAt: '1876-06-01'
                        modifiedAt: '1876-08-13'
                        paymentAccountEnrolledAt: '1876-06-01'
                        passwordModifiedAt: '1876-06-01'
                      type: worldpay
                      previousSuspiciousActivity: false
                      email: sherlock.holmes@example.com
                    transaction:
                      firstName: James
                      lastName: Moriarty
                      phoneNumber: '01189998819999197253'
                      preOrderDate: '1876-08-13'
                      reorder: false
                      history:
                        attemptsLastYear: 3
                        completedLastSixMonths: 4
                        attemptsLastDay: 2
                        shippingAddressFirstUsedAt: '1876-06-01'
                        addCardsLastDay: 1
                      giftCardsPurchase:
                        totalValue:
                          amount: 123
                          currency: GBP
                        quantity: 1
                  createToken:
                    type: worldpay
                    namespace: SHOPPER_ID_1234567890
                    description: Test Token Description
                    optIn: ASK
                  expiry: '600'
              Save a card (minimum):
                description: >-
                  Save a card for future customer initiated transactions
                  (minimum)
                value:
                  transactionReference: MyTransaction123
                  merchant:
                    entity: POxxxxxxxxx
                  narrative:
                    line1: Mind Palace Ltd
                  value:
                    currency: GBP
                    amount: 123
                  createToken:
                    type: worldpay
                    namespace: SHOPPER_ID_1234567890
                    description: Test Token Description
                    optIn: ASK
              Card on file payment (full):
                description: Create transaction request, all key:values
                value:
                  transactionReference: MyTransaction123
                  merchant:
                    entity: POxxxxxxxxx
                  narrative:
                    line1: Mind Palace Ltd
                  value:
                    currency: GBP
                    amount: 123
                  description: Optional text displayed on HPP to your customer
                  billingAddress:
                    address1: 221B Baker Street
                    address2: Marylebone
                    address3: Westminster
                    postalCode: NW1 6XE
                    city: London
                    state: Greater London
                    countryCode: GB
                  resultURLs:
                    successURL: https://mindpalace-website/result/success
                    pendingURL: https://mindpalace-website/result/pending
                    failureURL: https://mindpalace-website/result/failure
                    errorURL: https://mindpalace-website/result/error
                    cancelURL: https://mindpalace-website/result/cancel
                    expiryURL: https://mindpalace-website/result/expiry
                  riskData:
                    shipping:
                      firstName: James
                      lastName: Moriarty
                      address:
                        city: Durham
                        address1: The Palatine Centre
                        address2: Durham University
                        address3: Stockton Road
                        state: County Durham
                        countryCode: GB
                        postalCode: DH1 3LE
                        phoneNumber: '01189998819999197253'
                      method: verifiedAddress
                      nameMatchesAccountName: false
                      email: james.moriarty@example.com
                      timeFrame: nextDay
                    custom:
                      string1: foo
                      number1: '1'
                      string2: foo
                      number2: '1'
                      string3: foo
                      number3: '1'
                      string4: foo
                      number4: '1'
                      string5: foo
                      number5: '1'
                      string6: foo
                      number6: '1'
                      string7: foo
                      number7: '1'
                      string8: foo
                      number8: '1'
                      string9: foo
                      number9: '1'
                    account:
                      dateOfBirth: '1835-04-01'
                      history:
                        createdAt: '1876-06-01'
                        modifiedAt: '1876-08-13'
                        paymentAccountEnrolledAt: '1876-06-01'
                        passwordModifiedAt: '1876-06-01'
                      type: worldpay
                      previousSuspiciousActivity: false
                      email: sherlock.holmes@example.com
                    transaction:
                      firstName: James
                      lastName: Moriarty
                      phoneNumber: '01189998819999197253'
                      preOrderDate: '1876-08-13'
                      reorder: false
                      history:
                        attemptsLastYear: 3
                        completedLastSixMonths: 4
                        attemptsLastDay: 2
                        shippingAddressFirstUsedAt: '1876-06-01'
                        addCardsLastDay: 1
                      giftCardsPurchase:
                        totalValue:
                          amount: 10000
                          currency: GBP
                        quantity: 1
                  paymentInstrument:
                    type: card/tokenized
                    href: >-
                      https://try.access.worldpay.com/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0NzI0NE1rdUtjMUFJdjYxVnlibWZuUT0ifQ
                  expiry: '600'
              Card on file payment (minimum):
                description: Create transaction request, required key:values
                value:
                  transactionReference: MyTransaction123
                  merchant:
                    entity: POxxxxxxxxx
                  narrative:
                    line1: Mind Palace Ltd
                  value:
                    currency: GBP
                    amount: 123
                  paymentInstrument:
                    type: card/tokenized
                    href: >-
                      https://try.access.worldpay.com/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0NzI0NE1rdUtjMUFJdjYxVnlibWZuUT0ifQ
      responses:
        '200':
          description: Transaction creation was successful
          content:
            application/vnd.worldpay.payment_pages-v1.hal+json:
              schema:
                $ref: '#/components/schemas/SuccessfulCreateTransactionResponse'
              examples:
                Successful response:
                  description: Successful response
                  value:
                    url: >-
                      https://payments.worldpay.com/app/hpp/integration/transaction/xxxxxxxxxxxxxxxxxxxx&cs=yyyyyy
        '400':
          description: Bad request
          content:
            application/vnd.worldpay.payment_pages-v1.hal+json:
              schema:
                $ref: '#/components/schemas/AwpApiErrorResponse'
              examples:
                Invalid request response:
                  description: Invalid request response
                  value:
                    errorName: invalidRequest
                    message: Invalid request.
        '401':
          description: Unauthorized
          content:
            application/vnd.worldpay.payment_pages-v1.hal+json:
              schema:
                $ref: '#/components/schemas/AwpApiErrorResponse'
              examples:
                Unauthorized response:
                  description: Unauthorized response
                  value:
                    errorName: unauthorized
                    message: Invalid authentication
        '500':
          description: Internal server error
          content:
            application/vnd.worldpay.payment_pages-v1.hal+json:
              schema:
                $ref: '#/components/schemas/AwpApiErrorResponse'
              examples:
                Internal error response:
                  description: Internal error response
                  value:
                    errorName: internalErrorOccurred
                    message: >-
                      An internal problem occurred with your request, please try
                      again.
components:
  schemas:
    BillingAddress:
      required:
        - address1
        - city
        - countryCode
      type: object
      properties:
        address1:
          maxLength: 85
          minLength: 0
          type: string
          description: Address line 1
        address2:
          maxLength: 85
          minLength: 0
          type: string
          description: Address line 2
        address3:
          maxLength: 85
          minLength: 0
          type: string
          description: Address line 3
        postalCode:
          maxLength: 15
          minLength: 0
          type: string
          description: 'Required for all countries except the following: * IE'
        city:
          maxLength: 50
          minLength: 0
          type: string
          description: Address city
        state:
          maxLength: 50
          minLength: 0
          type: string
          description: Address state or region
        countryCode:
          type: string
          description: The supported ISO 3166-1 alpha-2 country code
      description: An object containing the billing address information.
    CreateToken:
      required:
        - optIn
        - type
      type: object
      properties:
        type:
          type: string
          description: The type of token to be created.
          enum:
            - worldpay
        namespace:
          maxLength: 64
          minLength: 1
          type: string
          description: >-
            A namespace is used to group up to 16 cards, e.g. for one customer.
            A card can exist in more than one namespace.
        description:
          maxLength: 255
          minLength: 1
          pattern: ^([^&<]*)$
          type: string
          description: >-
            A description of your token. If not supplied, a default description
            is created for you.  
        optIn:
          type: string
          description: >
            Used to choose how the customer could opt into their payment details
            being tokenized.


            * SILENT - (default value) The card details are always saved (you
            must already have their consent to do this).


            * NOTIFY - The card details are always saved (you must already have
            their consent to do this) and your customer will see this within our
            hosted payment pages.


            * ASK - The card details are saved if your customer provides their
            consent. This adds a "Save payment details" tickbox to the page,
            which they tick to opt-in, or ignore to opt-out.
          enum:
            - SILENT
            - NOTIFY
            - ASK
      description: >-
        An object that instructs us to create a token for the payment details
        supplied.
    Merchant:
      required:
        - entity
      type: object
      properties:
        entity:
          maxLength: 32
          minLength: 1
          pattern: ^([A-Za-z0-9]+[A-Za-z0-9 ]*)?$
          type: string
          description: >-
            Used to route the request in Access Worldpay, created as part of
            on-boarding.
      description: An object that contains information about the merchant.
    Narrative:
      required:
        - line1
      type: object
      properties:
        line1:
          pattern: ^[a-zA-Z0-9\-\.\,\ ]*$
          type: string
          description: line1 is used to provide basic details about the merchant.
      description: >-
        The text that appears on your customer's statement. Used to identify the
        merchant.
    PaymentInstrument:
      required:
        - type
      type: object
      properties:
        type:
          type: string
          description: The type of instrument.
      description: An object that contains the payment type and details.
      discriminator:
        propertyName: type
        mapping:
          card/tokenized: '#/components/schemas/TokenPaymentInstrument'
      oneOf:
        - $ref: '#/components/schemas/TokenPaymentInstrument'
    ResultURLs:
      type: object
      properties:
        successURL:
          type: string
          description: >-
            When we receive the payment result for a successful payment, we
            redirect your customer to the success URL.
        pendingURL:
          type: string
          description: >-
            When we receive the payment result for a pending payment
            transaction, we redirect your customer to the pending URL.
        failureURL:
          type: string
          description: When a payment fails, we redirect your customer to the failure URL.
        errorURL:
          type: string
          description: >-
            When we receive the payment result for an erroneous payment, we
            redirect your customer to the error URL.
        cancelURL:
          type: string
          description: >-
            When your customer cancels a transaction, we redirect that customer
            to the cancel URL.
        expiryURL:
          type: string
          description: >-
            When a customer leaves the payment transaction uncompleted within
            the maximum allowed time frame, we redirect your customer to the
            expiry URL.
      description: >-
        An object containing the different URLs we redirect your customers to
        when we receive the payment result. We recommend that you provide us
        with your custom result URLs.
    RiskData:
      type: object
      properties:
        account:
          $ref: '#/components/schemas/RiskDataAccount'
        transaction:
          $ref: '#/components/schemas/RiskDataTransaction'
        shipping:
          $ref: '#/components/schemas/RiskDataShipping'
        custom:
          $ref: '#/components/schemas/RiskDataCustom'
      description: Data used for fraud and risk protection.
    RiskDataAccount:
      type: object
      properties:
        shopperId:
          maxLength: 128
          minLength: 1
          type: string
          description: A unique identifier of the customer.
        previousSuspiciousActivity:
          type: boolean
          description: Indicates whether there's been suspicious activity in the past.
        type:
          pattern: >-
            guestUser|registeredUser|federatedAccount|issuerCredentials|thirdPartyAuthentication|fidoAuthenticator
          type: string
          description: >
            The type of account being used by the customer.


            guestUser - Order placed without full merchant account registration
            (no password)


            registeredUser- Order placed with full merchant account registration
            (password entered)


            federatedAccount - Using a Federated ID


            issuerCredentials- Using issuer credentials


            thirdPartyAuthentication - Using third party authentication


            fidoAuthenticator - FIDO authentication standard
        email:
          maxLength: 128
          minLength: 3
          pattern: ^(.+@.+\..+)?$
          type: string
          description: The customer's email address.
        dateOfBirth:
          pattern: ^([0-9]{4})(-)(1[0-2]|0[1-9])\2(3[01]|0[1-9]|[12][0-9])$
          type: string
          description: The date of birth of the customer.
        history:
          $ref: '#/components/schemas/RiskDataHistory'
      description: Object containing all customer account related risk data.
    RiskDataCustom:
      type: object
      properties:
        number1:
          type: string
          description: Custom numeric value you can use to configure manual fraud rules.
        number2:
          type: string
          description: Custom numeric value you can use to configure manual fraud rules.
        number3:
          type: string
          description: Custom numeric value you can use to configure manual fraud rules.
        number4:
          type: string
          description: Custom numeric value you can use to configure manual fraud rules.
        number5:
          type: string
          description: Custom numeric value you can use to configure manual fraud rules.
        number6:
          type: string
          description: Custom numeric value you can use to configure manual fraud rules.
        number7:
          type: string
          description: Custom numeric value you can use to configure manual fraud rules.
        number8:
          type: string
          description: Custom numeric value you can use to configure manual fraud rules.
        number9:
          type: string
          description: Custom numeric value you can use to configure manual fraud rules.
        string1:
          type: string
          description: Custom string value you can use to configure manual fraud rules.
        string2:
          type: string
          description: Custom string value you can use to configure manual fraud rules.
        string3:
          type: string
          description: Custom string value you can use to configure manual fraud rules.
        string4:
          type: string
          description: Custom string value you can use to configure manual fraud rules.
        string5:
          type: string
          description: Custom string value you can use to configure manual fraud rules.
        string6:
          type: string
          description: Custom string value you can use to configure manual fraud rules.
        string7:
          type: string
          description: Custom string value you can use to configure manual fraud rules.
        string8:
          type: string
          description: Custom string value you can use to configure manual fraud rules.
        string9:
          type: string
          description: Custom string value you can use to configure manual fraud rules.
      description: >-
        An object containing all data that can be used to configure manual fraud
        rules.
    RiskDataGiftCardsPurchase:
      type: object
      properties:
        totalValue:
          $ref: '#/components/schemas/RiskDataTotalValue'
        quantity:
          maximum: 99
          minimum: 1
          type: integer
          description: The number of gift cards being purchased.
          format: int32
      description: Provided when the order is being used to purchase a gift card.
    RiskDataHistory:
      type: object
      properties:
        createdAt:
          pattern: ^([0-9]{4})(-)(1[0-2]|0[1-9])\2(3[01]|0[1-9]|[12][0-9])$
          type: string
          description: The ISO 8601 date of when the customer's account was created.
        modifiedAt:
          pattern: ^([0-9]{4})(-)(1[0-2]|0[1-9])\2(3[01]|0[1-9]|[12][0-9])$
          type: string
          description: The ISO 8601 date of when the customer's account was last modified.
        passwordModifiedAt:
          pattern: ^([0-9]{4})(-)(1[0-2]|0[1-9])\2(3[01]|0[1-9]|[12][0-9])$
          type: string
          description: >-
            The ISO 8601 date of when the customer's account password was last
            modified.
        paymentAccountEnrolledAt:
          pattern: ^([0-9]{4})(-)(1[0-2]|0[1-9])\2(3[01]|0[1-9]|[12][0-9])$
          type: string
          description: >-
            The ISO 8601 date of when the payment account was added to the
            customer's account.
      description: History of the customer's account.
    RiskDataShipping:
      type: object
      properties:
        nameMatchesAccountName:
          type: boolean
          description: >-
            Indicates whether the customer's name matches the name used for the
            shipping address.
        method:
          pattern: >-
            billingAddress|verifiedAddress|otherAddress|store|digital|unshippedTickets|other
          type: string
          description: >
            The shipping method used.


            billingAddress - Ship to customers billing address


            verifiedAddress- Ship to another verified address on file with
            merchant


            otherAddress- Ship to address that is different than billing address


            store - Ship to store (store address should be populated on request)


            digital - Digital goods


            unshippedTickets - Travel and event tickets, not shipped


            other - Other
        timeFrame:
          pattern: electronic|twoDaysPlus|nextDay|sameDay
          type: string
          description: The timeframe to ship the purchased goods.
        email:
          maxLength: 128
          minLength: 3
          pattern: ^(.+@.+\..+)?$
          type: string
          description: The email address used for an electronic delivery.
        firstName:
          maxLength: 22
          minLength: 1
          type: string
          description: The first name of the shipping address.
        lastName:
          maxLength: 22
          minLength: 1
          type: string
          description: The last name of the shipping address.
        address:
          $ref: '#/components/schemas/RiskDataShippingAddress'
      description: Object containing all data related to how the order will be shipped.
    RiskDataShippingAddress:
      required:
        - address1
        - city
        - countryCode
        - postalCode
      type: object
      properties:
        address1:
          maxLength: 80
          minLength: 1
          type: string
          description: Address line 1
        address2:
          maxLength: 80
          minLength: 0
          type: string
          description: Address line 2
        address3:
          maxLength: 80
          minLength: 0
          type: string
          description: Address line 3
        postalCode:
          maxLength: 15
          minLength: 1
          type: string
          description: Address postal code or zip number
        city:
          maxLength: 50
          minLength: 1
          type: string
          description: Address city
        state:
          maxLength: 30
          minLength: 1
          type: string
          description: Address state or region
        countryCode:
          maxLength: 2
          minLength: 2
          pattern: ^[A-Z]{2}$
          type: string
          description: The supported ISO 3166-1 alpha-2 country code
        phoneNumber:
          maxLength: 20
          minLength: 4
          pattern: ^[0-9]*$
          type: string
          description: Address phone number
    RiskDataTotalValue:
      required:
        - amount
        - currency
      type: object
      properties:
        currency:
          maxLength: 3
          minLength: 3
          pattern: ^[A-Z]{3}$
          type: string
          description: >-
            The three character currency code. See list of <a
            href="https://developer.worldpay.com/products/access/reference/useful-tables/#currency-codes">supported
            currencies</a>.
        amount:
          minimum: 0
          type: integer
          description: The amount being placed on the gift card.
          format: int32
      description: The payment amount.
    RiskDataTransaction:
      type: object
      properties:
        reorder:
          type: boolean
          description: Indicates whether this transaction is a reorder of a previous order.
        preOrderDate:
          pattern: ^([0-9]{4})(-)(1[0-2]|0[1-9])\2(3[01]|0[1-9]|[12][0-9])$
          type: string
          description: >-
            Expected ISO 8601 date that a pre-ordered purchase will be
            available.
        firstName:
          maxLength: 22
          minLength: 1
          type: string
          description: Customer's first name.
        lastName:
          maxLength: 22
          minLength: 1
          type: string
          description: Customer's last name.
        phoneNumber:
          maxLength: 20
          minLength: 4
          pattern: ^[0-9]*$
          type: string
          description: Customer's phone number.
        history:
          $ref: '#/components/schemas/RiskDataTransactionHistory'
        giftCardsPurchase:
          $ref: '#/components/schemas/RiskDataGiftCardsPurchase'
      description: Object containing all customer transaction related risk data.
    RiskDataTransactionHistory:
      type: object
      properties:
        attemptsLastDay:
          maximum: 999
          minimum: 0
          type: integer
          description: >-
            Number of transactions (successful or abandoned) for this cardholder
            account within the last 24 hours.
          format: int32
        attemptsLastYear:
          maximum: 999
          minimum: 0
          type: integer
          description: >-
            Number of transactions (successful or abandoned) for this cardholder
            account within the last year.
          format: int32
        completedLastSixMonths:
          maximum: 9999
          minimum: 0
          type: integer
          description: >-
            Number of purchases with this customer account during the previous
            six months.
          format: int32
        addCardsLastDay:
          maximum: 999
          minimum: 0
          type: integer
          description: Number of attempts to add a card in the last 24hrs.
          format: int32
        shippingAddressFirstUsedAt:
          pattern: ^([0-9]{4})(-)(1[0-2]|0[1-9])\2(3[01]|0[1-9]|[12][0-9])$
          type: string
          description: >-
            The ISO 8601 date of when the shipping address, used for this
            transaction, was first used.
      description: Object containing details of the last transaction.
    TokenPaymentInstrument:
      required:
        - href
        - type
      type: object
      allOf:
        - $ref: '#/components/schemas/PaymentInstrument'
        - type: object
          properties:
            href:
              type: string
              description: >-
                The URL to an Access Token, we return this after token creation
                via the API or webhook callback.
    Transaction:
      required:
        - merchant
        - narrative
        - transactionReference
        - value
      type: object
      properties:
        transactionReference:
          maxLength: 64
          minLength: 1
          pattern: ^[a-zA-Z0-9\-\_\/\!\@\#\$\%\(\)\*\=\.\:\;\?\[\]\{\}\~\+]*$
          type: string
          description: >-
            A unique reference generated by you that is used to identify a
            payment throughout its lifecycle.
        merchant:
          $ref: '#/components/schemas/Merchant'
        description:
          maxLength: 128
          minLength: 0
          type: string
          description: >-
            An optional text, when supplied is displayed to your customer on
            payment pages.
        narrative:
          $ref: '#/components/schemas/Narrative'
        billingAddress:
          $ref: '#/components/schemas/BillingAddress'
        value:
          $ref: '#/components/schemas/Value'
        resultURLs:
          $ref: '#/components/schemas/ResultURLs'
        riskData:
          $ref: '#/components/schemas/RiskData'
        expiry:
          maximum: 2592000
          minimum: 300
          type: integer
          description: >-
            Allows you to configure the duration, in seconds, your customer can
            access the payment link.
          format: int64
          default: 3600
        createToken:
          $ref: '#/components/schemas/CreateToken'
        paymentInstrument:
          $ref: '#/components/schemas/PaymentInstrument'
      description: The request used to setup a new HPP URL.
    Value:
      required:
        - amount
      type: object
      properties:
        currency:
          type: string
          description: >-
            The three character currency code. See list of <a
            href="https://developer.worldpay.com/products/access/reference/useful-tables/#currency-codes">supported
            currencies</a>.
        amount:
          minimum: 1
          type: integer
          description: >-
            The payment amount. This is a whole number with an exponent e.g. if
            exponent is two, 250 is 2.50.
          format: int64
      description: The payment amount.
    SuccessfulCreateTransactionResponse:
      type: object
      properties:
        url:
          type: string
          description: >-
            The URL of HPP, where your customer can be redirected to complete
            their payment.
      description: Response for when a HPP URL is created.
    AwpApiErrorResponse:
      type: object
      properties:
        errorName:
          type: string
        message:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      scheme: BasicAuth
