Skip to main content

Create an order by value

Parameters
valuestring^[0-9]+(\.[0-9]+)?$required

Maximum price of CO2 offsets to purchase (in the account's currency)


idempotency_keystring

Account-unique identifier provided by the client.

idempotency_key has two purposes:

  1. Clients can safely retry order requests without accidentally performing the same operation twice. The current state of the original order is returned.
  2. Clients can use idempotency_key to reconcile orders with other entities on their system.

bundle_selectionarray of object

Bundle selection percentages.

The sum of all percentages must equal 100.

If not specified, the preconfigured allocation ratios are going to be used.

If, for each selection, percentage is not provided, the selection is divided equally (best effort) between bundles. percentage must be provided for all or none of the bundles.


metadataobject

An arbitrary dictionary (key-value pairs) to store application-specific information.

Lune doesn't use this information for order processing. Its purpose is for the API clients to be able to attach arbitrary information (to an order for example) and then retrieve it.


quantity_truncenum

Unit, t for tonne, kg for kilogram, g for gram

Enum:
  • g
  • kg
  • t
Returns
idstringrequired

The order's unique identifier


idempotency_keystringrequired

Account-unique identifier provided by the client.

idempotency_key has two purposes:

  1. Clients can safely retry order requests without accidentally performing the same operation twice. The current state of the original order is returned.
  2. Clients can use idempotency_key to reconcile orders with other entities on their system.

typeenumrequired

Identifies whether the order has been placed by quantity (kg CO2) or value (monetary amount)

Enum:
  • quantity
  • value

statusenumrequired

Order status

Enum:
  • received
  • placed
  • paid
  • retiring
  • cancelled
  • complete
  • failed

currencystringrequired

Order currency code


offset_coststring^[0-9]+(\.[0-9]+)?$required

The net offset cost being purchased. May be lower than requested_value.

This property is set when bundles are assigned to the order. Unit: order currency


total_coststring^[0-9]+(\.[0-9]+)?$required

The total cost for the order inclusive of fees.

Unit: order currency


commissionstring^[0-9]+(\.[0-9]+)?$required

Lune's fee.

This property is set when bundles are assigned to the order. Unit: order currency


quantitystring^[0-9]+(\.[0-9]+)?$required

Quantity of CO2 offsets purchased in tonnes.


created_atstringdate-timerequired

Order creation timestamp


bundlesarray of objectrequired

bundles are set when the order's status is placed, paid, retiring or complete.

The bundles associated with the order including their relative quantity and cost breakdown.


projectsarray of objectrequired

Projects are set when the order's status is retiring or complete.

The projects associated with the order including their relative quantity and cost breakdown.

Orders are placed against bundles, not projects. Projects in a bundle may change based on supply.

This property is set as soon as we can guarantee project supply.


certificatestringrequired

Carbon credits certificate URL.

This property is set when an order has state 'complete'


metadataobject

An arbitrary dictionary (key-value pairs) to store application-specific information.

Lune doesn't use this information for order processing. Its purpose is for the API clients to be able to attach arbitrary information (to an order for example) and then retrieve it.


offset_link_idstringrequired

The offset link identifier, if the order was placed through an offset link


emailstringrequired

End-user email.

This property is currently populated on orders placed through offset links.


requested_valuestring^[0-9]+(\.[0-9]+)?$required

Requested value of CO2 offsets to purchase in the account's currency.


requested_quantitystring^[0-9]+(\.[0-9]+)?$required

Requested quantity of CO2 offsets to purchase in tonnes.


estimate_idstringrequired

The emission calculation unique identifier

  • POST /orders/by-value
  • curl 'https://api.lune.co/v1/orders/by-value' \
      -H 'Authorization: Bearer <API_KEY>' \
      -H 'Content-Type: application/json' \
      -X POST \
      -d '{
        "value": "7700.00"
      }'
      
  • Response
  • {
      "id": "va1BER4JZqnzPkYxJgALg0GeQDoXlWO5",
      "idempotency_key": "5bd808a954e",
      "type": "quantity",
      "status": "complete",
      "currency": "GBP",
      "offset_cost": "7176.00",
      "total_cost": "7696.00",
      "commission": "520.00",
      "quantity": "1040",
      "created_at": "created_at",
      "bundles": [
        {
          "bundle_id": "va1BEV2VZqnzPkYxJgALg0GeQDoXlWO5",
          "bundle_name": "Latin America Forestry",
          "quantity": "1040",
          "unit_price": "6.90",
          "gross_unit_price": "7.90",
          "offset_cost": "7176.00",
          "insufficient_available_quantity": true
        }
      ],
      "projects": [
        {
          "quantity": "600",
          "unit_price": "6.90",
          "offset_cost": "4140.00",
          "project_id": "gMbvJoOaX54V1wpNaRY8dWDGQ7m239Bx",
          "project_name": "Madre De Dios",
          "project_type": "Forest Conservation",
          "project_slug": "madre-de-dios"
        },
        {
          "quantity": "440",
          "unit_price": "6.90",
          "offset_cost": "3036.00",
          "project_id": "xe1BEV2VZqnzPkYxJgALg0GeQDoXlWO5",
          "project_name": "Alto Mayo",
          "project_type": "Forest Conservation",
          "project_slug": "alto-mayo"
        }
      ],
      "certificate": "https://api.lune.co/v1/orders/08QD7GPaBx5b6Y60ndAONXLvrZljRE2e/certificate",
      "offset_link_id": "UwjfkXjfksoHXzA1qjANL58GhjwqkxpB",
      "email": "[email protected]",
      "requested_value": "7700",
      "requested_quantity": "1045",
      "estimate_id": "90ng23MKvLqbkpMwMw7yMBD4wJQrV6O6"
    }