Lune Docs Logo
Log inContact us

Lune Pay

Lune Pay is a hosted payment page that enables you to collect payments for carbon credits without acting as an intermediary. Simply embed the Lune Pay URL in your offerings, and Lune handles the rest!With Lune Pay, you can:
  • Offer carbon offsetting as a service to your customers.
  • Stay out of the flow of funds.
  • Embed seamlessly with a single URL.
View a sample Lune Pay page.

Pre-requisites

Complete the following setup steps before using this guide:
/illustrations/stamp-accounts.png
Set up Client Accounts to offset emissions for your individual customers.
/illustrations/stamp-carbon-projects.png
Review carbon credit orders and how to allocate project bundles.

1. Generate and embed an Lune Pay URL

Lune Pay URLs follow the following format: https://pay.lune.co/{CLIENT_ACCOUNT_ID} where {CLIENT_ACCOUNT_ID} is the unique identifier for the client that is making the payment.
  • You can test the entire Lune Pay flow, including payment outcomes, without real money movement. Use a client account ID from a test account, which you can create in your Lune dashboard.
  • Once the payment is completed, the Client Account is credited, and the carbon credit purchase is finalised.Lune Pay supports several optional query parameters for customisation:
    quantity
    Prefill the amount of CO₂ (in tCO₂) to offset.
    redirect_url
    The URL to redirect the user after payment completion.
    redirect_label
    A custom label for the 'Back to {redirect_label}' button.
    external_id
    An ID generated by you to enable reconciliation. This ID will be returned as a query parameter when users are redirected back to your application.
    bundle_id
    The ID(s) of specific project bundles to display for selection. If omitted, the account’s default bundle is used. Multiple bundle ID values are supported. Explore the project bundles in the Lune dashboard.
    Example URL
    The following URL directs the user to a payment page for 100 tonnes CO₂e and displays several project bundles on the page that the user can select.
  • Example URL
  • 2. Handle redirects

    After completing a payment, the user sees a confirmation page with a "Back to {redirect_label}" button. Clicking this button redirects the user to the redirect_url you provided in the embed link. The redirect_label is also provided in the embed link.Lune automatically appends two query parameters to the redirect_url for transaction reconciliation:
    external_id
    The ID you generated for the customer and added as a query parameter in the embedded URL.
    temporary_id
    A unique, temporary identifier for the payment. This ID is valid for 15 minutes and allows payment details to be retrieved without authentication using the “Get payment by temporary ID” endpoint.
    Example redirect URL
    The following URL will redirect back to your app, with your external ID and a temporary ID for the payment.https://yourapp.com/confirmation?external_id=12345&temporary_id=abcdeThe temporary ID can be used in the Get payment by temporary ID endpoint to retrieve details for 15 minutes after payment processing. See a sample request below:
  • Redirect URL