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

# Get payment status



## OpenAPI

````yaml GET /api/v1/archive/payment-statuses/latest
openapi: 3.0.0
info:
  title: Gatekeeper docs
  description: gatekeeper API
  version: 0.0.1
  contact: {}
servers: []
security: []
tags: []
externalDocs:
  description: JSON document
  url: /api/docs-json
paths:
  /api/v1/archive/payment-statuses/latest:
    get:
      tags:
        - Payment Archive
      summary: Get the latest payment status for the provided payment ID
      operationId: PaymentStatusesController_getLatestByPaymentId_v1
      parameters:
        - name: paymentId
          required: true
          in: query
          description: Kashimi payment ID
          schema:
            type: string
            example: 123e4567-e89b-12d3-a456-426614174000
        - name: Authorization
          in: header
          description: Bearer token for authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Returns the latest payment status for the given payment ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLatestPaymentStatusOutputDto'
        '400':
          description: The request is not formatted correctly
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorOutputDto'
                example:
                  statusCode: 400
                  title: Bad Request
                  message: Invalid UUID format
              example:
                statusCode: 400
                title: Bad Request
                message: Invalid UUID format
        '401':
          description: >-
            Your access token was either not passed with the request, or it is
            invalid (e.g. expired or malformed). Make sure to pass the token in
            the Authorization header, and obtain a new one if it has expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorOutputDto'
              example:
                statusCode: 401
                title: Unauthorized
                message: Unauthorized
        '403':
          description: You do not have the necessary permissions to perform this action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorOutputDto'
              example:
                statusCode: 403
                title: Forbidden
                message: Access denied
        '404':
          description: The payment status with the specified payment ID was not found
          content:
            application/json:
              example:
                statusCode: 404
                title: Not Found
                message: Payment status not found
      security:
        - bearer: []
      x-codeSamples:
        - lang: cURL
          source: >

            curl --location --request GET
            "https://api.kashimi.tech/api/v1/archive/payment-statuses/latest?paymentId=123e4567-e89b-12d3-a456-426614174000"

            --header "Accept: application/json"

            --header "Authorization: Bearer YOUR_ACCESS_TOKEN" 
