Purchases API
The Purchases API allows you to create, retrieve, update, and delete purchase records for tracking Scope 3 Category 1 (Purchased Goods and Services) emissions. Purchases can be tracked using spend-based or supplier-specific methodologies for accurate CO2e calculations.GHG Protocol Scope 3 Category 1Purchased Goods and Services covers emissions from the production of goods and services purchased by your organization. This API helps you collect and manage the data needed for accurate Category 1 reporting using either spend-based or supplier-specific emission factors.
Key Features
- Purchase Management: Create and manage purchase records with supplier and product information
- Spend-Based Tracking: Calculate emissions based on monetary spend and sector-specific emission factors
- Supplier-Specific Factors: Use custom emission factors for more accurate calculations
- CAPEX/OPEX Classification: Distinguish between capital and operational expenditures
- File Attachments: Link purchases to uploaded documents (invoices, receipts)
- Pagination Support: Efficiently retrieve large purchase lists
- Filtering: Filter purchases by status, type, expense type, and file
Authentication
All endpoints require authentication using either:- API Key: Include in
x-api-keyheader - JWT Token: Include in
Authorizationheader asBearer {JWT_TOKEN}
Headers
All requests must include:Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faYour API key for authenticationExample:
sk_live_1234567890abcdefAvailable Endpoints
List Purchases
Retrieve all purchases with filtering and pagination
Get Purchase
Get a specific purchase by ID
Create Purchase
Add a new purchase to your organization
Update Purchase
Modify purchase details
Delete Purchase
Remove a purchase from your organization
Data Model
Purchase Object
The purchase object contains detailed information about a purchased good or service:Purchase Attributes
| Field | Type | Description |
|---|---|---|
id | UUID | Unique identifier for the purchase |
organization_id | UUID | Organization the purchase belongs to |
product_name | string | Name of the product or service (max 255 chars) |
description | string | Optional description (max 500 chars) |
sector | string | Economic sector for emission factor lookup |
country | string | 2-letter ISO country code |
quantity | float | Purchase amount (monetary or physical units) |
unit_id | string | Unit of measurement (e.g., EUR, USD, kg) |
purchase_date | date | Date of purchase (YYYY-MM-DD) |
purchase_type | string | Calculation method: spend_based or supplier_specific |
expense_type | string | Classification: capex or opex |
status | string | Purchase status (see Status Types) |
recycled | float | Recycled content percentage (0-1) |
supplier_id | string | Optional supplier identifier |
custom_emission_factor_id | UUID | Custom emission factor for supplier-specific |
file_id | UUID | Linked file/document ID |
file_name | string | Name of linked file |
file_url | string | URL to download linked file |
co2e | float | Calculated CO2 equivalent emissions (kg) |
frequency | string | Purchase frequency: once |
created_at | datetime | When the purchase was created |
updated_at | datetime | When the purchase was last updated |
Purchase Types
| Type | Description | Emission Factor Source |
|---|---|---|
spend_based | Calculate emissions based on monetary spend | Sector-specific factors from emission databases |
supplier_specific | Use supplier-provided emission factors | Custom emission factor linked via custom_emission_factor_id |
Spend-Based vs Supplier-Specific
- Spend-based is easier to implement but less accurate. It uses average emission factors for economic sectors.
- Supplier-specific requires more data but provides more accurate results by using actual emission factors from your suppliers.
Expense Types
| Type | Description | GHG Protocol Category |
|---|---|---|
capex | Capital Expenditure | Scope 3 Category 2 (Capital Goods) |
opex | Operational Expenditure | Scope 3 Category 1 (Purchased Goods & Services) |
Status Types
| Status | Description |
|---|---|
active | Purchase is active and included in calculations |
pending | Purchase is pending review |
in_progress | Purchase is being processed |
in_review | Purchase is under review |
inactive | Purchase is inactive (excluded from calculations) |
error | Error occurred during processing |
CO2e Calculation
Emissions are calculated using different methodologies based on purchase type:Spend-Based Method
Supplier-Specific Method
Workflow
Tracking Purchases
- Create Purchase: Add purchase with product, quantity, and sector information
- Set Type: Choose spend-based or supplier-specific calculation method
- Link Supplier Factor (optional): For supplier-specific, link a custom emission factor
- Query Results: Retrieve purchases to see calculated CO2e
Bulk Upload
For large volumes of purchases, use the CSV bulk upload feature in the Dcycle app or the Legacy API bulk upload endpoint.Error Handling
Common HTTP Status Codes
| Status | Meaning | Solution |
|---|---|---|
| 200 | Success | - |
| 201 | Created | - |
| 204 | No Content (delete successful) | - |
| 400 | Bad Request | Check request parameters and format |
| 401 | Unauthorized | Verify API key |
| 404 | Not Found | Check resource ID or organization |
| 422 | Validation Error | Review error details in response |
| 500 | Server Error | Contact support if persists |

