Webhooks
Last updated
Last updated
Webhooks make integration with Loop easy by allowing you to subscribe to certain events that Loop emits. Loop will automatically create an account for you when deploying your contract so that you will be able to subscribe to webhook events. The shared secret for the account will be provided along with the contract address.
After your Loop account is set up, you will be able to subscribe to these events and configure an endpoint, which will receive a notification each time the event occurs.
If you'd like to receive webhooks, please send us an endpoint where we can POST data to. These are the webhook events currently available. See below for field details and example payloads.
Webhook retry logic
Loop has a standard retry cadence if a webhook is not successfully ingested. Loop will retry 3 times immediately and then start to back off over the next ~20 seconds. There are about 15 retries within this period. After that, if Loop still receives a failure message from your endpoint, retries are attempted every 20 seconds.
AgreementSignedUp
Fields:
event
string
The name of the event
transaction
string
Will always be blank since there is no onchain transaction
networkId
number
The ID of the network the event occurred on - 1, 5, 137, 80001 etc
networkName
string
The name of the network (e.g., Ethereum, Goerli, Polygon, etc.)
contractAddress
address
The address of the contract the event occurred in
email
string
The email address of the subscriber (if any)
company
string
Your company name
parent
string
The name of the parent company (if any)
subscriber
address
The wallet address that subscribed
item
string
The name of the item subscribed to
itemId
string
The ID of the item
agreementId
string
The ID of the agreement
agreementAmount
string
The amount for the subscription in USD
frequencyNumber
number
The frequency that the subscription repeats
frequencyUnit
string
The frequency unit - minutes, hours, days, weeks, years
addOnAgreements
string
A comma delimited string of additional agreement IDs
addOnItemIds
string
A comma delimited string of additional item IDs
addOnTotalAmount
string
The total amount for the add on items
paymentTokenSymbol
string
The symbol of the token used to pay for the subscription
eventDate
number
The date the event occurred - Unix time in seconds
refId
string
A custom reference ID that is stored and returned via "SignedUp" and "Cancelled" webhooks
metadata
string
JSON object as a string. Possible key value pairs:
Example Payload:
Fields:
event
string
The name of the event
transaction
string
Will always be blank since there is no onchain transaction
networkId
number
The ID of the network the event occurred on - 1, 5, 137, 80001 etc
networkName
string
The name of the network (e.g., Ethereum, Goerli, Polygon, etc.)
contractAddress
address
The address of the contract the event occurred in
email
string
The email address of the subscriber (if any)
company
string
Your company name
parent
string
The name of the parent company (if any)
entityId
string
The ID of the entity
agreementId
string
The agreement ID that was canceled
subscriber
string
The user's wallet address
agreementStartDate
number
The start date of the agreement - Unix time in seconds
eventDate
number
The date the subscription was canceled - Unix time in seconds
itemId
string
The ID of the item
itemName
string
The name of the item
refId
string
The reference ID passed in from checkout
cancellationEffectiveDate
number
The date the subscription will be cancelled. Unix time in seconds.
cancellationReason
string
Optional. Reason given for cancellation. May be system generated as well.
The cancellationReason field can have the following values:
“Cancelled by Stripe” - Loop received a cancellation notification from Stripe and then emitted the "ScheduledAgreementCancel" event. This will occur when a subscription is cancelled in Stripe.
“Canceled due to uncollectible payment” - If the product is canceled via Loop's auto-cancel feature.
Example Payload:
Fields:
event
string
The name of the event
transaction
string
Will always be blank since there is no onchain transaction
networkId
number
The ID of the network the event occurred on - 1, 5, 137, 80001 etc
networkName
string
The name of the network (e.g., Ethereum, Goerli, Polygon, etc.)
contractAddress
address
The address of the contract the event occurred in
email
string
The email address of the subscriber (if any)
company
string
Your company name
parent
string
The name of the parent company (if any)
entityId
string
The ID of the entity
agreementId
string
The agreement ID that was canceled
subscriber
string
The user's wallet address
agreementStartDate
number
The start date of the agreement - Unix time in seconds
eventDate
number
The date the subscription was canceled - Unix time in seconds
itemId
string
The ID of the item
itemName
string
The name of the item
refId
string
The reference ID passed in from checkout
cancellationReason
string
Optional. Reason given for cancellation. May be system generated as well.
Example Payload:
This webhook is sent whenever a transfer request is created. This includes, transfer requested autogenerated by Loop as well as drafts created by Stripe.
Field
Type
Description
event
string
The name of the event
transaction
string
Will always be blank since there is no onchain transaction
networkId
number
The ID of the network the event occurred on - 1, 5, 137, 80001 etc
networkName
string
The name of the network the event occurred on (e.g., Ethereum, Polygon, etc.)
contractAddress
address
The address of the contract the event occurred in
email
string
The email address of the subscriber (if any)
company
string
Your company name
parent
string
The name of the parent company (if any)
id
string
The ID of the transfer
invoiceId
string
The ID of the invoice
billDate
number
The due date of the payment - Unix time in seconds
toAddress
string
The wallet address the funds will go to
fromAddress
string
The wallet of the user
tokenSymbol
string
Symbol of the token, e.g: USDC
tokenAddress
string
The address of the payment token
paymentType
string
Either Transaction
or Fee
usd
boolean
Flag to indicate if the transfer is priced in USD or not
amount
string
The transfer amount
item
string
The name of the item
itemId
string
The ID of the item
source
string
The source of the transfer. Can be Manual
, Autogenerated
, Stripe
, Chargebee
, QuickBooks
or Xero
batchId
string
The batch id of the transfer
transferId
string
The internal ID of the transfer
refId
string
A custom reference ID that is stored and returned via "SignedUp" and "Cancelled" webhooks
agreementId
string
The ID of the agreement
Example Payload:
When a draft invoice is finalized in Stripe, we will send you a webhook. Unless you explicitly disable it, invoices you create in Stripe automatically finalize about 1 hour before the payment is due. Invoices you create with the Stripe API, however, won’t automatically finalize.
Field
Type
Description
event
string
The name of the event
transaction
string
Will always be blank since there is no onchain transaction
networkId
number
The ID of the network the event occurred on - 1, 5, 137, 80001 etc
networkName
string
The name of the network the event occurred on (e.g., Ethereum, Polygon, etc.)
contractAddress
address
The address of the contract the event occurred in
email
string
The email address of the subscriber (if any)
company
string
Your company name
parent
string
The name of the parent company (if any)
id
string
The ID of the transfer
invoiceId
string
The ID of the invoice
billDate
number
The due date of the payment - Unix time in seconds
toAddress
string
The wallet address the funds will go to
fromAddress
string
The wallet of the user
tokenSymbol
string
Symbol of the token, e.g: USDC
tokenAddress
string
The address of the payment token
paymentType
string
Either Transaction
or Fee
usd
boolean
Flag to indicate if the transfer is priced in USD or not
amount
string
The transfer amount
item
string
The name of the item
itemId
string
The ID of the item
source
string
The source of the transfer. Can be Manual
, Autogenerated
, Stripe
, Chargebee
, QuickBooks
or Xero
batchId
string
The batch id of the transfer
Field
Type
Description
event
string
The name of the event
transaction
string
Will always be blank since there is no onchain transaction
networkId
number
The ID of the network the event occurred on - 1, 5, 137, 80001 etc
networkName
string
The name of the network (e.g., Ethereum, Goerli, Polygon, etc.)
contractAddress
address
The address of the contract the event occurred in
email
string
The email address of the subscriber (if any)
company
string
Your company name
parent
string
The name of the parent company (if any)
transferId
string
The internal ID of the transfer
success
boolean
Indicates if the process was processed successfully
paymentTokenAddress
string
The address of the payment token
paymentTokenSymbol
string
The symbol of the token address (e.g., USDC)
endUser
string
The wallet of the user
reason
string
If the transfer failed, this field will explain why
invoiceId
string
The invoice ID
amountPaid
number
The amount paid in the transfer
agreementId
string
The Loop agreement ID associated with the transfer
refId
string
The reference number for the transfer
batchId
string
The batch ID of the transfer
usdAmount
string
US dollar amount of the transfer request
Example payload
Late payment notifications will be sent 10 minutes after the due date for the Transfer Request. If the Transfer Request is processed within that 10 minute window, no late payment notification will be sent.
Field
Type
Description
event
string
The name of the event
transaction
string
Will always be blank since there is no onchain transaction
networkId
number
The ID of the network the event occurred on - 1, 5, 137, 80001 etc
networkName
string
The name of the network the event occurred on (e.g., Ethereum, Polygon, etc.)
contractAddress
address
The address of the contract the event occurred in
email
string
The email address of the subscriber (if any)
company
string
Your company name
parent
string
The name of the parent company (if any)
subscriber
address
The wallet address that the payment relates to
dueDate
number
The date the transfer request is due - Unix time in seconds
amountDue
number
The amount that was due that hasn't been paid
lateReason
string
The reason the payment is late ("Insufficient balance" and/or "Insufficient allowance"
eventDate
number
The date the event occurred - Unix time in seconds
refId
string
The reference number for the transfer
agreementId
string
The Loop agreement ID associated with the transfer
transferId
string
The internal ID of the transfer
invoiceId
string
The invoice ID
Example payload