LNPay Docs
Search…
Webhooks
Webhooks & Events
Webhooks can be setup in the LNPay.co dashboard.

Events

Event Name
Event Display Name
Note
wallet_created
Wallet Create
wallet_send
Wallet Send
wallet_receive
Wallet Receive
wallet_transfer
Wallet Transfer
Transfer between LNPay wallets
paywall_created
Paywall Created
paywall_conversion
Paywall Conversion
Paywall paid

Payloads

Every payload will follow the same format. an Event ID is provided to identify the event, along with an object of the type details. The data section will always contain an array of relevant objects to the event. The key of each object in the data object will match the object id: "wal":".." matches wal_czDztN5eJ4r5sJ for now this seems the easiest way to plan for future changes and additions.
Pay careful attention to passThru value. This is where context data that you have set previously, will be available throughout the journey of the wallet transaction.
NOTE: there are some server parameters that are passed through in this field as well, so it is a good idea to prefix your variables with something e.g. xyz_ticketId
Another way to send passThru data:
https://paywall.link/to/03ccb?utm_source=telegram&myUrlParameter=specialVar

Wallets

wallet_created
wallet_send
wallet_receive
wallet_transfer_IN/OUT
1
{
2
"created_at": 1582461859,
3
"id": "evt_XD6Gy21M8jRpplxI9YT3IpR9",
4
"event": {
5
"type": "wallet",
6
"name": "wallet_created",
7
"display_name": "Wallet Create"
8
},
9
"data": {
10
"wal": {
11
"user_label": "My Postman Collection Wallet",
12
"created_at": 1582461859,
13
"updated_at": 1582461859,
14
"id": "wal_czDztN5eJ4r5sJ",
15
"statusType": {
16
"type": "wallet",
17
"name": "active",
18
"display_name": "Active"
19
}
20
}
21
}
22
}
Copied!
1
{
2
"created_at": 1582462278,
3
"id": "evt_Ysjv7VYGtZttVkffUzm4jXf",
4
"event": {
5
"type": "wallet",
6
"name": "wallet_send",
7
"display_name": "Wallet Send"
8
},
9
"data": {
10
"wtx": {
11
"num_satoshis": -1,
12
"user_label": "Test for DOCS",
13
"created_at": 1582462278,
14
"id": "wtx_dYeWXmMTrP1VH8XZMOhXdE1",
15
"wal": {
16
"id": "wal_czDztN5eJ4r5sJ",
17
"created_at": 1582461859,
18
"updated_at": 1582462278,
19
"user_label": "My Postman Collection Wallet",
20
"balance": 19,
21
"statusType": {
22
"type": "wallet",
23
"name": "active",
24
"display_name": "Active"
25
}
26
},
27
"wtxType": {
28
"layer": "ln",
29
"name": "ln_withdrawal",
30
"display_name": "LN Withdrawal"
31
},
32
"lnTx": {
33
"id": "lntx_aB5lHY5ebFtei4SOByEQ8bnP",
34
"created_at": 1582462278,
35
"dest_pubkey": "02c16cca44562b590dd279c942200bdccfd4f990c3a69fad620c10ef2f8228eaff",
36
"payment_request": "lnbc10n1p09yafzpp5ens55wl8pfm6n2222pyyxjhx9rwcj4zl8pcyhsr2qzlklke4qfvsdq423jhxapqvehhygzyfap4xxqyz5vqcqzyssp52vyh6djmjt644fygwr54cs9vv82d2zc67tmkeun3c40ypzrvqe4srzjqt0pr36g7ke9elfvaqq3wmfey6laun0z8v0lg0nf9fdhdncxsp0y5zxkp5qqnsgqqqqqqqqqqqqq05qqrc9qy9qsqq3a4p9tvmy3sf7h2mlfpd5rcdldsyaksf8e0rk09yxtzvhcyzjrsg2janexechmzaqmnz9c7de04et7jkhmvkkjdnzn3txnz2a204ucplr595s",
37
"r_hash_decoded": "cce14a3be70a77a9a94a5048434ae628dd89545f38704bc06a00bf6fdb350259",
38
"memo": "Test for DOCS",
39
"description_hash": null,
40
"num_satoshis": 1,
41
"expiry": 86400,
42
"expires_at": 1582548678,
43
"payment_preimage": "6239646b2f326757664d37562b34383070347475665a4d65416c504f6f622b444933314c4e6246593554553d",
44
"settled": 1,
45
"settled_at": 1582462278,
46
"is_keysend": null,
47
"custom_records": null
48
},
49
"passThru": {
50
"method": "api"
51
}
52
}
53
}
54
}
Copied!
1
{
2
"created_at": 1582462225,
3
"id": "evt_rIZawRf4qbaPn8ie6yFdPlU",
4
"event": {
5
"type": "wallet",
6
"name": "wallet_receive",
7
"display_name": "Wallet Receive"
8
},
9
"data": {
10
"wtx": {
11
"num_satoshis": 20,
12
"user_label": "Test invoice from Postman Collection",
13
"created_at": 1582462225,
14
"id": "wtx_mJO06R6XzkZf2cf680gEOgQF",
15
"wal": {
16
"id": "wal_czDztN5eJ4r5sJ",
17
"created_at": 1582461859,
18
"updated_at": 1582462225,
19
"user_label": "My Postman Collection Wallet",
20
"balance": 20,
21
"statusType": {
22
"type": "wallet",
23
"name": "active",
24
"display_name": "Active"
25
}
26
},
27
"wtxType": {
28
"layer": "ln",
29
"name": "ln_deposit",
30
"display_name": "LN Deposit"
31
},
32
"lnTx": {
33
"id": "lntx_ztkK7XxfqCq3ihmhJiUhnR",
34
"created_at": 1582462172,
35
"dest_pubkey": "033868c219bdb51a33560d854d500fe7d3898a1ad9e05dd89d0007e11313588500",
36
"payment_request": "lnbc200n1p09yaxupp5r7ckx99n00d2a7g8xtr8wup57w82t827kkeujsdgjyn45cjmym7sdp623jhxapqd9h8vmmfvdjjqenjdakjq5r0wd6x6ctwyppk7mrvv43hg6t0dccqzpgxqyz5vqsp5gyfwnrqnkyvxxgpww0vwsl8tfe524ggr5kngr8n8fn4vt9xl5ggs9qy9qsq42vwx9dh2n3ggrlgwqqxqq77detywruhv2s558uk3vfrumgmjfhs3y8hwtgxe7cx6svg4pr87qzfg8mgawsveqe6wn0te9d3h02fm4spxtzy5s",
37
"r_hash_decoded": "1fb16314b37bdaaef90732c6777034f38ea59d5eb5b3c941a891275a625b26fd",
38
"memo": "Test invoice from Postman Collection",
39
"description_hash": null,
40
"num_satoshis": 20,
41
"expiry": 86400,
42
"expires_at": 1582548572,
43
"payment_preimage": "fbf2e3e943991d7d3202d061fb1dbe7afedffb4d4f29a204c624a5366e7c5706",
44
"settled": 1,
45
"settled_at": 1582462225,
46
"is_keysend": null,
47
"custom_records": null
48
},
49
"passThru": {
50
"myVariable":"special-id",
51
"ticketId":"23"
52
}
53
}
54
}
55
}
Copied!
1
# Same format for wallet_transfer_in and wallet_transfer_out
2
# Note: 2 separate webhooks / events are created for a Wallet Transfer request
3
# Note: the wtx['num_satoshis'] will be positive/negative depending on debit/credit
4
5
{
6
"id": "evt_NotT4h3TTgo8vmw9LlZdjp",
7
"created_at": 1582471973,
8
"event": {
9
"type": "wallet",
10
"name": "wallet_transfer_out",
11
"display_name": "Wallet Transfer OUT"
12
},
13
"data": {
14
"wtx": {
15
"num_satoshis": -1,
16
"user_label": "Test transfer from Postman Collection",
17
"created_at": 1582471973,
18
"id": "wtx_2LZhCsmKUIDgcaJQOsBF80g",
19
"wal": {
20
"id": "wal_czDztN5eJ4r5sJ",
21
"created_at": 1582461859,
22
"updated_at": 1582471973,
23
"user_label": "My Postman Collection Wallet",
24
"balance": 18,
25
"statusType": {
26
"type": "wallet",
27
"name": "active",
28
"display_name": "Active"
29
}
30
},
31
"wtxType": {
32
"layer": "ln",
33
"name": "ln_transfer_out",
34
"display_name": "Transfer Out"
35
},
36
"lnTx": null,
37
"passThru": {
38
"lnPayParams": null,
39
"source_wallet_id": "wal_czDztN5eJ4r5sJ",
40
"dest_wallet_id": "w_hkjS9r6mTYeABc"
41
}
42
}
43
}
44
}
Copied!

