Skip to main content
POST
Create Purchase
← Purchases API Create a new purchase record to track Scope 3 Category 1 (Purchased Goods and Services) emissions. The purchase can use either spend-based or supplier-specific calculation methods.

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa
string
required
Must be application/json

Body Parameters

string
required
Name of the product or service purchased (max 255 characters)Example: "Office Supplies"
string
required
Economic sector for emission factor lookup (max 255 characters)Example: "Manufacturing"
The purchase no longer accepts a purchase-level country. The country used for the spend-based emission calculation is taken from the purchase’s supplier (supplier_country when creating the supplier, stored on purchase_suppliers.country).
number
required
Purchase amount (must be >= 0). For spend-based, this is the monetary value.Example: 1500.00
A purchase needs one amount pair, not both: monetary (quantity + unit_id) or physical (non_currency_quantity + non_currency_unit_id). Sending half a pair, or neither, is rejected. Spend-based factors price the monetary pair.
uuid
Currency the monetary quantity is expressed in. This is a unit id — a UUID from the units catalog, not a currency code such as EUR.Retrieve it from GET /v2/units, which works with your API key. Currencies have no type filter, so request the full catalog and match on the ISO code in the name — searching for (eur) finds the euroExample: "d3e37f2b-0fc3-4532-82f8-3890ab56ad37" (euros)
number
Physical amount of the purchase, when you track quantity instead of spend. Must travel together with non_currency_unit_id.Example: 500
uuid
Unit of non_currency_quantity — a unit id from the catalog, not a symbol such as kg.Retrieve available options from GET /v2/units?type=non_currency_purchases, which works with your API key.Example: "61743a63-ff70-459c-9567-5eee8f7dfd5c" (kilogram)
string
required
Date of purchase in YYYY-MM-DD formatExample: "2024-03-15"
string
required
Expense classificationAvailable values: capex, opexExample: "opex"
string
Optional description of the purchase (max 500 characters)Example: "Q1 2024 office supplies order"
string
default:"spend_based"
Calculation method for emissions. Kept only for purchases priced with a custom_emission_factor_id; for any other purchase it is replaced by the method its emission factor impliesAvailable values: spend_based, supplier_specific, average_dataExample: "spend_based"
string
default:"active"
Initial status of the purchaseAvailable values: active, pending, in_progress, in_review, inactiveExample: "active"
number
Recycled content percentage (0 to 1). Reduces calculated emissions.Example: 0.25 (25% recycled content)
string
Optional supplier identifier for referenceExample: "supplier-123"
string
UUID of custom emission factor for supplier-specific calculationsDespite the name, this field holds the id of a custom emission group, not of an individual factor. Retrieve available options from GET /custom_emission_groups/lightExample: "770e8400-e29b-41d4-a716-446655440000"
string
default:"once"
Purchase frequencyAvailable values: onceExample: "once"
string
UUID of linked file/documentExample: "660e8400-e29b-41d4-a716-446655440000"
string
Name of linked file (max 255 characters)Example: "invoice_q1_2024.pdf"
string
URL of linked fileExample: "https://storage.dcycle.io/..."

Response

Returns the created purchase object with HTTP status 201 Created.
string
Unique identifier (UUID)
string
Organization UUID
string | null
Name of the product or service
string | null
Optional description
string | null
Economic sector
number | null
Purchase amount
uuid | null
Currency unit id of the monetary quantity
date | null
Date of purchase
string | null
Calculation method, set from the emission factor that prices the purchase: spend_based, supplier_specific or average_data
string
Classification: capex or opex
string | null
Purchase status
number | null
Recycled content percentage (0-1)
string | null
Supplier identifier
string | null
Custom emission factor UUID
string | null
Linked file UUID
string | null
Linked file name
string | null
Linked file download URL
number | null
Calculated CO2 equivalent emissions in kg (may be null while calculation is pending)
string | null
Purchase frequency
number | null
Exchange rate used to convert the purchase amount to EUR
date | null
Date used for the exchange rate lookup
object | null
Custom emission group applied to this purchase
datetime | null
Timestamp of the most recent purchase in a recurring series
object | null
Supplier details
object | null
Unit of measurement details
string | null
UUID of the user who created this record
object | null
User who created this record
datetime
Timestamp when the purchase was created
datetime | null
Timestamp when the purchase was last updated

Example

Successful Response

Status Code: 201 Created

Common Errors

400 Bad Request

Cause: Missing required fields or invalid data format
Solution: Ensure all required fields are provided: product_name, sector, quantity, unit_id, purchase_date, expense_type.

401 Unauthorized

Cause: Missing or invalid API key
Solution: Verify your API key is valid and active.

422 Validation Error

Cause: Invalid field values
Solution: Check that:
  • recycled is between 0 and 1
  • quantity is >= 0
  • expense_type is either capex or opex
  • purchase_type is one of spend_based, supplier_specific or average_data

Use Cases

Create Spend-Based Purchase

Track a purchase using monetary spend and sector emission factors:

Create Supplier-Specific Purchase

Track a purchase using a custom emission factor from your supplier:

Track Capital Goods (CAPEX)

Create a capital expenditure purchase (Scope 3 Category 2):

Bulk Create Purchases

Create multiple purchases efficiently:

List Purchases

Retrieve all purchases

Get Purchase

Get purchase details

Update Purchase

Modify purchase details

Custom Emission Factors

Create supplier-specific factors