Store your API key securely, as it will only be displayed once. If needed, you can rotate your API key. The previous key will remain valid for 24 hours.
Once you have your API key, you can submit an order for carbon credits. Replace <C-MASS_API_KEY> with the API key you obtained in Step 1, and specify the amount of carbon credits (in kilograms of CO₂e) you want to purchase.
Copy
curl --request POST \ --url https://carbon-engine.onrender.com/v1/orders \ --header 'Authorization: Bearer <C-MASS_API_KEY>' \ --header 'Content-Type: application/json' \ --data '{ "amount_kg": 123, "description": "<string>", "customer": "<string>", "portfolioId": "<string>",}'You’ll receive a response like this:javascript{ { "_id": "1728559515925", "orderNumber": "<string>", "description": "<string>", "price_sar_halalas": 123, "amount_kg": 123, "kg_price": 123, "callbackUrl": "<string>", "certificateUrl": "<string>", "state": "<string>", "portfolio": "<string>", "projectRecords": [ { "project_id": "<string>", "project_category_id": "<string>", "credit_batch_id": "<string>", "delta": 123, "recorded_on": "2023-11-07T05:31:56Z" } ], "invoice": { "amountDueSarHalalas": 123, "balanceAppliedSarHalalas": 123, "receiptUrl": "<string>" } }}The _id (in this case 1728559515925) will allow you to retrieve your order.