Skip to main content
GET
/
transaction
/
verify
/
{reference}
Verify Payment
curl --request GET \
  --url https://api.payvessel.com/transaction/verify/{reference} \
  --header 'Content-Type: <content-type>' \
  --header 'api-key: <api-key>' \
  --header 'api-secret: <api-secret>'
{
  "status": "success",
  "message": "Transaction verification successful",
  "data": {
    "id": 123456789,
    "reference": "TXN_2024_001",
    "amount": 50000,
    "currency": "NGN",
    "status": "success",
    "gateway_response": "Successful",
    "paid_at": "2024-01-15T14:35:22Z",
    "created_at": "2024-01-15T14:30:00Z",
    "channel": "card",
    "fees": 750,
    "customer": {
      "id": 12345,
      "email": "customer@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "phone": "+2348012345678"
    },
    "authorization": {
      "authorization_code": "AUTH_xyz789abc",
      "bin": "408408",
      "last4": "4081",
      "exp_month": "12",
      "exp_year": "2027",
      "channel": "card",
      "card_type": "visa",
      "bank": "TEST BANK",
      "country_code": "NG",
      "brand": "visa",
      "reusable": true
    },
    "metadata": {
      "custom_fields": [
        {
          "display_name": "Order ID",
          "variable_name": "order_id",
          "value": "ORD_001"
        }
      ]
    },
    "log": {
      "start_time": 1705329000,
      "time_spent": 322,
      "attempts": 1,
      "errors": 0,
      "success": true,
      "mobile": false,
      "input": [],
      "history": [
        {
          "type": "action",
          "message": "Attempted to pay with card",
          "time": 15
        },
        {
          "type": "success",
          "message": "Successfully paid with card",
          "time": 322
        }
      ]
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.payvessel.com/llms.txt

Use this file to discover all available pages before exploring further.

Verify the status and details of a payment transaction using its unique reference. Call this endpoint after payment completion to confirm the transaction status.
Always verify payments! Never rely solely on frontend callbacks or webhook notifications. Always verify transaction status on your backend for security.
For checkout-specific flows, you may also call GET /pms/transactions/{reference}/confirm/ (documented as api-reference/checkout/confirm-transaction) to obtain the same transaction status plus enriched checkout session details.

Endpoint

GET /transaction/verify/{reference}

Path Parameters

reference
string
required
The unique transaction reference returned when the payment was initialized

Headers

NameTypeRequiredDescription
api-keystringRequiredYour API key
Content-TypestringRequiredMust be application/json

Example Request

curl -X GET https://api.payvessel.com/transaction/verify/TXN_2024_001 \
  -H "api-key: YOUR_API_KEY" \
  -H "api-secret: YOUR_SECRET" \
  -H "Content-Type: application/json"

Response

status
string
Request status indicator - "success" or "error"
message
string
Human-readable message describing the result
data
object
Transaction verification data

Example Response

{
  "status": "success",
  "message": "Transaction verification successful",
  "data": {
    "id": 123456789,
    "reference": "TXN_2024_001",
    "amount": 50000,
    "currency": "NGN",
    "status": "success",
    "gateway_response": "Successful",
    "paid_at": "2024-01-15T14:35:22Z",
    "created_at": "2024-01-15T14:30:00Z",
    "channel": "card",
    "fees": 750,
    "customer": {
      "id": 12345,
      "email": "customer@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "phone": "+2348012345678"
    },
    "authorization": {
      "authorization_code": "AUTH_xyz789abc",
      "bin": "408408",
      "last4": "4081",
      "exp_month": "12",
      "exp_year": "2027",
      "channel": "card",
      "card_type": "visa",
      "bank": "TEST BANK",
      "country_code": "NG",
      "brand": "visa",
      "reusable": true
    },
    "metadata": {
      "custom_fields": [
        {
          "display_name": "Order ID",
          "variable_name": "order_id",
          "value": "ORD_001"
        }
      ]
    },
    "log": {
      "start_time": 1705329000,
      "time_spent": 322,
      "attempts": 1,
      "errors": 0,
      "success": true,
      "mobile": false,
      "input": [],
      "history": [
        {
          "type": "action",
          "message": "Attempted to pay with card",
          "time": 15
        },
        {
          "type": "success",
          "message": "Successfully paid with card",
          "time": 322
        }
      ]
    }
  }
}

Transaction Status Guide

Understanding transaction statuses is crucial for proper payment handling:
Payment Completed SuccessfullyThe payment has been processed and funds have been collected. You can proceed with order fulfillment.
  • paid_at timestamp will be populated
  • authorization object will contain card details (for card payments)
  • Funds will be settled to your account based on your settlement schedule
Payment FailedThe payment attempt was unsuccessful. Common reasons include:
  • Insufficient funds
  • Invalid card details
  • Bank decline
  • Network timeout
  • paid_at will be null
  • authorization will be null
  • Check gateway_response for specific failure reason
Payment ProcessingThe payment is still being processed. This is common with:
  • Bank transfers
  • USSD payments
  • Some mobile money transactions
  • Keep checking status periodically
  • You’ll receive a webhook when status changes
Payment Started but Not CompletedCustomer initiated payment but didn’t complete it:
  • Closed browser before entering details
  • Session timeout
  • Customer changed mind
  • No funds were collected
  • Payment can potentially still be completed if session is still valid
Payment CancelledPayment was explicitly cancelled by customer or system:
  • Customer clicked cancel
  • Multiple failed attempts triggered cancellation
  • System timeout
  • Payment cannot be completed
  • Customer needs to initiate a new payment

Best Practices

Always Verify

Verify every transaction on your backend before order fulfillment, even after webhook notifications

Handle All Status

Implement logic for all possible transaction statuses in your application

Store Authorization

Save authorization codes for successful card payments to enable future recurring charges

Monitor Logs

Use transaction logs to debug payment issues and improve user experience

Common Integration Patterns

// After customer returns from payment
app.get('/payment/callback', async (req, res) => {
  const reference = req.query.reference;
  
  try {
    const verification = await payvessel.transaction.verify(reference);
    
    if (verification.data.status === 'success') {
      // Payment successful - fulfill order
      await fulfillOrder(verification.data);
      res.redirect('/order/success');
    } else {
      // Payment failed - show error
      res.redirect('/order/failed');
    }
  } catch (error) {
    // Handle verification error
    res.redirect('/order/error');
  }
});

Initialize Payment

Create a new payment transaction

List Transactions

Retrieve transaction history

Create Refund

Process refunds for successful transactions

Charge Authorization

Charge a saved authorization for recurring payments

Headers

api-key
string
required

Your Payvessel public API key

api-secret
string
required

Your Payvessel secret

Content-Type
enum<string>
required

Request content type

Available options:
application/json

Path Parameters

reference
string
required

The unique transaction reference returned when the payment was initialized

Response

Transaction verification successful

status
string

Request status indicator - 'success' or 'error'

message
string

Human-readable message describing the result

data
object