NACPOXYGEN Developer Platform

Empowering innovation in agricultural finance through cutting-edge APIs and developer tools.

Secure & Reliable
High Performance
Developer Platform
API DOCUMENTATION

Build with Our Powerful APIs

Comprehensive guides and references to integrate with our agricultural finance platform

Payments API

Process agricultural payments, escrow services, and bulk disbursements with our unified API.

  • Multi-channel payments
  • Smart contracts
  • Recurring billing
View Documentation
Finance API (Trust)

Manage farmer accounts, savings programs, and credit facilities programmatically.

  • Virtual accounts
  • Loan management
  • Risk assessment
View Documentation
Agri-Data API

Access market prices, weather data, and farm analytics to build smarter solutions.

  • Real-time market data
  • Yield predictions
  • Satellite imagery
View Documentation

98.9%

API Uptime

250ms

Average Response

24/7

Developer Support

QUICK START

Get Started in Minutes

Example implementations with our most popular APIs

Initialize Agricultural Payment
const nacpo = require('nacpo-sdk');

nacpo.configure({
  apiKey: 'your_live_or_test_key',
  environment: process.env.NODE_ENV || 'sandbox'
});

// Create payment for farm inputs
async function createFarmPayment() {
  try {
    const payment = await nacpo.payments.create({
      amount: 75000, // in kobo (NGN)
      farmerId: 'farmer_789XYZ',
      description: 'Purchase of fertilizer and seeds',
      metadata: {
        cropType: 'Maize',
        season: '2023 Planting Season',
        location: 'Kaduna, NG'
      },
      callbackUrl: 'https://yourfarmapp.com/webhook'
    });

    console.log('Payment initialized:', payment);
    return payment.authorizationUrl;
  } catch (error) {
    console.error('Payment error:', error.response?.data || error.message);
    throw error;
  }
}
Initialize Agricultural Payment
import nacpoxygen
from nacpoxygen.exceptions import ApiError

# Configure the SDK
nacpoxygen.api_key = "your_live_or_test_key"
nacpoxygen.environment = "sandbox"  # or "production"

def create_harvest_payment():
    try:
        payment = nacpoxygen.Payment.create(
            amount=150000,  # in kobo (NGN)
            farmer_id="farmer_789XYZ",
            description="Sale of harvested cassava",
            metadata={
                "crop_yield": "12.5 tons",
                "buyer_id": "agro-processor-456",
                "quality_rating": "Grade A"
            }
        )
        print(f"Payment created: {payment.id}")
        return payment.authorization_url
    except ApiError as e:
        print(f"Payment failed: {e}")
        raise
Initialize Agricultural Payment
curl -X POST https://api.nacpoxygen.com/v1/payments \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50000,
    "farmer_id": "farmer_123ABC",
    "description": "Purchase of hybrid seeds",
    "metadata": {
      "farm_size": "5 hectares",
      "crop_type": "Rice",
      "season": "2023 Wet Season"
    },
    "callback_url": "https://yourwebhook.com/payments"
  }'
Verify Farm Transaction
// Webhook handler for farm transactions
app.post('/webhook/farm-payments', async (req, res) => {
  const sig = req.headers['x-nacpo-signature'];
  const payload = req.body;
  
  try {
    // Verify the webhook signature
    const event = nacpo.webhooks.constructEvent(
      payload,
      sig,
      process.env.NACPO_WEBHOOK_SECRET
    );

    if (event.type === 'payment.success') {
      const payment = event.data;
      
      // Update farm records
      await updateFarmLedger(payment.farmerId, {
        amount: payment.amount / 100, // Convert to Naira
        transactionId: payment.id,
        purpose: payment.description,
        date: new Date(payment.createdAt)
      });
      
      // Trigger next actions (e.g., input delivery)
      if (payment.metadata.cropType) {
        await scheduleInputDelivery(payment);
      }
    }
    
    res.status(200).send('Webhook processed');
  } catch (err) {
    console.error('Webhook error:', err);
    res.status(400).send(`Webhook Error: ${err.message}`);
  }
});
Verify Farm Transaction
from flask import Flask, request, jsonify
import nacpoxygen

app = Flask(__name__)

@app.route('/webhook/farm-payments', methods=['POST'])
def handle_webhook():
    payload = request.get_data(as_text=True)
    sig_header = request.headers.get('X-Nacpo-Signature')
    
    try:
        event = nacpoxygen.Webhook.construct_event(
            payload,
            sig_header,
            os.getenv('NACPO_WEBHOOK_SECRET')
        )

        if event['type'] == 'payment.success':
            payment = event['data']
            
            # Update agri-records
            update_farm_transaction(
                farmer_id=payment['farmerId'],
                amount=payment['amount'] / 100,
                purpose=payment['description'],
                items=payment['metadata'].get('items', [])
            )
            
            # If harvest payment, trigger logistics
            if 'harvest_details' in payment['metadata']:
                schedule_produce_collection(payment)
        
        return jsonify(success=True), 200
        
    except Exception as e:
        print(f"Webhook error: {str(e)}")
        return jsonify(error=str(e)), 400
Verify Farm Transaction
# Verify a transaction status
curl -X GET \
  "https://api.nacpoxygen.com/v1/transactions/txn_123456789" \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json"

# Sample Response:
# {
#   "id": "txn_123456789",
#   "amount": 50000,
#   "status": "success",
#   "farmerId": "farmer_123ABC",
#   "description": "Purchase of hybrid seeds",
#   "metadata": {
#     "farm_size": "5 hectares",
#     "crop_type": "Rice"
#   },
#   "createdAt": "2023-06-15T09:30:45Z"
# }
SDKS & LIBRARIES

Official Client Libraries

Language-specific packages for seamless integration

Node.js SDK

Full support for JavaScript and TypeScript

npm install nacpo-sdk
Documentation
Python SDK

Compatible with Python 3.7+

pip install nacpoxygen
Documentation
PHP SDK

For PHP 7.4 and above

composer require nacpo/oxygen
Documentation
Java SDK

For Java 8 and Android

<dependency>
  <groupId>com.nacpo</groupId>
  <artifactId>oxygen</artifactId>
  <version>2.3.0</version>
</dependency>
Documentation
RESOURCES

Developer Resources

Everything you need to build agricultural finance solutions

GitHub Repositories

Explore our open-source SDKs, sample apps, and community projects.

Browse GitHub
API Reference

Detailed technical documentation for all endpoints and features.

View Reference
Developer Forum

Join discussions, ask questions, and share knowledge.

Join Community
Tutorials

Step-by-step guides for common agricultural finance scenarios.

Learn More

Ready to Transform Agricultural Finance?

Join thousands of developers building the next generation of agri-finance solutions with NACPOXYGEN's powerful platform.