Skip to main content

Welcome to OCPay

OneClick Payment (OCPay) enables you to accept secure online payments in Algeria with minimal integration effort. Create payment links, track transactions, and manage your funds - all through our simple API.

Quick Setup

Get started in minutes with our straightforward API

Secure Payments

Bank-grade security powered by SATIM

Real-time Tracking

Monitor payment status in real-time

Flexible Fees

Choose who pays transaction fees

What You’ll Build

By following this guide, you’ll implement a complete payment flow:
  1. Customer creates an order in your application
  2. Your system generates a payment link via OCPay API
  3. Customer completes payment on secure payment page
  4. Your system tracks payment status and fulfills the order

Prerequisites

1

OneClick Account

Create an account at oneclickdz.com
2

Merchant Validation

Complete merchant validation at OCPay Merchant Info
This step is required before you can create payment links
3

API Key

Get your API key from the dashboard (use Sandbox key for testing)
4

Technical Requirements

  • Backend server to handle API calls - Database to store order and payment references - Basic understanding of REST APIs

How It Works

  1. Customer places order → You save it as PENDING
  2. You call /v3/ocpay/createLink → Get paymentUrl and paymentRef
  3. Save paymentRef with your order (important!)
  4. Redirect customer to paymentUrl
  5. Customer pays → Returns to your site
  6. You check status with /v3/ocpay/checkPayment/:ref
  7. Update order and fulfill if CONFIRMED

Key Concepts

Unique identifier for each payment (format: OCPL-XXXXXX-YYYY). Save this with your order to check status later.
Check payment status when customer returns to your site or when your cron job runs every 20 minutes.

Fee Structure

Low Fees: 0% when keeping balance in OneClick, only 1% on withdrawal
You can choose who pays the withdrawal fee:
Fee ModeDescriptionUse Case
NO_FEEYou absorb all feesBest customer experience
SPLIT_FEE50/50 splitShared responsibility
CUSTOMER_FEECustomer pays all feesMaximize your profit

Integration Steps

Follow these guides in order:

Quick Start

const fetch = require("node-fetch");

// Create payment link
async function createPayment(orderId, amount, title) {
  const response = await fetch(
    "https://api.oneclickdz.com/v3/ocpay/createLink",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "X-Access-Token": process.env.ONECLICK_API_KEY,
      },
      body: JSON.stringify({
        productInfo: { title, amount },
        redirectUrl: `https://yoursite.com/orders/${orderId}`,
      }),
    }
  );

  const data = await response.json();

  // Save paymentRef with your order!
  await db.orders.update(orderId, {
    paymentRef: data.data.paymentRef,
  });

  return data.data.paymentUrl; // Redirect customer here
}

// Check payment status
async function checkPayment(paymentRef) {
  const response = await fetch(
    `https://api.oneclickdz.com/v3/ocpay/checkPayment/${paymentRef}`,
    { headers: { "X-Access-Token": process.env.ONECLICK_API_KEY } }
  );

  const data = await response.json();
  return data.data.status; // PENDING, CONFIRMED, or FAILED
}

Support & Resources

Next: Merchant Setup

Ready to start? Begin with merchant validation:

Start Integration

Complete merchant setup and validation