Create Paywall

post
Create Paywall

https://lnpay.co/v1/paywall
This endpoint allows you to create paywalls.
Request
Response
Request
Body Parameters
destination_url
required
string
The redirect destination URL
short_url
optional
string
The paywall url (e.g. paywall.link/to/short_url). A random 5 char string is generated if blank
memo
optional
string
Any memo for the invoice
num_satoshis
optional
number
price in satoshis. defaults to any amount
template_id
optional
string
template to attach if any. ID from Layouts section of dashboard. (e.g. tmpl_BUDfLYoRcviqV)
link_rule_exp_id
optional
string
See table below for values. defaults to pay every time
Response
200: OK
Paywall created
{
"id":"pywl_bI0OuKNxLtMHWs",
"created_at":1586448191,
"updated_at":1586448191,
"destination_url":"https://bigsun.xyz",
"memo":"This is my memo",
"short_url":"bigsun",
"paywall_link":"https://paywall.link/to/bigsun",
"template":null,
"num_satoshis":100,
"passThru":{
"extraAttributes":{
"unlock_threshold":0,
"identifier_in_memo":false,
"send_partial_preimage_redirect":false
}
},
"custyDomain":{
"domain_name":"paywall.link"
},
"statusType":{
"type":"link",
"name":"active",
"display_name":"Active"
},
"paywallType":{
"name":"basic",
"display_name":"Basic Paywall",
"description":"User must pay everytime the paywall is hit"
},
"linkExpRule":{
"type":"PAYMENT_EXPIRATION",
"name":"IMMEDIATE",
"display_name":"Pay every time",
"time_minutes":0
}
}
curl
curl
curl -u pak_O0iUMxk8kK_qUzkT4YKFvp1ZsUtp: \
-H "Content-Type: application/json" \
-X POST \
-d '{"destination_url":"https://bigsun.xyz","memo":"This is my memo","short_url":"bigsun","num_satoshis":100}' \
https://lnpay.co/v1/paywall

These rules control the short link functionality. They work by using a cookie to keep track of the user.

Example: if a user pays a paywall with 6_HR, whenever they click on the paywall link - they are redirected to the destination automatically until after 6 Hours from original purchase time. At that point they are presented with the paywall again.

link_exp_rule_id

Description

IMMEDIATE

Payer must pay every time (default)

NO_EXP

Payer has unlimited access

6_HR

Payer has access for 6 hours

1_D

Payer has access for 1_D

30_D

Payer has access for 30_D

90_D

Payer has access for 90_D

ONE_TIME_USE

Once the link is paid one time by anyone,

it is no longer valid for anyone