---
title: "Submit purchase goods and services data"
method: POST
path: "/ingest/purchase_goods_and_services"
tags: ["Data Ingestion"]
---

# Submit purchase goods and services data

`POST /ingest/purchase_goods_and_services`

## Request

- Base URL: `https://api.unravelcarbon.com/api/v1`
- URL: `https://api.unravelcarbon.com/api/v1/ingest/purchase_goods_and_services`
- Auth: HTTP bearer

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.

## Headers

- `Authorization` string, required

## Request body

- PurchaseGoodsAndServicesIngestRequest
  - `records` PurchaseGoodsAndServicesRecord[], required: Array of purchase goods and services records
    - `transaction_id` string, required: Unique identifier for deduplication
    - `transaction_date` string, date, required: Date of the transaction (YYYY-MM-DD format)
    - `facility_name` string, required: Facility name where the transaction occurred
    - `item_description` string, required: Description of the purchased item or service
    - `transaction_amount` number, required: Total transaction amount
    - `supplier_name` string, required: Supplier name
    - `supplier_location` string, required: Location of the supplier (required if supplier_name is provided)
    - `currency` string, required: Currency code (3-letter ISO format, will be uppercased)
    - `activity_measure_value` integer: Quantity/amount of activity (must be paired with activity_measure_unit)
    - `activity_measure_unit` string: Unit of measurement for activity (must be paired with activity_measure_value)
    - `item_unit_price` number: Price per unit
    - `item_unit_weight_kg` number: Weight per unit in kilograms
    - `product_category` string: Category of the product
    - `product_sub_category` string: Subcategory of the product
    - `material_composition` string: Material composition breakdown
    - `general_ledger_act` string: General ledger account code

## Response `200`

Purchase goods and services data successfully ingested

- PurchaseGoodsAndServicesIngestResponse
  - `status` 'success': Processing status
  - `message` string: Success message
  - `data` object
    - `sync_run_id` string: Unique identifier for this sync run
    - `import_type` string: Type of import
    - `total_records` integer: Total number of records processed
    - `facilities_processed` object[]
      - `facility_name` string: Name of the facility
      - `records_count` integer: Number of records processed for this facility
      - `status` string: Processing status for this facility
      - `date_range` object
        - `start_date` string, date
        - `end_date` string, date
    - `upload_jobs_created` integer: Number of upload jobs created
    - `upload_job_ids` string[]: List of upload job IDs
    - `summary` object
      - `total_facilities` integer: Total number of facilities processed
      - `total_records` integer: Total number of records processed
      - `successful_facilities` integer: Number of facilities processed successfully
      - `failed_facilities` integer: Number of facilities that failed processing
      - `date_range` object
        - `start_date` string, date
        - `end_date` string, date

## Other responses

- `400`: Validation error
- `401`: Authentication failed
- `403`: Invalid API key
- `409`: Duplicate transaction
- `422`: Processing error
- `500`: Internal server error

---

[API](https://skmtc.dev/unravelcarbon/apis/unravel-carbon-public-api.md) - [All operations](https://skmtc.dev/unravelcarbon/apis/unravel-carbon-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/unravelcarbon/apis/unravel-carbon-public-api/revisions/310d3bb09dbe?raw)
