Skip to main content

Get All Settings

Retrieve all platform settings grouped by category.

Example Request

curl -X GET "https://olp-api.nipuntheekshana.com/v1/admin/settings" \
  -H "Authorization: Bearer <admin_token>"

Example Response (200)

{
  "general": {
    "platformName": "Open Pay",
    "supportEmail": "support@openpay.com",
    "maintenanceMode": false
  },
  "payments": {
    "minimumPaymentAmount": "1.00",
    "maximumPaymentAmount": "50000.00",
    "platformFeePercent": "1.5",
    "supportedNetworks": ["BSC", "Ethereum", "Polygon"],
    "supportedTokens": ["USDT", "USDC", "BUSD"]
  },
  "security": {
    "maxLoginAttempts": 5,
    "sessionTimeoutMinutes": 30,
    "requireTwoFactor": false,
    "ipWhitelistEnabled": false
  },
  "notifications": {
    "emailNotificationsEnabled": true,
    "webhookRetryAttempts": 3,
    "webhookTimeoutSeconds": 30
  }
}

Get Settings by Category

category
string
required
The settings category. One of general, payments, security, notifications.

Example Request

curl -X GET "https://olp-api.nipuntheekshana.com/v1/admin/settings/payments" \
  -H "Authorization: Bearer <admin_token>"

Example Response (200)

{
  "minimumPaymentAmount": "1.00",
  "maximumPaymentAmount": "50000.00",
  "platformFeePercent": "1.5",
  "supportedNetworks": ["BSC", "Ethereum", "Polygon"],
  "supportedTokens": ["USDT", "USDC", "BUSD"]
}

Update Settings

Update one or more platform settings. Only the fields provided will be updated.
general
object
General platform settings.
general.platformName
string
The display name of the platform.
general.supportEmail
string
Platform support email address.
general.maintenanceMode
boolean
Enable or disable maintenance mode.
payments
object
Payment-related settings.
payments.minimumPaymentAmount
string
Minimum accepted payment amount.
payments.maximumPaymentAmount
string
Maximum accepted payment amount.
payments.platformFeePercent
string
Platform fee as a percentage.
security
object
Security-related settings.
security.maxLoginAttempts
integer
Maximum failed login attempts before lockout.
security.sessionTimeoutMinutes
integer
Session timeout in minutes.
notifications
object
Notification-related settings.
notifications.emailNotificationsEnabled
boolean
Enable or disable email notifications.
notifications.webhookRetryAttempts
integer
Number of retry attempts for failed webhooks.

Example Request

curl -X PUT "https://olp-api.nipuntheekshana.com/v1/admin/settings" \
  -H "Authorization: Bearer <admin_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "payments": {
      "platformFeePercent": "2.0",
      "minimumPaymentAmount": "5.00"
    },
    "security": {
      "maxLoginAttempts": 3
    }
  }'

Example Response (200)

{
  "message": "Settings updated successfully",
  "updated": ["payments.platformFeePercent", "payments.minimumPaymentAmount", "security.maxLoginAttempts"]
}

Email Templates

List Email Templates

Retrieve all configured email templates.
curl -X GET "https://olp-api.nipuntheekshana.com/v1/admin/email-templates" \
  -H "Authorization: Bearer <admin_token>"

Example Response (200)

{
  "data": [
    {
      "id": "tmpl_001",
      "name": "merchant_welcome",
      "subject": "Welcome to Open Pay",
      "body": "<html>...<p>Welcome, {{merchantName}}!</p>...</html>",
      "variables": ["merchantName", "loginUrl"],
      "isActive": true,
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-03-20T10:00:00Z"
    },
    {
      "id": "tmpl_002",
      "name": "withdrawal_approved",
      "subject": "Withdrawal Approved",
      "body": "<html>...<p>Your withdrawal of {{amount}} has been approved.</p>...</html>",
      "variables": ["amount", "currency", "merchantName"],
      "isActive": true,
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-03-15T08:00:00Z"
    }
  ]
}

Create Email Template

name
string
required
Unique template identifier name (e.g., payment_confirmation).
subject
string
required
Email subject line. Supports {{variable}} placeholders.
body
string
required
HTML email body. Supports {{variable}} placeholders.
variables
string[]
List of variable names used in the template.
isActive
boolean
default:"true"
Whether the template is active.
curl -X POST "https://olp-api.nipuntheekshana.com/v1/admin/email-templates" \
  -H "Authorization: Bearer <admin_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "kyc_rejected",
    "subject": "KYC Application Update",
    "body": "<html><body><p>Dear {{merchantName}}, your KYC application has been reviewed. Reason: {{reason}}</p></body></html>",
    "variables": ["merchantName", "reason"],
    "isActive": true
  }'

Example Response (201)

