Skip to main content
POST
/
v3
/
ocpay
/
createLink
curl --request POST \
  --url https://api.oneclickdz.com/v3/ocpay/createLink \
  --header 'Content-Type: application/json' \
  --header 'X-Access-Token: YOUR_API_KEY' \
  --data '{
  "productInfo": {
    "title": "Premium Subscription",
    "description": "Monthly access to premium features",
    "amount": 5000
  },
  "feeMode": "NO_FEE",
  "successMessage": "Thank you for your purchase!",
  "redirectUrl": "https://yourstore.com/success?orderId=12345"
}'
{
  "success": true,
  "data": {
    "paymentLink": {
      "uid": "user_123456789",
      "ref": "OCPL-A1B2C3-D4E5",
      "isSandbox": false,
      "productInfo": {
        "title": "Premium Subscription",
        "description": "Monthly access to premium features",
        "amount": 5000
      },
      "feeMode": "NO_FEE",
      "successMessage": "Thank you for your purchase!",
      "redirectUrl": "https://yourstore.com/success?orderId=12345",
      "time": "2025-01-15T10:30:00Z"
    },
    "paymentUrl": "https://pay.ocdz.link/pay/OCPL-A1B2C3-D4E5",
    "paymentRef": "OCPL-A1B2C3-D4E5"
  },
  "meta": {
    "timestamp": "2025-01-15T10:30:00Z",
    "requestId": "req_abc123xyz"
  }
}

Overview

Create a secure, single-use payment link with customizable settings. Perfect for e-commerce orders, service payments, and subscription renewals.
Merchant Validation Required: Complete merchant validation at https://oneclickdz.com/#/OcPay/merchant-info before using this endpoint.

Request Body

productInfo
object
required
Product or service details being paid for
feeMode
string
default:"NO_FEE"
Determines who pays withdrawal fees - NO_FEE - Merchant pays all fees (default) - SPLIT_FEE - Fees split 50/50 - CUSTOMER_FEE - Customer pays all fees
successMessage
string
Custom success message (max 500 characters) shown after payment Example: "Thank you for your purchase! Your order is being processed."
redirectUrl
string
Redirect URL after successful payment (must be valid HTTP/HTTPS) Example: "https://yourstore.com/order-check?orderId=12345"

Response

success
boolean
Indicates if the operation was successful
data
object
Payment link details
meta
object
Response metadata

Key Features

Fee Flexibility

Choose who pays transaction fees - merchant, customer, or split

Custom Branding

Personalized success messages and redirect URLs

Sandbox Testing

Test integration safely before going live

Single-Use Security

Each link is single-use for enhanced security

Important Notes

Amount Limits: - Minimum: 500 DZD - Maximum: 500,000 DZD - Must be whole numbers (no decimals)
Fee Structure: - 0% if using OneClick balance - 1% withdrawal fee only (configurable per transaction)
Link Expiration: Payment links expire 20 minutes after creation if payment is not initiated
curl --request POST \
  --url https://api.oneclickdz.com/v3/ocpay/createLink \
  --header 'Content-Type: application/json' \
  --header 'X-Access-Token: YOUR_API_KEY' \
  --data '{
  "productInfo": {
    "title": "Premium Subscription",
    "description": "Monthly access to premium features",
    "amount": 5000
  },
  "feeMode": "NO_FEE",
  "successMessage": "Thank you for your purchase!",
  "redirectUrl": "https://yourstore.com/success?orderId=12345"
}'
{
  "success": true,
  "data": {
    "paymentLink": {
      "uid": "user_123456789",
      "ref": "OCPL-A1B2C3-D4E5",
      "isSandbox": false,
      "productInfo": {
        "title": "Premium Subscription",
        "description": "Monthly access to premium features",
        "amount": 5000
      },
      "feeMode": "NO_FEE",
      "successMessage": "Thank you for your purchase!",
      "redirectUrl": "https://yourstore.com/success?orderId=12345",
      "time": "2025-01-15T10:30:00Z"
    },
    "paymentUrl": "https://pay.ocdz.link/pay/OCPL-A1B2C3-D4E5",
    "paymentRef": "OCPL-A1B2C3-D4E5"
  },
  "meta": {
    "timestamp": "2025-01-15T10:30:00Z",
    "requestId": "req_abc123xyz"
  }
}

Next Steps