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"
}'
const response = await fetch("https://api.oneclickdz.com/v3/ocpay/createLink", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY",
},
body: JSON.stringify({
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",
}),
});
const data = await response.json();
console.log("Payment URL:", data.data.paymentUrl);
console.log("Payment Ref:", data.data.paymentRef);
import requests
url = "https://api.oneclickdz.com/v3/ocpay/createLink"
headers = {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY"
}
payload = {
"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"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(f"Payment URL: {data['data']['paymentUrl']}")
print(f"Payment Ref: {data['data']['paymentRef']}")
<?php
$url = 'https://api.oneclickdz.com/v3/ocpay/createLink';
$headers = [
'Content-Type: application/json',
'X-Access-Token: YOUR_API_KEY'
];
$payload = [
'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'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
$data = json_decode($response, true);
echo "Payment URL: " . $data['data']['paymentUrl'] . "\n";
echo "Payment Ref: " . $data['data']['paymentRef'] . "\n";
?>
{
"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"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request data",
"details": [
{
"field": "productInfo.amount",
"message": "Amount must be between 500 and 500,000 DZD"
}
]
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"requestId": "req_abc123xyz"
}
}
{
"success": false,
"error": {
"code": "FORBIDDEN",
"message": "Complete merchant validation at https://app.oneclickdz.com/profile"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"requestId": "req_abc123xyz"
}
}
Navio
Create Payment Link
Creates a new single-use payment link for OneClick Payment (OCPay) system
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"
}'
const response = await fetch("https://api.oneclickdz.com/v3/ocpay/createLink", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY",
},
body: JSON.stringify({
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",
}),
});
const data = await response.json();
console.log("Payment URL:", data.data.paymentUrl);
console.log("Payment Ref:", data.data.paymentRef);
import requests
url = "https://api.oneclickdz.com/v3/ocpay/createLink"
headers = {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY"
}
payload = {
"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"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(f"Payment URL: {data['data']['paymentUrl']}")
print(f"Payment Ref: {data['data']['paymentRef']}")
<?php
$url = 'https://api.oneclickdz.com/v3/ocpay/createLink';
$headers = [
'Content-Type: application/json',
'X-Access-Token: YOUR_API_KEY'
];
$payload = [
'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'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
$data = json_decode($response, true);
echo "Payment URL: " . $data['data']['paymentUrl'] . "\n";
echo "Payment Ref: " . $data['data']['paymentRef'] . "\n";
?>
{
"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"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request data",
"details": [
{
"field": "productInfo.amount",
"message": "Amount must be between 500 and 500,000 DZD"
}
]
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"requestId": "req_abc123xyz"
}
}
{
"success": false,
"error": {
"code": "FORBIDDEN",
"message": "Complete merchant validation at https://app.oneclickdz.com/profile"
},
"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://app.oneclickdz.com/profile
before using this endpoint.
Request Body
Product or service details being paid for
Show productInfo properties
Show productInfo properties
Product/service name (1-200 characters) Examples: -
"Premium Subscription" - "Web Design Services" - "Online Course Access"Detailed description (max 1000 characters). Supports markdown.
Example:
"Monthly access to all premium features including unlimited storage and priority support"Determines who pays withdrawal fees -
NO_FEE - Merchant pays all fees
(default) - SPLIT_FEE - Fees split 50/50 - CUSTOMER_FEE - Customer pays
all feesCustom success message (max 500 characters) shown after payment Example:
"Thank you for your purchase! Your order is being processed."Redirect URL after successful payment (must be valid HTTP/HTTPS) Example:
"https://yourstore.com/order-check?orderId=12345"Response
Payment link details
Show data properties
Show data properties
Complete payment link information
Show paymentLink properties
Show paymentLink properties
Complete URL to share with customers for payment Example:
"https://pay.ocdz.link/pay/OCPL-A1B2C3-D4E5"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"
}'
const response = await fetch("https://api.oneclickdz.com/v3/ocpay/createLink", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY",
},
body: JSON.stringify({
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",
}),
});
const data = await response.json();
console.log("Payment URL:", data.data.paymentUrl);
console.log("Payment Ref:", data.data.paymentRef);
import requests
url = "https://api.oneclickdz.com/v3/ocpay/createLink"
headers = {
"Content-Type": "application/json",
"X-Access-Token": "YOUR_API_KEY"
}
payload = {
"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"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(f"Payment URL: {data['data']['paymentUrl']}")
print(f"Payment Ref: {data['data']['paymentRef']}")
<?php
$url = 'https://api.oneclickdz.com/v3/ocpay/createLink';
$headers = [
'Content-Type: application/json',
'X-Access-Token: YOUR_API_KEY'
];
$payload = [
'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'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
$data = json_decode($response, true);
echo "Payment URL: " . $data['data']['paymentUrl'] . "\n";
echo "Payment Ref: " . $data['data']['paymentRef'] . "\n";
?>
{
"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"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request data",
"details": [
{
"field": "productInfo.amount",
"message": "Amount must be between 500 and 500,000 DZD"
}
]
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"requestId": "req_abc123xyz"
}
}
{
"success": false,
"error": {
"code": "FORBIDDEN",
"message": "Complete merchant validation at https://app.oneclickdz.com/profile"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"requestId": "req_abc123xyz"
}
}
Next Steps
Check Payment Status
Learn how to check payment status
Integration Guide
Complete Navio integration guide

