Developer

Buy button

One button on your site sends the visitor to a Lid payment page. They pay in digital dollars, you handle no keys and no transactions. The creator gets paid in the same transaction.

The return URL is for showing a thank-you page. Confirm the sale with the purchase.completed webhook or with GET /agent/sales.

Try it here

Paste the address of one of your products. The button below is the component from the package, not a picture of it.

Add a product and the button turns on.

We keep a free product on the test network for this demo. Your own products work the same once they are on the network you are targeting.

Plain HTML

HTML
<script src="https://devnet.lid.pro/checkout.js" async></script>

<button
  data-lid-base="https://devnet.lid.pro"
  data-lid-product="2yVaihnCRkiYPXcJ3GJi2kVQ3yL63nZca31xfxg4J2Nn"
  data-lid-return="https://example.com/gracias"
  data-lid-cancel="https://example.com/curso"
  data-lid-ref="AB12CD"
  data-lid-locale="en"
  data-lid-verb="buy"
  data-lid-theme="dark"
  data-lid-size="lg"
  data-lid-block
></button>

An element with no text of its own gets the default style and the label “Buy with Lid”. With data-lid-unstyled, the script touches neither text nor style.

React

React
import {
  PayWithLid,
  PAY_WITH_LID_CSS,
} from '@lidpro/pay/react';

<style>{PAY_WITH_LID_CSS}</style>
<PayWithLid
  baseUrl="https://devnet.lid.pro"
  productPda="2yVaihnCRkiYPXcJ3GJi2kVQ3yL63nZca31xfxg4J2Nn"
  returnUrl="https://example.com/gracias"
  cancelUrl="https://example.com/curso"
  affiliateCode="AB12CD"
  locale="en"
/>

React is an optional peer of the package. Include the exported CSS once in your app: the component does not inject it.

The URL the button opens

URL
https://devnet.lid.pro/en/checkout/2yVaihnCRkiYPXcJ3GJi2kVQ3yL63nZca31xfxg4J2Nn?return_url=https%3A%2F%2Fexample.com%2Fgracias&cancel_url=https%3A%2F%2Fexample.com%2Fcurso&ref=AB12CD

URL parameters

ParameterRequiredWhat it does
return_urlNoWhere the buyer's "Back to your site" link goes after a confirmed purchase. Without it, the buyer stays on Lid and opens the product in their library.
cancel_urlNoWhere the buyer goes if they leave without buying. Without it, return_url is used.
refNoAffiliate code. Their commission is paid in the same transaction.
themeNolight or dark. Forces the theme of the payment page so it matches your site.

Parameters Lid adds to your return URL

ParameterWhat it does
lid_statuscompleted after a purchase, claim or hold; cancelled if the buyer went back without paying.
lid_productThe product PDA the button carried.
lid_receiptReceipt PDA. On a product with a refund window, the hold PDA.
lid_signatureSolana transaction signature.

A product with a refund window returns with the hold address in lid_receipt. That sale does not send purchase.completed: confirm it with GET /agent/sales, where it appears with kind "hold" and a status that moves from held to released, refunded or disputed.

Confirm a completed purchase from your backend without polling: subscribe to the purchase.completed webhook. A hold (refund window) sends no webhook today; confirm it with GET /agent/sales. See the Webhooks page.