{
  "id": "tmpl_003",
  "name": "kyc_rejected",
  "subject": "KYC Application Update",
  "body": "<html><body><p>Dear {{merchantName}}, your KYC application has been reviewed. Reason: {{reason}}</p></body></html>",
  "variables": ["merchantName", "reason"],
  "isActive": true,
  "createdAt": "2026-03-26T10:00:00Z",
  "updatedAt": "2026-03-26T10:00:00Z"
}

Update Email Template

id
string
required
The unique email template identifier.
subject
string
Updated email subject line.
body
string
Updated HTML email body.
variables
string[]
Updated list of variable names.
isActive
boolean
Enable or disable the template.
curl -X PUT "https://olp-api.nipuntheekshana.com/v1/admin/email-templates/tmpl_003" \
  -H "Authorization: Bearer <admin_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "KYC Application - Action Required",
    "isActive": true
  }'

Example Response (200)

{
  "id": "tmpl_003",
  "name": "kyc_rejected",
  "subject": "KYC Application - Action Required",
  "body": "<html><body><p>Dear {{merchantName}}, your KYC application has been reviewed. Reason: {{reason}}</p></body></html>",
  "variables": ["merchantName", "reason"],
  "isActive": true,
  "createdAt": "2026-03-26T10:00:00Z",
  "updatedAt": "2026-03-26T11:30:00Z"
}

Retrieve all legal documents including drafts.
curl -X GET "https://olp-api.nipuntheekshana.com/v1/admin/legal-documents" \
  -H "Authorization: Bearer <admin_token>"

Example Response (200)

{
  "data": [
    {
      "id": "legal_001",
      "type": "terms_of_service",
      "title": "Terms of Service",
      "content": "## Terms of Service\n\nLast updated: March 2026...",
      "version": "2.1",
      "isActive": true,
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-03-01T00:00:00Z"
    },
    {
      "id": "legal_002",
      "type": "privacy_policy",
      "title": "Privacy Policy",
      "content": "## Privacy Policy\n\nLast updated: March 2026...",
      "version": "1.3",
      "isActive": true,
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-03-10T00:00:00Z"
    }
  ]
}
type
string
required
Document type. One of terms_of_service, privacy_policy, aml_policy, refund_policy.
title
string
required
Document title.
content
string
required
Document content in Markdown format.
version
string
required
Version string (e.g., 1.0, 2.1).
isActive
boolean
default:"false"
Whether to immediately publish this document. Setting to true deactivates the previous active version of the same type.
curl -X POST "https://olp-api.nipuntheekshana.com/v1/admin/legal-documents" \
  -H "Authorization: Bearer <admin_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "refund_policy",
    "title": "Refund Policy",
    "content": "## Refund Policy\n\nAll refunds are processed within 7 business days...",
    "version": "1.0",
    "isActive": true
  }'

Example Response (201)

{
  "id": "legal_003",
  "type": "refund_policy",
  "title": "Refund Policy",
  "content": "## Refund Policy\n\nAll refunds are processed within 7 business days...",
  "version": "1.0",
  "isActive": true,
  "createdAt": "2026-03-26T10:00:00Z",
  "updatedAt": "2026-03-26T10:00:00Z"
}
id
string
required
The unique legal document identifier.
title
string
Updated document title.
content
string
Updated document content.
version
string
Updated version string.
isActive
boolean
Activate or deactivate the document.
curl -X PUT "https://olp-api.nipuntheekshana.com/v1/admin/legal-documents/legal_003" \
  -H "Authorization: Bearer <admin_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "## Refund Policy\n\nUpdated: All refunds are processed within 5 business days...",
    "version": "1.1"
  }'

Example Response (200)

{
  "id": "legal_003",
  "type": "refund_policy",
  "title": "Refund Policy",
  "content": "## Refund Policy\n\nUpdated: All refunds are processed within 5 business days...",
  "version": "1.1",
  "isActive": true,
  "createdAt": "2026-03-26T10:00:00Z",
  "updatedAt": "2026-03-26T12:00:00Z"
}

Retrieve all currently active legal documents. This endpoint is public and does not require authentication.
curl -X GET "https://olp-api.nipuntheekshana.com/v1/legal-documents/active"

Example Response (200)

{
  "data": [
    {
      "id": "legal_001",
      "type": "terms_of_service",
      "title": "Terms of Service",
      "content": "## Terms of Service\n\nLast updated: March 2026...",
      "version": "2.1",
      "updatedAt": "2026-03-01T00:00:00Z"
    },
    {
      "id": "legal_002",
      "type": "privacy_policy",
      "title": "Privacy Policy",
      "content": "## Privacy Policy\n\nLast updated: March 2026...",
      "version": "1.3",
      "updatedAt": "2026-03-10T00:00:00Z"
    }
  ]
}