> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spacepay.solutions/llms.txt
> Use this file to discover all available pages before exploring further.

# List payments



## OpenAPI

````yaml /api-reference/openapi.json get /v1/external/secretkey-auth/payments
openapi: 3.0.0
info:
  title: SpacePay External API
  description: Merchant-facing SpacePay API endpoints.
  version: '1.0'
servers:
  - url: https://api.spacepay.solutions
    description: Mainnet
  - url: https://api-testnet.spacepay.solutions
    description: Testnet
security: []
tags:
  - name: External - Token Registry (Public)
  - name: External - Payments (Secret Key)
  - name: External - Withdrawals (Secret Key)
  - name: External - Wallet (Secret Key)
paths:
  /v1/external/secretkey-auth/payments:
    get:
      tags:
        - External - Payments (Secret Key)
      summary: List payments
      operationId: ExternalPaymentsBySecretKeyController_getPayments
      parameters:
        - name: type
          required: false
          in: query
          description: Filter by payment type
          schema:
            example: payment
            type: string
            enum:
              - payment
              - deposit
        - name: status
          required: false
          in: query
          description: Filter by payment status
          schema:
            example: pending
            type: string
            enum:
              - pending
              - processing
              - completed
              - failed
              - expired
              - cancelled
        - name: search
          required: false
          in: query
          description: >-
            Search by partial match of payment ID, deposit wallet address,
            merchant short name, receipt tx hash, receipt tx sender address
          schema:
            example: Merchant name
            type: string
        - name: sortBy
          required: false
          in: query
          description: Field to sort by
          schema:
            example: createdAt
            type: string
            enum:
              - createdAt
              - amountInCents
        - name: sortOrder
          required: false
          in: query
          description: Sort order
          schema:
            example: DESC
            type: string
            enum:
              - ASC
              - DESC
        - name: limit
          required: false
          in: query
          description: Number of items to return
          schema:
            minimum: 1
            maximum: 1000
            default: 100
            example: 50
            type: number
        - name: offset
          required: false
          in: query
          description: Number of items to skip
          schema:
            minimum: 0
            default: 0
            example: 0
            type: number
      responses:
        '200':
          description: Payments retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMerchantPaymentDtoResult'
      security:
        - Secret Key: []
