Update Purchase
Update Purchase
Modify an existing purchase’s details
PATCH
Update Purchase
Update Purchase
Update an existing purchase’s information. You can modify any combination of the purchase’s fields.Partial Updates: Only include the fields you want to update. Fields not included in the request body will remain unchanged.
Request
Headers
Your API key for authenticationExample:
sk_live_1234567890abcdefYour organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faMust be
application/jsonPath Parameters
The unique identifier (UUID) of the purchase to updateExample:
550e8400-e29b-41d4-a716-446655440000Body Parameters
Name of the product or service purchased (max 255 characters)Example:
"Office Supplies - Updated"Economic sector for emission factor lookup (max 255 characters)Example:
"Retail trade"2-letter ISO country code where the purchase was madeExample:
"DE"Purchase amount (must be >= 0). For spend-based, this is the monetary value.Example:
2000.00Unit of measurement (e.g., EUR, USD, kg)Example:
"EUR"Date of purchase in YYYY-MM-DD formatExample:
"2024-03-20"Expense classificationAvailable values:
capex, opexExample: "capex"Optional description of the purchase (max 500 characters)Example:
"Updated Q1 2024 order with additional items"Calculation method for emissionsAvailable values:
spend_based, supplier_specificExample: "supplier_specific"Purchase statusAvailable values:
active, pending, in_progress, in_review, inactiveExample: "in_review"Recycled content percentage (0 to 1). Reduces calculated emissions.Example:
0.5 (50% recycled content)Optional supplier identifier for referenceExample:
"supplier-456"UUID of custom emission factor for supplier-specific calculationsExample:
"770e8400-e29b-41d4-a716-446655440000"Purchase frequencyAvailable values:
onceExample: "once"UUID of linked file/documentExample:
"660e8400-e29b-41d4-a716-446655440000"Name of linked file (max 255 characters)Example:
"invoice_q1_2024_updated.pdf"URL of linked fileExample:
"https://storage.dcycle.io/..."Response
Returns the updated purchase object with recalculated emissions.Unique identifier (UUID)
Organization UUID
Name of the product or service
Optional description
Economic sector
2-letter ISO country code
Purchase amount
Unit of measurement
Date of purchase
Calculation method:
spend_based or supplier_specificClassification:
capex or opexPurchase status
Recycled content percentage (0-1)
Supplier identifier
Custom emission factor UUID
Linked file UUID
Linked file name
Linked file download URL
Recalculated CO2 equivalent emissions (kg)
Purchase frequency
Timestamp when the purchase was created
Timestamp when the purchase was last updated
Example
Successful Response
Status Code:200 OK
Common Errors
401 Unauthorized
Cause: Missing or invalid API key404 Not Found
Cause: Purchase not found or doesn’t belong to your organization422 Validation Error
Cause: Invalid field valuesrecycledis between 0 and 1quantityis >= 0countryis a valid 2-letter ISO codeexpense_typeis eithercapexoropexpurchase_typeis eitherspend_basedorsupplier_specific
Use Cases
Update Quantity and Recalculate Emissions
Modify the purchase amount to update the calculated CO2e:Change Calculation Method
Switch from spend-based to supplier-specific calculation:Update Recycled Content
Adjust the recycled percentage for more accurate emissions:Mark Purchase as Inactive
Exclude a purchase from calculations:Link Supporting Documentation
Attach an invoice or receipt to the purchase:Bulk Update Purchases
Update multiple purchases’ status:Related Endpoints
Get Purchase
View purchase details
Delete Purchase
Remove a purchase
List Purchases
View all purchases
Custom Emission Factors
Create supplier-specific factors

