POST
/
v1
/
orders
curl --request POST \
  --url https://carbon-engine.onrender.com/v1/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "portfolioId": "<string>",
  "amount_kg": 123,
  "description": "<string>",
  "customer": "<string>"
}'
[
  {
    "_id": "<string>",
    "orderNumber": "<string>",
    "customer": "<string>",
    "description": "<string>",
    "price_sar_halalas": 123,
    "amount_kg": 123,
    "creditsPurchased": 123,
    "callbackUrl": "<string>",
    "state": "<string>",
    "portfolio": "<string>",
    "certificateUrl": "<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>"
    }
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
amount_kg
number
required

The amount of credits to purchase, in kg of CO2. Must be a positive integer.

portfolioId
string

The portfolio ID

description
string

Description of the order

customer
string

Name of customer

Response

201
application/json
Order placed successfully
_id
string

The unique order id

orderNumber
string

The unique order number

customer
string

If purchased by customer

description
string | null

Description of the order

price_sar_halalas
number

Total price of the credits purchased in SAR halalas

amount_kg
number

Number of carbon credits requested, in kilograms

creditsPurchased
number

Number of carbon credits fulfilled, in kilograms

callbackUrl
string | null

Callback URL for order updates (if any)

state
string

Current status of the order, e.g., fulfilled, placed, or cancelled

portfolio
string

The portfolio ID related to the order

certificateUrl
string

URL to the order page with the certificate of the carbon credits

projectRecords
object[]

List of project records for this order

invoice
object