components:
  schemas:
    GetLatestPaymentStatusOutputDto:
      type: object
      properties:
        id:
          type: string
          description: Unique payment status identifier
          example: e68eee70-bfe9-4885-8650-46ec7d017458
        paymentId:
          type: string
          description: Unique payment identifier
          example: 123e4567-e89b-12d3-a456-426614174000
        status:
          type: string
          description: >-
            Payment status. There are 3 main values: `PENDING`, `COMPLETED`,
            `FAILED`. In very rare cases, caused by internal system issues, the
            status might resolve to `UNKNOWN`
          enum:
            - PENDING
            - COMPLETED
            - FAILED
            - UNKNOWN
          example: PENDING
        detailedStatus:
          type: string
          description: Detailed payment status
          enum:
            - PROVIDER_SELECTION_REDIRECT_PENDING
            - PROVIDER_SELECTION_CALLBACK_PROCESSING_PENDING
            - FOLLOWUP_DATA_COLLECTION_REQUIRED_CHECK_PENDING
            - FOLLOWUP_DATA_COLLECTION_REDIRECT_PENDING
            - FOLLOWUP_DATA_COLLECTION_CALLBACK_PROCESSING_PENDING
            - FOLLOWUP_DATA_COLLECTION_CALLBACK_PROCESSING_FAILED
            - SENDER_AUTHORIZATION_REQUIRED_CHECK_PENDING
            - SENDER_AUTHORIZATION_REDIRECT_PENDING
            - SENDER_AUTHORIZATION_REDIRECT_FAILED
            - SENDER_AUTHORIZATION_CALLBACK_PROCESSING_PENDING
            - SENDER_AUTHORIZATION_CALLBACK_PROCESSING_FAILED
            - SENDER_ACCOUNT_REQUIRED_CHECK_PENDING
            - SENDER_ACCOUNT_INFORMATION_CONSENT_REQUIRED_CHECK_PENDING
            - SENDER_ACCOUNT_INFORMATION_CONSENT_REDIRECT_PENDING
            - SENDER_ACCOUNT_INFORMATION_CONSENT_REDIRECT_FAILED
            - SENDER_ACCOUNT_INFORMATION_CONSENT_CALLBACK_PROCESSING_PENDING
            - SENDER_ACCOUNT_INFORMATION_CONSENT_CALLBACK_PROCESSING_FAILED
            - SENDER_ACCOUNT_LIST_RETRIEVAL_PENDING
            - SENDER_ACCOUNT_LIST_RETRIEVAL_FAILED
            - SENDER_ACCOUNT_SELECTION_REQUIRED_CHECK_PENDING
            - SENDER_ACCOUNT_SELECTION_REQUIRED_CHECK_FAILED
            - SENDER_ACCOUNT_SELECTION_REDIRECT_PENDING
            - SENDER_ACCOUNT_SELECTION_REDIRECT_FAILED
            - SENDER_ACCOUNT_SELECTION_CALLBACK_PROCESSING_PENDING
            - SENDER_ACCOUNT_SELECTION_CALLBACK_PROCESSING_FAILED
            - PAYMENT_REGISTRATION_PENDING
            - PAYMENT_REGISTRATION_FAILED
            - >-
              PAYMENT_CONSENT_AUTHENTICATION_METHOD_SELECTION_REQUIRED_CHECK_PENDING
            - >-
              PAYMENT_CONSENT_AUTHENTICATION_METHOD_SELECTION_REQUIRED_CHECK_FAILED
            - PAYMENT_CONSENT_AUTHENTICATION_METHOD_SELECTION_REDIRECT_PENDING
            - >-
              PAYMENT_CONSENT_AUTHENTICATION_METHOD_SELECTION_CALLBACK_PROCESSING_PENDING
            - >-
              PAYMENT_CONSENT_AUTHENTICATION_METHOD_SELECTION_CALLBACK_PROCESSING_FAILED
            - PAYMENT_CONSENT_REQUIRED_CHECK_PENDING
            - PAYMENT_CONSENT_REDIRECT_PENDING
            - PAYMENT_CONSENT_REDIRECT_FAILED
            - PAYMENT_CONSENT_CALLBACK_PROCESSING_PENDING
            - PAYMENT_CONSENT_CALLBACK_PROCESSING_FAILED
            - PAYMENT_EXECUTION_PENDING
            - PAYMENT_EXECUTION_COMPLETED
            - PAYMENT_EXECUTION_FAILED
          example: PAYMENT_CONSENT_CALLBACK_PROCESSING_PENDING
        failureReasons:
          type: array
          description: 'Failure reasons (for `status: FAILED` only)'
          example:
            - AMOUNT_EXCEEDS_AVAILABLE_FUNDS
          items:
            type: string
            enum:
              - UNKNOWN_ERROR
              - INTERNAL_TECHNICAL_ERROR
              - PAYMENT_EXPIRED
              - SENDER_CREDENTIALS_INVALID
              - REMITTANCE_INFORMATION_INVALID
              - SENDER_ACCOUNT_INVALID
              - RECIPIENT_ACCOUNT_INVALID
              - RECIPIENT_NAME_INVALID
              - CURRENCY_INVALID
              - AMOUNT_EXCEEDS_AVAILABLE_FUNDS
              - AMOUNT_EXCEEDS_DAILY_LIMIT
              - AMOUNT_EXCEEDS_MONTHLY_LIMIT
              - AMOUNT_EXCEEDS_LIMIT
              - PAYMENT_SCHEME_NOT_ALLOWED
              - PAYMENT_SCHEME_MODE_INSTANT_NOT_ALLOWED
              - PROVIDER_AGREEMENT_MISSING
              - SENDER_BLOCKED
              - SENDER_RIGHTS_MISSING
              - SENDER_ACCOUNT_BLOCKED
              - PAYMENT_ABORTED_BY_SENDER
              - PAYMENT_ABORTED_BY_PROVIDER
              - PAYMENT_ABORTED_BY_PLATFORM
              - CALLBACK_NOT_RECEIVED
              - SENDER_AUTHORIZATION_NOT_GRANTED
              - ACCOUNT_INFORMATION_CONSENT_NOT_GRANTED
              - PAYMENT_CONSENT_INCOMPLETE
              - PAYMENT_CONSENT_NOT_GRANTED
              - PROVIDER_TECHNICAL_ERROR
              - MTLS_CERTIFICATE_INVALID
              - SIGNATURE_CERTIFICATE_INVALID
        createdAt:
          format: date-time
          type: string
          description: Timestamp of status creation
          example: '2023-10-01T12:00:00Z'
      required:
        - id
        - paymentId
        - status
        - detailedStatus
        - failureReasons
        - createdAt
    ErrorOutputDto:
      type: object
      properties:
        title:
          type: string
          description: Name of the error
        statusCode:
          type: number
          description: HTTP status code
        message:
          type: string
          description: Error message
      required:
        - title
        - statusCode
        - message

````