old_Loopcrypto.xyz
  • Introduction
  • Supported networks and tokens
  • Loop + Frames
  • Learn
    • How Loop works
    • Core components
      • Collecting authorization
        • Enabling payment on multiple networks
        • Accepting ETH and MATIC
      • Sending payment requests
      • Checking a customer's balance & allowance
      • Receipts and reminders
      • Customer portal
    • Loop + your financial stack
      • Linking on-chain transactions with invoices in your ERP system
      • Connecting with accounting software
      • Crypto off-ramp
    • Case studies
  • Dashboard functionality
    • Subscriptions
      • Free trials, discounts and more
      • Auto-invoicing
      • Auto-cancelations
    • One-time payments
    • Scheduling outbound payments
      • Internal notes
    • Editing an upcoming payment
    • Payments for platforms
  • Integrations
    • Stripe + Loop
      • Getting setup
      • Stripe Connect setup
      • Subscriptions
        • Free trials
        • Upgrading a customer or editing a subscription's products
      • Invoicing
      • One-time payments
      • Coupon codes
      • Stripe Connect - Subscriptions
      • FAQs about Stripe integration
    • Chargebee + Loop
      • Getting setup
      • Subscriptions
      • One-time payments
      • Coupon codes
    • Quickbooks + Loop
      • Invoicing
    • Xero + Loop
      • Invoicing
    • Ghost.org + Loop
    • Zapier + Loop
    • Manually add integrations
  • Technical Docs
    • APIs
      • Entity
        • Adding child entities
        • Adding user to child entity
        • Get child entities
      • Items
        • Adding items
          • Item types
          • Categories
        • Retrieving an item
        • Updating an item
        • Deactivating an item
      • Agreements
      • Transfer requests
        • Signing transfer requests
        • Loop CLI
        • Canceling transfer requests
        • Transfer request status
        • Handling unfulfilled transfer requests
        • Validations
      • Webhooks
        • Checking webhook signatures
        • Demo App
        • Slack, Airtable, Discord, Telegram
    • Archeticture
      • Smart contract
        • Deploying your smart contract
          • Modifying smart contract properties
      • Collecting authorization
        • Checkout page
          • Additional functionality
          • Add "pay with crypto" button
        • Checkout widget
          • NPM package readme
        • Checkout parameter examples
      • Providing on-chain payment based access
        • Subscription gated communities
    • Loop SDK
      • Verify Webhook
      • Transfers
      • Error Handling
      • Generating API keys
    • Sample guide: Collect a subscription or one-time payment
    • Integrating the Loop Protocol into your dApp
      • Payroll applications
      • Loan platforms (credit cards, BNPL)
    • Security
      • API Authentication
      • Securing with signatures
      • API Trust assumptions
      • Audits
  • FAQs
  • Company Dashboard
  • Loop Portal
Powered by GitBook
On this page
  • Setup overview
  • Creating an API key to send to Loop
  • Managing webhooks for payment notification
  1. Integrations
  2. Stripe + Loop

Getting setup

Integration time: 2 minutes

PreviousStripe + LoopNextStripe Connect setup

Last updated 9 months ago

Before getting started please you'll need an account with Loop. Reach out to your contact at Loop to help with this.

If you have more than 100 products in Stripe, please let Loop know so we can ensure all your products are properly pulled into Loop.

Setup overview

  1. Create an API key and send it to your contact at Loop using foxcry.pt or another secure method.

Loop will then use the API key to create a webhook with Loop’s endpoint, which Loop will use to update Product, Price, and Invoice information. And that’s it!

Additionally, please let us know:

  • Where funds ought to be sent (Inbound treasury address) for each network (it can be the same address)

  • What email customers can use to get in touch with you (this is used as part of our automated emails)

Creating an API key to send to Loop

  • Go to the “developer” tab in the top right corner, click on API key, and create a new “restricted” key

Create a key with the following permissions (these should all be set in the "Permissions" column, not the "Connect Permissions" column):

  • Write permissions

    • Customers

    • Products

    • Invoices

    • Prices

    • Subscriptions

    • Webhook Endpoints

  • Read Permissions

    • Events

  • For production API keys, securely send Loop this key using foxcrypt (https://foxcry.pt/). Enter the key as the message, and foxcrypt will generate a one-time URL that Loop will use to view the key.

Note: Your restricted key should start with "rk_", not "pk_". "pk_" denotes a publishable key, which does not have permissions needed for this integration.

Note: Loop will then programmatically create a webhook to consume status updates from Stripe. No action is required in this step.

Some reference information about the webhook event types that Loop consumes:

  • product.updated, product.deleted, product.created

    • Product fields in Stripe that we use for part of our item

  • price.updated, price.deleted, price.created

    • Price fields in Stripe that we use for part of our item

  • invoice.created, invoice.finalized

    • Invoice flow for creating transfers

Managing webhooks for payment notification

One of the great features of Loop's integration with Stripe is that you can continue to use Stripe's webhooks for any automations you have. Since Loop updates the Customer and Invoice record automatically, Stripe webhooks continue to fire.

However, you should note, when a Loop payment occurs, a payment_intent.canceled event is emitted. This is because Stripe will want to charge the payment method on file (fiat). Thus, Loop cancels this event and instead updates the invoice to be "paid outside of Stripe." The invoice.paidevent will emit once the payment takes place on chain and Loop marks the invoice as paid.

If you're collecting payment in both fiat and crypto, we recommend you listen to both the payment.intent_succeeded and the invoice.paid events to ensure you are notified of a payment. Technically, you could only listen to the invoice.paid as this event fires whenever an invoice's payment status changes to Paid. For crypto payments, only the invoice.paid event in Stripe will be emitted.