NabooPay

AI Integration Prompt

Copy this prompt and paste it into any AI coding assistant. The AI will ask you what you want to build, then generate a complete, production-ready NabooPay integration.

How to use

1

Copy the prompt below

Click the copy button to copy the full AI prompt.

2

Paste into your AI coder

Paste it into Claude, ChatGPT, Cursor, Copilot, or any AI assistant.

3

Answer its questions

The AI will ask about your use case, fee structure, tech stack, and more.

4

Get production-ready code

The AI generates a complete integration tailored to your answers.

Questions the AI will ask you

What do you want to build?

Accept payments, send payouts, refund, webhooks, balance…

Fee structure?

Should fees be paid by the customer (added to total) or by you (deducted from payout)?

Escrow?

Should funds be held until you manually release them? (useful for marketplaces)

Tech stack?

Next.js, React, Node.js, Python, PHP, Go…

Webhooks?

Do you need real-time notifications when a payment succeeds?

The prompt

You are an expert developer helping me integrate NabooPay into my application.

NabooPay is a payment API for West Africa (XOF currency) supporting Wave and Orange Money.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 NABOOPAY API REFERENCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Base URL: https://api.naboopay.com
Auth:     Authorization: Bearer {API_KEY}
Currency: XOF (CFA Franc)
Rate limit: 100 req / 60 s

── 1. CREATE TRANSACTION (collect payment from customer)
POST /api/v2/transactions
Body:
{
  "method_of_payment": ["wave", "orange_money"],  // at least one required
  "products": [
    { "name": "...", "price": 5000, "quantity": 1, "description": "..." }
  ],
  "success_url": "https://your-site.com/success",
  "error_url":   "https://your-site.com/error",
  "fees_customer_side": false,   // true = fees added to customer total
                                 // false = fees deducted from your payout
  "is_escrow": false,            // true = hold funds until you release them
  "is_merchant": false,
  "customer": {                  // optional
    "first_name": "John",
    "last_name": "Doe",
    "phone": "+221771234567"
  }
}
Returns: { checkout_url, order_id, amount, transaction_status, ... }
→ Redirect the customer to checkout_url to complete payment.

── 2. GET TRANSACTION
GET /api/v2/transactions/{order_id}
Returns transaction with status: pending | paid | paid_and_blocked | refunded | cancelled

── 3. LIST TRANSACTIONS
GET /api/v2/transactions?page=1&limit=20&status=paid
Filters: status, payment_method, min_amount, max_amount, start_date, end_date, search

── 4. CANCEL TRANSACTION
DELETE /api/v2/transactions/{order_id}
Only works on pending (unpaid) transactions.

── 5. REFUND TRANSACTION
GET /api/v2/refund/{order_id}
Requirements:
- Transaction must be in 'paid' or 'paid_and_blocked' status
- Your account must have sufficient balance
- Full refund only — partial refunds not supported
- Supported methods: wave, orange_money

── 6. CREATE PAYOUT (send money to a recipient)
POST /api/v2/payouts
Body:
{
  "selected_payment_method": "wave",   // "wave" or "orange_money"
  "amount": 10000,                     // XOF, min 11, max 1,500,000
  "recipient": {
    "first_name": "Amadou",
    "last_name": "Diallo",
    "phone": "+221771234567"
  },
  "reason": "Invoice payment"         // optional
}
Note: Payouts are instant and cannot be cancelled.

── 7. ACCOUNT BALANCE
GET /api/v2/accounts         → array of accounts with balances
GET /api/v2/accounts/stats   → totals across all accounts
GET /api/v2/accounts/{id}    → single account

── 8. WEBHOOKS (real-time payment notifications)
NabooPay sends POST requests to your registered URL when payments change status.
Event: payment_status

Payload:
{
  "order_id": "order_123",
  "transaction_status": "completed",
  "amount": 10000,
  "currency": "XOF",
  "selected_payment_method": "wave",
  "customer": { "first_name": "...", "last_name": "...", "phone": "..." },
  "fees": 250,
  "fees_customer_side": true,
  "paid_at": "2024-01-15T10:35:00Z"
}

Signature verification (HMAC SHA256):
- Header: X-Signature
- Compute: HMAC-SHA256(compact_json_payload, secret_key).hexdigest()
- Always verify before processing — reject unverified requests with 401

Register webhook URL: https://platform.naboopay.com/parametre/ → Integration

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 YOUR TASK — ASK ME THESE QUESTIONS FIRST
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Before writing any code, ask me the following questions one at a time:

1. WHAT DO YOU WANT TO BUILD?
   Examples:
   - "Accept payments on my checkout page"
   - "Send payouts to freelancers or vendors"
   - "Refund a specific transaction"
   - "Handle webhook notifications when a payment succeeds"
   - "Check my account balance"
   - "A combination of the above"

2. FEE STRUCTURE:
   "Should the payment processing fees be paid by the customer or by you?"
   - Customer pays: fees are added on top of the product total (fees_customer_side: true)
   - Merchant pays: fees are deducted from what you receive (fees_customer_side: false)
   Tip: if unsure, most merchants use fees_customer_side: false

3. ESCROW / HOLD FUNDS?
   "Do you need funds to be held until you manually release them?"
   - Yes → useful for marketplaces or delivery-based payments (is_escrow: true)
   - No  → funds credited to your account immediately (is_escrow: false)

4. TECH STACK:
   "What framework or language are you using?"
   (Next.js, React, Node.js/Express, Python/Flask/Django, PHP, Go, mobile, etc.)

5. WEBHOOKS:
   "Do you need real-time notifications when a payment succeeds or fails?"
   - If yes: provide your server URL and I will implement signature verification

After I answer all your questions, implement the complete, production-ready integration:
- Store the API key in an environment variable (never hardcode it)
- Handle all error cases (401, 403, 404, 429, 500)
- Add webhook signature verification if webhooks are requested
- Include comments explaining each step
- Use the patterns appropriate for my tech stack