Ninjapay API Docs
  • Namaste
    • ℹ️Welcome to Ninjapay!
    • 🏆Benefits of NinjapayAPI
    • 🛠️Fees & Limit
  • How to
    • ❓How Plugins Work
    • 👨‍💻Getting Started
    • 🔐Authentication
    • 💻API Reference (UPI)
      • 🧩Plugins
        • 🔗Realtime Payment Links
          • Create Realtime Payment Link
          • Create Template
          • List Payment Links
          • Multi super order Id list
          • Get templates
          • Single order Id trx list
          • Generate Upi payment link
          • Record payment
          • Expiry List
          • Delete Payment Link
          • Delete Template
          • Check Payment
        • 🛡️Paywalls
          • Create Paywall
          • Create Paywall QR
          • List Paywalls
          • Detail Paywall
          • Check Paywall
          • Remove Paywall
        • 📄Invoice
          • Add Client
          • Edit Client
          • Get Client
          • Remove Client
          • Add Product
          • Edit Product
          • Get Products
          • Remove Product
          • Upload Attachment
          • Add/Edit Template
          • Create Invoice
          • Get Invoice by ID
          • Add Tracking Details
          • Remove Invoice
        • 🖥️Point of Sale - POS
          • Create POS
          • Create Paywall QR
          • List Paywalls
          • Detail Paywall
          • Check Paywall
          • Remove POS
        • 👨‍💻Build Your Own Plugin
          • Ninjapay Plugin Development Guide
      • Error Handling
      • Limits on API Requests
    • 💻API Reference (P2P)
      • 🧩Plugins
        • 🔗Payment Links (P2P)
          • Dashboard Stats
          • Create Payment Link
          • Submit UTR for Approval
          • List Payment Links
          • Transactions
          • Approve/Decline
          • Check Payment
        • 🛡️Paywalls
          • Create Paywall
          • Create Paywall QR
          • List Paywalls
          • Detail Paywall
          • Check Paywall
          • Remove Paywall
        • 👨‍💻Build Your Own Plugin
          • Ninjapay Plugin Development Guide
      • Error Handling
      • Limits on API Requests
    • 💻API Reference (BTC⚡️)
      • Wallet Info
      • Send Payment
      • Request Payment
      • NinjaAuth
      • Ninjapay URI Intent
      • Check Payment
      • Transactions
      • Get Prices
      • Decode Invoice
      • Error Handling
      • Limits on API Requests
      • 🎁Withdraw Vouchers
        • Request Voucher
        • Check Voucher
        • Revoke Voucher Request
        • Redeem Voucher
      • 📈Spot Trade
        • Asset Balances
        • Asset Prices
        • Buy/Sell
        • Check Order
        • Revoke Order Request
  • other
    • 🤝Partnerships
    • 📓Helpful references
  • Use Cases
    • Game Developers
      • Implementing BTC Points
  • Coming Soon
    • 💻API Reference (Pro)
      • Wallet Info
      • Send Payment
      • Request Payment
      • NinjaAuth
      • Ninjapay URI Intent
      • Check Payment
      • Transactions
      • Get Prices
      • Decode Invoice
      • Error Handling
      • Limits on API Requests
    • 🧩Widget Integration
      • Widget (Onramp)
      • Widget (Offramp)
      • Request Token
      • Check Token
  • Fiat x Web3 Bridge
    • ℹ️Intro to NinjaUPI
    • 👩‍💻Get Started
      • Request Quote ID (BTC<>INR)
      • Request Quote ID (USDT<>INR)
      • Request Invoice for Quote
      • Check Payment
    • 🦸Upgrades
  • Protocols
    • Commerce Onchain Protocol
Powered by GitBook
On this page
  1. How to
  2. API Reference (P2P)
  3. Plugins
  4. Paywalls

Create Paywall

This endpoint is used to initiate a paywall transaction for fiat currency

Method


POST https://api.ninjapay.me/webextension/api/v1/fiat/paywall

Parameters

  • price: number - Price of the content.

  • title: string - Title of the content.

  • content: string - URL of the content.

  • content_type: string - Type of content, here it's a URL.

  • hide_url: boolean - Indicates if the URL should be hidden.

  • extra: object - Additional data, currently empty.

Request Body

Body (application/json)
{
    "price": 99.00,           // The price of the item, represented as a floating-point number.
    "title": "27 July Trailer",      // The title of the content or item, represented as a string.
    "content": "https://www.youtube.com/watch?v=gqiHUSZJJpg", // The URL or content link, represented as a string.
    "content_type": "URL",    // The type of content, represented as a string (e.g., "URL", "text", "image").
    "hide_url": false,        // A boolean flag indicating whether to hide the URL or not.
    "extra": {}              // An additional field for any extra data, represented as an object.
}

Response

{
    "status": true,
    "data": {},
    "message": "Paywall created successfully"
}

Code Example


const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'API_KEY' //Invoice key required
  },
  body: {
    "price": 99.00,           // The price of the item, represented as a floating-point number.
    "title": "27 July Trailer",      // The title of the content or item, represented as a string.
    "content": "https://www.youtube.com/watch?v=gqiHUSZJJpg", // The URL or content link, represented as a string.
    "contentType": "URL",    // The type of content, represented as a string (e.g., "URL", "text", "image").
    "hideUrl": false,        // A boolean flag indicating whether to hide the URL or not.
    "extra": {}              // An additional field for any extra data, represented as an object.
}
};

fetch('https://api.ninjapay.me/webextension/api/v1/fiat/paywall', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
  
PreviousPaywallsNextCreate Paywall QR

Last updated 10 months ago

💻
🧩
🛡️