components:
  schemas:
    PaginatedMerchantPaymentDtoResult:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MerchantPaymentDto'
        pagination:
          $ref: '#/components/schemas/PaginationMetaDto'
      required:
        - data
        - pagination
    MerchantPaymentDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Payment ID
        merchantId:
          type: string
          format: uuid
          description: Merchant ID
        merchantShortName:
          type: string
          description: Merchant short name
        merchantLogoUrl:
          type: string
          nullable: true
          description: Merchant logo URL
        type:
          enum:
            - payment
            - deposit
          type: string
          description: Payment type
        amountInCents:
          type: number
          description: Payment amount in cents
        amountDueCents:
          type: number
          description: >-
            Amount due in cents. Provisional until a quote is paid, then
            finalized to the paid quote (chain-specific convenience fee).
        convenienceFeeCents:
          type: number
          nullable: true
          description: >-
            Convenience fee in cents charged to the buyer. Null until the
            payment settles.
        merchantFeeCents:
          type: number
          nullable: true
          description: >-
            Merchant fee in cents deducted from the merchant. Null until the
            payment settles.
        swapFeeCents:
          type: number
          nullable: true
          description: >-
            Swap fee in cents deducted from the merchant. Null until the payment
            settles.
        currency:
          type: string
          enum:
            - USD
          description: Currency of the payment
        status:
          enum:
            - pending
            - processing
            - completed
            - failed
            - expired
            - cancelled
          type: string
          description: Payment status
        quotes:
          description: Quotes
          type: array
          items:
            $ref: '#/components/schemas/PaymentQuoteDto'
        receipt:
          nullable: true
          description: Receipt
          allOf:
            - $ref: '#/components/schemas/PaymentReceiptDto'
        orderId:
          type: string
          nullable: true
          description: Order ID
        redirectUrl:
          type: string
          nullable: true
          description: Redirect URL
        createdAt:
          format: date-time
          type: string
          description: Created at
        amountMerchantNetCents:
          type: number
          description: Amount the merchant receives after fees, in cents
      required:
        - id
        - merchantId
        - merchantShortName
        - merchantLogoUrl
        - type
        - amountInCents
        - amountDueCents
        - convenienceFeeCents
        - merchantFeeCents
        - swapFeeCents
        - currency
        - status
        - quotes
        - receipt
        - orderId
        - redirectUrl
        - createdAt
        - amountMerchantNetCents
    PaginationMetaDto:
      type: object
      properties:
        total:
          type: number
        limit:
          type: number
        offset:
          type: number
        hasMore:
          type: boolean
        totalPages:
          type: number
        currentPage:
          type: number
      required:
        - total
        - limit
        - offset
        - hasMore
        - totalPages
        - currentPage
    PaymentQuoteDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Quote ID
        paymentId:
          type: string
          format: uuid
          description: Payment ID
        token:
          description: Token
          allOf:
            - $ref: '#/components/schemas/TokenDto'
        chainId:
          type: string
          description: CAIP-2 chain id
          example: eip155:1
        depositAddress:
          description: Deposit address for this quote
          allOf:
            - $ref: '#/components/schemas/DepositAddressDto'
        expectedAmountAsset:
          type: string
          description: Expected amount asset
        rateUsdAsset:
          type: number
          description: Rate USD asset
        amountDueCents:
          type: number
          nullable: true
          description: >-
            Amount the buyer pays for this quote in cents, including the
            convenience fee. Null for quotes without a resolved fee breakdown.
        expiresAt:
          format: date-time
          type: string
          description: Expires at
        status:
          enum:
            - active
            - expired
            - used
            - failed
          type: string
          description: Status
        createdAt:
          format: date-time
          type: string
          description: Created at
      required:
        - id
        - paymentId
        - token
        - chainId
        - depositAddress
        - expectedAmountAsset
        - rateUsdAsset
        - amountDueCents
        - expiresAt
        - status
        - createdAt
    PaymentReceiptDto:
      type: object
      properties:
        paymentId:
          type: string
          format: uuid
          description: Payment ID
        selectedQuote:
          description: Selected quote
          allOf:
            - $ref: '#/components/schemas/PaymentQuoteDto'
        settledToken:
          description: Settled token
          allOf:
            - $ref: '#/components/schemas/TokenDto'
        settledChain:
          description: Settled chain
          allOf:
            - $ref: '#/components/schemas/ChainDto'
        settledAmountAsset:
          type: string
          description: Settled amount in asset
          example: '100'
        settledAmountUsd:
          type: string
          description: Settled amount in USD
          example: '100.00'
        txHash:
          type: string
          nullable: true
          description: Transaction hash
          example: '0xda3be87732110de6c1354c83770aae630ede9ac308d9f7b399ecfba23d923384'
        txBlockNumber:
          type: number
          nullable: true
          description: Block number
          example: 123456
        txTimestamp:
          format: date-time
          type: string
          nullable: true
          description: Timestamp
          example: '2021-01-01T00:00:00.000Z'
        txSenderAddress:
          type: string
          nullable: true
          description: Sender address
          example: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
        txGasUsed:
          type: number
          nullable: true
          description: Gas used
          example: 100000
        txTotalCost:
          type: string
          nullable: true
          description: Total cost
          example: '1000000000000000000'
        txTotalCostUsdFractions:
          type: number
          nullable: true
          description: Total cost in USD, 6 decimals of precision
          example: 1000000
        txIsSponsored:
          type: boolean
          nullable: true
          description: Is transaction sponsored
          example: true
        processedBy:
          nullable: true
          enum:
            - webhook
            - frontend
            - cron
            - manual
            - shout_webhook
          type: string
          description: Who processed the transaction (webhook, frontend, cron)
          example: webhook
        txRiskScore:
          type: number
          nullable: true
          description: Transaction risk score (1-100, higher is safer)
          example: 85
        txRiskSeverity:
          nullable: true
          enum:
            - CRITICAL_RISK
            - HIGH_RISK
            - MEDIUM_RISK
            - LOW_RISK
            - NO_RISK
          type: string
          description: Transaction risk severity label
          example: LOW_RISK
        txRiskProvider:
          type: string
          nullable: true
          description: Transaction risk provider identifier
          example: scorechain
        createdAt:
          format: date-time
          type: string
          description: Created at
      required:
        - paymentId
        - selectedQuote
        - settledToken
        - settledChain
        - settledAmountAsset
        - settledAmountUsd
        - txHash
        - txBlockNumber
        - txTimestamp
        - txSenderAddress
        - txGasUsed
        - txTotalCost
        - txTotalCostUsdFractions
        - txIsSponsored
        - processedBy
        - txRiskScore
        - txRiskSeverity
        - txRiskProvider
        - createdAt
    TokenDto:
      type: object
      properties:
        id:
          type: string
          description: Token ID
          example: 123e4567-e89b-12d3-a456-426614174000
        coingeckoApiId:
          type: string
          description: Coingecko API ID
          example: ethereum
        chain:
          description: Chain information
          allOf:
            - $ref: '#/components/schemas/ChainDto'
        symbol:
          type: string
          description: Token symbol
          example: USDC
        contractAddress:
          type: string
          description: Token contract address (lowercase)
          example: '0xa0b86a33e6441b8c4c8c0c0c0c0c0c0c0c0c0c0'
        decimals:
          type: number
          description: Token decimals
          example: 6
        type:
          enum:
            - stablecoin
            - volatile
          type: string
          description: Token type
          example: stablecoin
        assetType:
          enum:
            - native
            - erc20
          type: string
          description: Token asset type
          example: native
        status:
          enum:
            - active
            - deprecated
            - blocked
          type: string
          description: Token status
          example: active
        tokenPriceUsd:
          type: number
          nullable: true
          description: Token price in USD
          example: 1
      required:
        - id
        - coingeckoApiId
        - chain
        - symbol
        - contractAddress
        - decimals
        - type
        - assetType
        - status
        - tokenPriceUsd
    DepositAddressDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Deposit address ID
        paymentId:
          type: string
          nullable: true
        type:
          type: string
          enum:
            - EVM
        address:
          type: string
          description: Token contract address (lowercase)
          example: '0xa0b86a33e6441b8c4c8c0c0c0c0c0c0c0c0c0c0'
        createdAt:
          format: date-time
          type: string
      required:
        - id
        - type
        - address
        - createdAt
    ChainDto:
      type: object
      properties:
        chainId:
          type: string
          description: CAIP-2 chain id
          example: eip155:1
        name:
          type: string
          description: Chain name
          example: Ethereum
        nativeSymbol:
          type: string
          description: Native token symbol
          example: ETH
        nativeDecimals:
          type: number
          description: Native token decimals
          example: 18
        isEnabled:
          type: boolean
          description: Whether the chain is enabled
          example: true
        isTestnet:
          type: boolean
          description: Whether the chain is a testnet
          example: false
      required:
        - chainId
        - name
        - nativeSymbol
        - nativeDecimals
        - isEnabled
        - isTestnet
  securitySchemes:
    Secret Key:
      type: apiKey
      in: header
      name: x-spacepay-secret-key
      description: Secret key for authentication of external API.

````