Webhooks
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:
Field | Type | Description |
---|---|---|
| string | The name of the event |
| string | Will always be blank since there is no onchain transaction |
| number | The ID of the network the event occurred on - 1, 5, 137, 80001 etc |
| string | The name of the network (e.g., Ethereum, Goerli, Polygon, etc.) |
| address | The address of the contract the event occurred in |
| string | The email address of the subscriber (if any) |
| string | Your company name |
| string | The name of the parent company (if any) |
| address | The wallet address that subscribed |
| string | The name of the item subscribed to |
| string | The ID of the item |
| string | The ID of the agreement |
| string | The amount for the subscription in USD |
| number | The frequency that the subscription repeats |
| string | The frequency unit - minutes, hours, days, weeks, years |
| string | A comma delimited string of additional agreement IDs |
| string | A comma delimited string of additional item IDs |
| string | The total amount for the add on items |
| string | The symbol of the token used to pay for the subscription |
| number | The date the event occurred - Unix time in seconds |
| string | A custom reference ID that is stored and returned via "SignedUp" and "Cancelled" webhooks |
| string | JSON object as a string. Possible key value pairs: |
Example Payload:
AgreementCancelled
Fields:
Field | Type | Description |
---|---|---|
| string | The name of the event |
| string | Will always be blank since there is no onchain transaction |
| number | The ID of the network the event occurred on - 1, 5, 137, 80001 etc |
| string | The name of the network (e.g., Ethereum, Goerli, Polygon, etc.) |
| address | The address of the contract the event occurred in |
| string | The email address of the subscriber (if any) |
| string | Your company name |
| string | The name of the parent company (if any) |
| string | The ID of the entity |
| string | The agreement ID that was canceled |
| string | The user's wallet address |
| number | The start date of the agreement - Unix time in seconds |
| number | The date the subscription was canceled - Unix time in seconds |
| string | The ID of the item |
| string | The name of the item |
| string | The reference ID passed in from checkout |
Example Payload:
TransferCreated
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 |
| string | The name of the event |
| string | Will always be blank since there is no onchain transaction |
| number | The ID of the network the event occurred on - 1, 5, 137, 80001 etc |
| string | The name of the network the event occurred on (e.g., Ethereum, Polygon, etc.) |
| address | The address of the contract the event occurred in |
| string | The email address of the subscriber (if any) |
| string | Your company name |
| string | The name of the parent company (if any) |
| string | The ID of the transfer |
| string | The ID of the invoice |
| number | The due date of the payment - Unix time in seconds |
| string | The wallet address the funds will go to |
| string | The wallet of the user |
| string | Symbol of the token, e.g: USDC |
| string | The address of the payment token |
| string | Either |
| boolean | Flag to indicate if the transfer is priced in USD or not |
| string | The transfer amount |
| string | The name of the item |
| string | The ID of the item |
| string | The source of the transfer. Can be |
| string | The batch id of the transfer |
| string | The internal ID of the transfer |
| string | A custom reference ID that is stored and returned via "SignedUp" and "Cancelled" webhooks |
| string | The ID of the agreement |
Example Payload:
TransferFinalized
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 |
| string | The name of the event |
| string | Will always be blank since there is no onchain transaction |
| number | The ID of the network the event occurred on - 1, 5, 137, 80001 etc |
| string | The name of the network the event occurred on (e.g., Ethereum, Polygon, etc.) |
| address | The address of the contract the event occurred in |
| string | The email address of the subscriber (if any) |
| string | Your company name |
| string | The name of the parent company (if any) |
| string | The ID of the transfer |
| string | The ID of the invoice |
| number | The due date of the payment - Unix time in seconds |
| string | The wallet address the funds will go to |
| string | The wallet of the user |
| string | Symbol of the token, e.g: USDC |
| string | The address of the payment token |
| string | Either |
| boolean | Flag to indicate if the transfer is priced in USD or not |
| string | The transfer amount |
| string | The name of the item |
| string | The ID of the item |
| string | The source of the transfer. Can be |
| string | The batch id of the transfer |
TransferProcessed
Field | Type | Description |
| string | The name of the event |
| string | Will always be blank since there is no onchain transaction |
| number | The ID of the network the event occurred on - 1, 5, 137, 80001 etc |
| string | The name of the network (e.g., Ethereum, Goerli, Polygon, etc.) |
| address | The address of the contract the event occurred in |
| string | The email address of the subscriber (if any) |
| string | Your company name |
| string | The name of the parent company (if any) |
| string | The internal ID of the transfer |
| boolean | Indicates if the process was processed successfully |
| string | The address of the payment token |
| string | The symbol of the token address (e.g., USDC) |
| string | The wallet of the user |
| string | If the transfer failed, this field will explain why |
| string | The invoice ID |
| number | The amount paid in the transfer |
| string | The Loop agreement ID associated with the transfer |
| string | The reference number for the transfer |
| string | The batch ID of the transfer |
| string | US dollar amount of the transfer request |
Example payload
Late payment
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 |
| string | The name of the event |
| string | Will always be blank since there is no onchain transaction |
| number | The ID of the network the event occurred on - 1, 5, 137, 80001 etc |
| string | The name of the network the event occurred on (e.g., Ethereum, Polygon, etc.) |
| address | The address of the contract the event occurred in |
| string | The email address of the subscriber (if any) |
| string | Your company name |
| string | The name of the parent company (if any) |
| address | The wallet address that the payment relates to |
| number | The date the transfer request is due - Unix time in seconds |
| number | The amount that was due that hasn't been paid |
| string | The reason the payment is late ("Insufficient balance" and/or "Insufficient allowance" |
| number | The date the event occurred - Unix time in seconds |
| string | The reference number for the transfer |
| string | The Loop agreement ID associated with the transfer |
| string | The internal ID of the transfer |
| string | The invoice ID |
Example payload
Last updated