Skip to main content

Webhook request

The endpoint describes the request that you will receive in your webhook receiver and the responses the Lune webhook infrastructure expects.

Parameters
eventsarray of objectrequired

An array of WebhookEvent objects.

  • POST /WebhookRequest
  • curl 'https://api.lune.co/v1/WebhookRequest' \
      -H 'Authorization: Bearer <API_KEY>' \
      -H 'Content-Type: application/json' \
      -X POST \
      -d '{
        "events": [
          {
            "api_version": "v1",
            "event_id": "va1BER4JZqnzPkYxJgALg0GeQDoXlWO5",
            "event_type": "order.received",
            "sequence": "2021-09-13T16:21:29.067Z",
            "data": {
              "order": {
                "id": "va1BER4JZqnzPkYxJgALg0GeQDoXlWO5",
                "idempotency_key": "5bd808a954e",
                "type": "quantity",
                "status": "complete",
                "currency": "GBP",
                "offset_cost": "7176.00",
                "total_cost": "7696.00",
                "commission": "520.00",
                "quantity": "1040",
                "payment_method": "invoice",
                "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",
                "public_certificate_url": "https://sustainability.lune.co/account?certificate=1",
                "offset_link_id": "UwjfkXjfksoHXzA1qjANL58GhjwqkxpB",
                "email": "[email protected]",
                "requested_quantity": "1045",
                "requested_value": null,
                "estimate_id": null
              }
            }
          }
        ]
      }'