Paywalls

The paywall_conversion event will fire on successful payment of a paywall, the wallet_receive event will also fire - because the wallet received money.
paywall_created
paywall_conversion
1
{
2
"id": "evt_wFexxrj7HGFdlfrbvxs6wkN",
3
"created_at": 1582541374,
4
"event": {
5
"type": "paywall",
6
"name": "paywall_created",
7
"display_name": "Paywall Create"
8
},
9
"data": {
10
"pywl": {
11
"destination_url": "https://www.github.com",
12
"memo": "My First Tester Paywall",
13
"lnd_value": "69",
14
"short_url": "03ccb",
15
"lnd_expiry": 86400,
16
"created_at": 1582541374,
17
"updated_at": 1582541374,
18
"metadata": [],
19
"id": "pywl_nwmA5Nq6oD9IuK",
20
"paywall_link": "https://paywall.link/to/03ccb",
21
"custyDomain": {
22
"domain_name": "paywall.link"
23
},
24
"statusType": {
25
"type": "link",
26
"name": "active",
27
"display_name": "Active"
28
},
29
"paywallType": {
30
"name": "basic",
31
"display_name": "Basic Paywall",
32
"description": "User must pay everytime the paywall is hit"
33
},
34
"template": null
35
}
36
}
37
}
Copied!
1
{
2
"created_at": 1582638979,
3
"id": "evt_am119vTFxDZRbOHMy3mxBU5",
4
"event": {
5
"type": "paywall",
6
"name": "paywall_conversion",
7
"display_name": "Paywall Conversion"
8
},
9
"data": {
10
"pywl": {
11
"id": "pywl_nwmA5Nq6oD9IuK",
12
"created_at": 1582541374,
13
"updated_at": 1582541374,
14
"destination_url": "https://www.github.com",
15
"memo": "My First Tester Paywall",
16
"lnd_value": 69,
17
"lnd_expiry": 86400,
18
"short_url": "03ccb",
19
"metadata": {
20
"extraAttributes": {
21
"unlock_threshold": 0,
22
"identifier_in_memo": false,
23
"send_partial_preimage_redirect": false
24
}
25
},
26
"paywall_link": "https://paywall.link/to/03ccb",
27
"custyDomain": {
28
"domain_name": "paywall.link"
29
},
30
"statusType": {
31
"type": "link",
32
"name": "active",
33
"display_name": "Active"
34
},
35
"paywallType": {
36
"name": "basic",
37
"display_name": "Basic Paywall",
38
"description": "User must pay everytime the paywall is hit"
39
},
40
"template": null
41
},
42
"wtx": {
43
"num_satoshis": 69,
44
"user_label": "Paywall Payment: 03ccb",
45
"created_at": 1582638978,
46
"id": "wtx_es70fgXOn9CiJkVU4NG5TSB",
47
"wal": {
48
"id": "w_n743yizWqe43Oz",
49
"created_at": 1579001314,
50
"updated_at": 1582638978,
51
"user_label": "Paywall Wallet",
52
"balance": 625,
53
"statusType": {
54
"type": "wallet",
55
"name": "active",
56
"display_name": "Active"
57
}
58
},
59
"wtxType": {
60
"layer": "ln",
61
"name": "ln_deposit",
62
"display_name": "LN Deposit"
63
},
64
"lnTx": {
65
"id": "lntx_mjgB1kvanfkwxII7O2KDa8J",
66
"created_at": 1582638941,
67
"dest_pubkey": "033868c219bdb51a33560d854d500fe7d3898a1ad9e05dd89d0007e11313588500",
68
"payment_request": "lnbc690n1p092f6app508wdlqmphj94x0se8hzezndaqkk96q4hk0n5cfn62zzhyrmfky3qdp9f4ujq3nfwfehggz5v4ehgetjypgxz7thv9kxccqzpgxqyz5vqsp5yvezsgl6k9ftweec8a04w6szy5q95da64hhj7vhks2t0chkgapms9qy9qsqv4grtk7lhqlac877vpyzvhxncwfaelf7rsf9z4w8jutkwucsexm5nz8v3szf9cpf0khp9n7ssms2zy6njsmdslh2f4j3g4lnwtnyktqpd6w0fj",
69
"r_hash_decoded": "79dcdf8361bc8b533e193dc5914dbd05ac5d02b7b3e74c267a5085720f69b122",
70
"memo": "My First Tester Paywall",
71
"description_hash": null,
72
"num_satoshis": 69,
73
"expiry": 86400,
74
"expires_at": 1582725341,
75
"payment_preimage": "c647b4ea73c64caadfcd2adb313c15c9c508252b9cb43dbfb16481a4c59eb592",
76
"settled": 1,
77
"settled_at": 1582638978,
78
"is_keysend": null,
79
"custom_records": null,
80
"passThru": {
81
"userDefined": {
82
"id": "03ccb",
83
"utm_source": "telegram",
84
"myUrlParameter": "specialVar"
85
}
86
}
87
},
88
"passThru": {
89
"pywl_id": "pywl_nwmA5Nq6oD9IuK",
90
"userDefined": {
91
"id": "03ccb",
92
"utm_source": "telegram", //from https://paywall.link/to/03ccb?utm_source=telegram&myUrlParameter=specialVar
93
"myUrlParameter": "specialVar" //from https://paywall.link/to/03ccb?utm_source=telegram&myUrlParameter=specialVar
94
},
95
"secondary_type": 50
96
}
97
}
98
}
99
}
Copied!

Special Headers

Header
Sample Format
Description
X-LNPay-Event
wallet_send
an event from above
X-LNPay-HookId
iwhr_TBYsAgdgeOkhfA1cb5a33szZ
a unique ID for this webhook request
X-LNPay-Signature
aa46ae5d2d8367aef6693063e09...
hmac_sha256 signature of payload, if you provide a secret
User-Agent
LNPay-HookBot
standard user agent
Last modified 4mo ago