Skip to main content
POST/collection/v1/status

Payment Status

Check real-time payment collection status via Paywize API.

Last updated: 2026-02-21

Status Check

Overview

Check the current status of a payment transaction using either the transaction ID (txnId) or sender ID (senderId). This endpoint provides real-time transaction status and payment details.

Quick Reference

AttributeDetails
MethodGET
URLhttps://merchant.paywize.in/api/collection/v1/status
AuthenticationBearer token required
Content-Typeapplication/json
EncryptionResponse data is AES-256-CBC encrypted
Rate Limit200 requests/minute

Endpoint

Authentication Required: Bearer token

Authentication

This endpoint requires a valid JWT Bearer token. Learn how to generate tokens: Authentication Guide →

Request Headers

Content-Type: application/json
Authorization: Bearer <jwt_token>

Query Parameters

You must provide either txnId or senderId (not both):

ParameterRequiredTypeDescription
txnIdOptionalStringUnique transaction ID provided by Paywize
senderIdOptionalStringUnique sender ID provided by merchant

Note: You must provide either txnId OR senderId, but not both.

Sample Requests

Using Transaction ID

GET https://merchant.paywize.in/api/collection/v1/status?txnId=CFCE140825000009

Using Sender ID

GET https://merchant.paywize.in/api/collection/v1/status?senderId=SENDERID000345

Response

Success Response (200 OK)

{
  "respCode": 2000,
  "respMessage": "Transaction status fetched successfully",
  "data": "0oA+t8GGuDZ0FrEbhM9bZ2pxTDZTaHRWRW1tQnN0dWUxVC92Yi9WQW9SSFdlTk56Ri9EYmVWTmVGNTF1R3FVSnFRVWJUaFpqbTk4RTZrandTa25ke"
}

Decrypted Response Data

{
  "senderId": "SENDERID00001",
  "txnId": "CFCE160825000001",
  "requestAmount": "100.00",
  "paymentMode": "Intent",
  "utr": "405812345678",
  "remarks": "test",
  "status": "SUCCESS",
  "statusMessage": "Payment completed successfully",
  "createdAt": "2025-08-16T07:46:45.277Z",
  "updatedAt": "2025-08-16T08:18:15.378Z"
}

Response Fields

FieldDescription
senderIdMerchant provided unique sender ID
txnIdPaywize generated unique transaction ID
requestAmountPayment amount requested
paymentModePayment method used (Intent, etc.)
utrUnique Transaction Reference from bank
remarksPayment remarks/description
statusCurrent transaction status
statusMessageDetailed status description
createdAtTransaction creation timestamp
updatedAtLast update timestamp

Transaction Status Values

StatusDescription
INITIATEDPayment request created, awaiting customer action
SUCCESSPayment completed successfully
FAILEDPayment failed
PENDINGPayment under review

Error Responses

CodeMessageDescription
2000Transaction status fetched successfullySuccess
4000Either Transaction ID (txnId) or Sender ID (senderId) is requiredMissing required parameter
4008Unauthorized – invalid or expired tokenToken is invalid or expired
4104Transaction not foundTransaction does not exist
4103Provide either senderId or txnId. Not both.Both parameters provided
4105Missing or invalid txnId formatInvalid txnId format
4107Unauthorized: Transaction does not belong to this merchantAccess denied
5000Internal server errorServer error

Implementation Examples

JavaScript

import crypto from 'crypto';

// Decryption function
function decryptMerchantData(data, key, iv) {
  const decipher = crypto.createDecipheriv('aes-256-cbc', key, iv);
  const decrypted = Buffer.concat([
    decipher.update(Buffer.from(data, 'base64')),
    decipher.final()
  ]);
  return decrypted.toString('utf8');
}

