Data Ingestion
Submit purchase goods and services data
Submit purchase goods and services data directly to the Unravel Carbon platform for processing and carbon footprint calculation.
This endpoint allows you to:
- Ingest transaction data: Submit purchase records with detailed item information
- Validation: Validates supplier/manufacturer information, currency formats, and activity measurements
- Deduplication: Use unique transaction IDs to prevent duplicate data processing
- Flexible data submission: Supports both JSON and CSV formats
Key Validation Rules:
- Transaction dates cannot be in the future
- supplier_name + supplier_location must be provided
- activity_measure_value and activity_measure_unit must be provided together
- Currency codes are automatically uppercased
Each facility receives its own dedicated upload job for optimal processing and tracking.
post/ingest/purchase_goods_and_services
Request
- Base URLhttps://api.unravelcarbon.com/api/v1
- AuthHTTP bearer
Headers
Authorizationstring required
Example:Bearer <your_api_key>
Bearer token (API Key)
Request body
Example request
{
"records": [
{
"transaction_id": "PGS_001_2024_01_15",
"transaction_date": "2024-01-15",
"facility_name": "Main Office",
"item_description": "Office Supplies - Notebooks and Pens",
"transaction_amount": 1250.5,
"supplier_name": "Office Depot Inc",
"supplier_location": "New York, USA",
"currency": "USD",
"activity_measure_value": 150,
"activity_measure_unit": "kilograms",
"item_unit_price": 119.99,
"item_unit_weight_kg": 2.5,
"product_category": "Electronics",
"product_sub_category": "Laptops",
"material_composition": "50% plastic, 30% metal, 20% electronics",
"general_ledger_act": "6000-001"
}
]
}Response
Purchase goods and services data successfully ingested
Example response
{
"status": "success",
"message": "Successfully processed 2 records across 1 facilities",
"data": {
"sync_run_id": "6937e5891dcdfab34c7a3cd2",
"import_type": "purchase_goods_and_services",
"total_records": 2,
"facilities_processed": [
{
"facility_name": "Huskies of Norway",
"records_count": 2,
"status": "success",
"date_range": {
"start_date": "2024-01-09",
"end_date": "2024-01-10"
}
}
],
"upload_jobs_created": 1,
"upload_job_ids": [
"6937e5891dcdfab34c7a3cd3"
],
"summary": {
"total_facilities": 1,
"total_records": 2,
"successful_facilities": 1,
"date_range": {
"start_date": "2024-01-09",
"end_date": "2024-01-10"
}
}
}
}Changes
No recorded changes to this operation across all 4 revisions of this API.