CNaughtCNaught
PricingSign In

Create Carbon Credits Order

Places an order for the specified amount of carbon credits (in kilograms), or for the specified total price (in USD cents). The order will remain in the placed state until it can be matched to available credits, after which the order will be fulfilled and moved to the fulfilled state. If specifying total price, we will determine the amount of carbon credits based on the unit price of the portfolio used for the order. Because the amount must be an integer number of kilograms, the final actual total price might be slightly different than the specified total price.

POST/orders

Authorizations#

Authorization

string

header

required

Bearer authentication header of the form Bearer <token>, where <token> is your CNaught API key.

Headers#

X-Subaccount-Id

string

If present, the new order will be associated with the subaccount with given id.

Idempotency-Key

string

If present, a unique identifier that allows you to retry a request multiple times while only performing the action once. See Idempotency for more info.

Body#

Order Parameters

metadata

string | null

Optional metadata that can be provided with the order. Not shown on the certificate, and is intended for API clients to attach arbitrary metadata that can be retrieved with the order.

description

string | null

Optional public description for the order that will be shown on the certificate

notification_config

NotificationConfig | null

Optional configuration for a callback url to invoke with updates when the status of an order changes.

portfolio_id

string | null

Optional ID of the portfolio to use for fulfilling the order. If not specified, the account's default portfolio will be used.

Response#

201

Order Details

Get List of Orders

Create Carbon Credits Order

curl --request POST \
  --url https://api.cnaught.com/v1/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "metadata": "example metadata",
  "description": "On behalf of Jane Smith",
  "amount_kg": 100.5,
  "notification_config": {
    "url": "https://www.example.com/callback"
  }
}'
{
  "id": "Gre28Fc35bt3",
  "order_number": "47726-53238-46633-33562-7433",
  "amount_kg": 100,
  "metadata": "Customer metadata",
  "price_usd_cents": 2350
}