async function checkPaymentStatus(token, txnId = null, senderId = null, apiKey, secretKey) {
  // Validate parameters
  if (!txnId && !senderId) {
    throw new Error('Either txnId or senderId is required');
  }
  if (txnId && senderId) {
    throw new Error('Provide either txnId or senderId, not both');
  }

  // Build query parameter
  const queryParam = txnId ? `txnId=${txnId}` : `senderId=${senderId}`;
  const url = `https://merchant.paywize.in/api/collection/v1/status?${queryParam}`;

  const response = await fetch(url, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${token}`
    }
  });

  const result = await response.json();

  if (result.respCode === 2000) {
    // Decrypt the response data
    const decryptedData = decryptMerchantData(result.data, apiKey, secretKey);
    return JSON.parse(decryptedData);
  } else {
    throw new Error(`API Error ${result.respCode}: ${result.respMessage}`);
  }
}

// Usage examples
try {
  // Check by transaction ID
  const statusByTxnId = await checkPaymentStatus(jwtToken, 'CFCE140825000009', null, apiKey, secretKey);
  console.log('Status by txnId:', statusByTxnId);

  // Check by sender ID
  const statusBySenderId = await checkPaymentStatus(jwtToken, null, 'SENDERID000345', apiKey, secretKey);
  console.log('Status by senderId:', statusBySenderId);

} catch (error) {
  console.error('Status check failed:', error.message);
}

Python

import requests
import json
from encryption_utils import decrypt_merchant_data

def check_payment_status(token, api_key, secret_key, txn_id=None, sender_id=None):
    # Validate parameters
    if not txn_id and not sender_id:
        raise ValueError('Either txn_id or sender_id is required')
    if txn_id and sender_id:
        raise ValueError('Provide either txn_id or sender_id, not both')

    # Build query parameter
    query_param = f'txnId={txn_id}' if txn_id else f'senderId={sender_id}'
    url = f'https://merchant.paywize.in/api/collection/v1/status?{query_param}'

    response = requests.get(
        url,
        headers={
            'Content-Type': 'application/json',
            'Authorization': f'Bearer {token}'
        }
    )

    result = response.json()

    if result['respCode'] == 2000:
        # Decrypt the response data
        decrypted_data = decrypt_merchant_data(result['data'], api_key, secret_key)
        return json.loads(decrypted_data)
    else:
        raise Exception(f"API Error {result['respCode']}: {result['respMessage']}")

# Usage examples
try:
    # Check by transaction ID
    status_by_txn_id = check_payment_status(jwt_token, api_key, secret_key, txn_id='CFCE140825000009')
    print('Status by txnId:', status_by_txn_id)

    # Check by sender ID
    status_by_sender_id = check_payment_status(jwt_token, api_key, secret_key, sender_id='SENDERID000345')
    print('Status by senderId:', status_by_sender_id)

except Exception as error:
    print('Status check failed:', str(error))

PHP

<?php

require_once 'PaywizeEncryption.php';

function checkPaymentStatus($token, $apiKey, $secretKey, $txnId = null, $senderId = null) {
    // Validate parameters
    if (!$txnId && !$senderId) {
        throw new InvalidArgumentException('Either txnId or senderId is required');
    }
    if ($txnId && $senderId) {
        throw new InvalidArgumentException('Provide either txnId or senderId, not both');
    }

    // Build query parameter
    $queryParam = $txnId ? "txnId=$txnId" : "senderId=$senderId";
    $url = "https://merchant.paywize.in/api/collection/v1/status?$queryParam";

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPGET, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'Content-Type: application/json',
        'Authorization: Bearer ' . $token
    ]);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $response = curl_exec($ch);
    curl_close($ch);

    $result = json_decode($response, true);

    if ($result['respCode'] == 2000) {
        // Decrypt the response data
        $decryptedData = PaywizeEncryption::decryptMerchantData($result['data'], $apiKey, $secretKey);
        return json_decode($decryptedData, true);
    } else {
        throw new Exception("API Error {$result['respCode']}: {$result['respMessage']}");
    }
}

// Usage examples
try {
    // Check by transaction ID
    $statusByTxnId = checkPaymentStatus($jwtToken, $apiKey, $secretKey, 'CFCE140825000009');
    echo "Status by txnId: " . json_encode($statusByTxnId) . "\n";

    // Check by sender ID
    $statusBySenderId = checkPaymentStatus($jwtToken, $apiKey, $secretKey, null, 'SENDERID000345');
    echo "Status by senderId: " . json_encode($statusBySenderId) . "\n";

} catch (Exception $error) {
    echo "Status check failed: " . $error->getMessage() . "\n";
}

?>

cURL Example

# Check status by transaction ID
curl -X GET "https://merchant.paywize.in/api/collection/v1/status?txnId=CFCE140825000009" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

# Check status by sender ID
curl -X GET "https://merchant.paywize.in/api/collection/v1/status?senderId=SENDERID000345" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Best Practices

  1. Parameter Validation: Always validate that either txnId or senderId is provided, but not both
  2. Error Handling: Implement proper error handling for all possible response codes
  3. Token Management: Ensure your JWT token is valid and refresh if expired
  4. Polling Strategy: For real-time updates, consider implementing webhooks instead of frequent polling
  5. Data Decryption: Always decrypt response data to access actual transaction details
  6. Logging: Log API requests for debugging but never log decrypted sensitive data

Webhook Alternative

Instead of polling for status updates, consider implementing webhooks for real-time notifications: Learn about Webhooks →

Next Steps