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

# Get Deposit On-Chain Status

> This endpoint will be used to get the status of the deposit onchain request

Get the status of a deposit on-chain transaction, including both mobile money collection and blockchain transfer details.

## Response Structure

The response contains two parts:

1. **mobile\_money** - Status of the mobile money collection
2. **onchain** - Status of the blockchain transfer

## Status Values

### Mobile Money Status

| Status       | Description                         |
| ------------ | ----------------------------------- |
| `PENDING`    | STK push sent, waiting for customer |
| `SUCCESSFUL` | Payment collected successfully      |
| `FAILED`     | Payment failed or cancelled         |

### Crypto Received Status

| Status       | Description                        |
| ------------ | ---------------------------------- |
| `PENDING`    | Blockchain transaction in progress |
| `SUCCESSFUL` | Crypto received at destination     |
| `FAILED`     | Blockchain transaction failed      |

## Example Response

```json theme={null}
{
  "data": {
    "mobile_money": {
      "id": "dep_abc123",
      "status": "SUCCESSFUL",
      "amount": 1450,
      "currency": "CDF",
      "transaction_amount": 1450,
      "transaction_cost": 50,
      "reference_id": "order_12345",
      "provider": "VODACOM",
      "created_at": "2025-01-07T12:00:00Z"
    },
    "onchain": {
      "status": "SUCCESSFUL",
      "crypto_received_status": "SUCCESSFUL",
      "chain": "POLYGON",
      "token": "USDT",
      "public_address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
      "crypto_amount": 0.65,
      "transaction_hash": "0xabc...def"
    }
  }
}
```

## Webhook Notification

You'll receive a webhook when the transaction completes:

```json theme={null}
{
  "event": "deposit.onchain.successful",
  "data": {
    "reference_id": "order_12345",
    "status": "SUCCESSFUL",
    "mobile_money_status": "SUCCESSFUL",
    "crypto_received_status": "SUCCESSFUL",
    "amount": 1450,
    "currency": "CDF",
    "crypto_amount": 0.65,
    "chain": "POLYGON",
    "token": "USDT",
    "transaction_hash": "0xabc...def",
    "created_at": "2025-01-07T12:00:00Z",
    "completed_at": "2025-01-07T12:02:30Z"
  }
}
```


## OpenAPI

````yaml GET /api/v3/deposit/on-chain/status/{reference_id}
openapi: 3.0.0
info:
  title: KOTANI PAY API PLATFORM
  description: ''
  version: '3.0'
  contact: {}
servers:
  - url: https://preview.kotanipay.com
security: []
tags: []
paths:
  /api/v3/deposit/on-chain/status/{reference_id}:
    get:
      tags:
        - DEPOSIT
      summary: Get Deposit Onchain Status
      description: >-
        This endpoint will be used to get the status of the deposit onchain
        request
      operationId: DepositOnchainController_getWithdrawalStatus_api/v3
      parameters:
        - name: reference_id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Deposit status successfully retrieved.
                  data:
                    $ref: '#/components/schemas/OnchainDepositResponse'
                    type: object
        '400':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Bad Request
                  data:
                    type: object
                    example: {}
        '401':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
                  data:
                    type: object
                    example: {}
        '404':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Not Found
                  data:
                    type: object
                    example: {}
      deprecated: true
      security:
        - JWT: []
