Lune Docs Logo

Carbon credits

You can offset CO₂e emissions for a shipment using one of three methods:
  1. By mass: Specify the amount of CO₂ you want to offset, in grams, kilograms, or tonnes.
  2. By value: Indicate the monetary amount you want to spend on purchasing carbon offsets.
  3. By estimate: Use the estimate ID from a previous emissions calculation to purchase carbon credits matching the estimated emissions.

Pre-requisites

Complete the following setup steps before using this guide:
/illustrations/stamp-key.png
Generate an API key and authenticate your account.
/illustrations/stamp-accounts.png
Set up Client Accounts to offset emissions for your individual customers.
/illustrations/stamp-carbon-projects.png
Review how to allocate project bundles for your customers.
If you want to preview the cost or breakdown of a purchase without making an actual order, use the /quote endpoints for mass or value. See the Mass Quote Reference and Value Quote Reference for more details.

1. Make the request

  • Remember to add the Authorization header with your generated Bearer Token, as well as a Lune Account header with the client account that this emission is being calculated for.
  • By mass
    To offset emissions based on mass, specify the total amount of CO₂ to offset in grams, kilograms, or tonnes. Use the orders/by-mass endpoint. Send a POST request to this endpoint to make the order.
    Sample request
  • CURL request for orders by mass
  • The example above purchases offsets for 259.11 kilograms of CO₂.For an advanced customisation of the bundles, add the percentage of the mass that should be distributed between the bundles, as shown below:
  • CURL request for orders by mass
  • Percentages must sum up to 100%.
    By value
    To offset emissions based on monetary value, specify the amount to spend on carbon credits in the request. Use the orders/by-value endpoint. Send a POST request to this endpoint to make the order.
    Sample request
  • CURL request for orders by value
  • The request above purchased $100 USD of carbon offsets.
    By estimate
    To purchase carbon credits using a previously calculated estimate, use the orders/by-estimate endpoint. Send a POST request to this endpoint to make the order.You'll need the estimate_id provided in the emissions calculation response. If you don’t have it saved, find it in the Lune Dashboard under the emissions calculation details.
    Sample request
  • CURL request for orders by estimate
  • 2. Interpret the results

    The response includes details about the order, such as:
    • Order ID: Unique identifier for the purchase.
    • Status: Current order status, which can be:
      • Received: Order has been received by Lune, but has not been processed.
      • Placed: Order has been placed.
      • Paid: Order has been paid.
      • Retiring: Order has credits partially allocated or retired.
      • Complete: Order has been fully retired. The order's certificate includes all retired credits.
      • Cancelled: Order has been cancelled by Lune.
      • Failed: Order failed to process.
    • Cost and currency: Cost breakdown of the order.
    • Bundles: Allocation details for project bundles.
    Sample response
  • Response for order request
  • Troubleshooting

    For further assistance, contact our support team.