components:
  schemas:
    OnchainDepositResponse:
      type: object
      properties:
        mobile_money:
          description: mobile money status
          allOf:
            - $ref: '#/components/schemas/DepositStatusResponseDto'
        onchain:
          description: onchain status
          allOf:
            - $ref: '#/components/schemas/DepositMobileMoneyOnchainResponse'
      required:
        - mobile_money
        - onchain
    DepositStatusResponseDto:
      type: object
      properties:
        id:
          type: string
          description: deposit id
          example: 5f9b2c7b9c9d6b0017b4e6b1
        amount:
          type: number
          description: amount to deposit
          example: 10
        wallet_id:
          type: string
          description: deposit id
          example: 5f9b2c7b9c9d6b0017b4e6b1
        callback_url:
          type: string
          description: callback url
          example: https://example.com
        customer_redirect_url:
          type: string
          description: customer redirect url
          example: https://example.com/success
        reference_id:
          type: string
          description: reference id
          example: 5f9b2c7b9c9d6b0017b4e6b1
        currency:
          type: string
          description: >-
            Override transaction currency (e.g. USD for USD mobile money in
            Congo/Zambia). When provided and matches the wallet currency,
            phone-country currency validation is skipped.
          example: USD
        provider:
          type: string
        providerReference:
          type: string
        providerRequest:
          type: string
        providerResponse:
          type: string
        callbackUrlStatus:
          type: number
        callbackResponse:
          type: string
        callbackPayload:
          type: object
        transactionError:
          type: string
        retries:
          type: number
        network:
          type: string
        environment:
          type: string
        integratorsAmount:
          type: number
        wallet:
          type: object
        customer:
          type: object
        paymentLinkTransaction:
          type: object
        updatedAt:
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/DEPOSIT_STATUS'
        confirmation_id:
          type: string
        reference_number:
          type: number
        created_at:
          format: date-time
          type: string
        transaction_cost:
          type: number
        transaction_amount:
          type: number
        customer_key:
          type: string
        threeDSEci:
          type: string
        uniqueIdentifier:
          type: string
        initialDepositBalance:
          type: number
        finalDepositBalance:
          type: number
        error_message:
          type: string
        error_code:
          type: string
        error_description:
          type: string
        telco_id:
          type: string
          description: >-
            Telco/MNO transaction ID from the mobile money provider (e.g. Mpesa
            transaction code)
      required:
        - id
        - amount
        - wallet_id
        - status
        - reference_number
        - created_at
        - transaction_cost
        - transaction_amount
        - customer_key
    DepositMobileMoneyOnchainResponse:
      type: object
      properties:
        public_address:
          type: string
          description: The transaction public address
        chain:
          description: supported chain
          allOf:
            - $ref: '#/components/schemas/Chain'
        token:
          description: supported token
          allOf:
            - $ref: '#/components/schemas/StableCoin'
        reference_id:
          type: string
          description: Optional reference id
        crypto_amount:
          type: string
          description: crypto amount
        transaction_hash:
          type: string
          description: transaction hash
        status:
          description: transaction status
          allOf:
            - $ref: '#/components/schemas/DEPOSIT_STATUS'
        crypto_received_status:
          description: crypto received status
          allOf:
            - $ref: '#/components/schemas/DEPOSIT_STATUS'
      required:
        - chain
        - token
    DEPOSIT_STATUS:
      type: string
      enum:
        - PENDING
        - INITIATED
        - SUCCESSFUL
        - FAILED
        - EXPIRED
        - CANCELLED
        - DECLINED
        - REVERSED
        - IN_PROGRESS
        - DUPLICATE
        - ERROR_OCCURRED
        - REQUIRE_REVIEW
        - SUCCESS
        - RETRY
        - PERMANENTLY_FAILED
    Chain:
      type: string
      enum:
        - ETHEREUM
        - CELO
        - AVALANCHE
        - POLYGON
        - ARBITRUM
        - OPTIMISM
        - STELLAR
        - TRON
        - FUSE
        - LIGHTNING
        - SOLANA
        - PROVENANCE
        - CARDANO
        - HEDERA
        - BASE
        - LISK
        - VICTION
        - SCROLL
      description: The chain of the wallet.Its required if the wallet is a crypto wallet
    StableCoin:
      type: string
      enum:
        - CUSD
        - USDC
        - USDT
        - USDT0
        - SAT
        - BTC
        - HASH
        - FUSE
        - HBAR
        - USDGLO
        - CKES
        - CGHS
        - MSAT
        - XLM
        - ADA
      description: The currency of the wallet
  securitySchemes:
    JWT:
      scheme: bearer
      bearerFormat: JWT
      type: http

````