> ## Documentation Index
> Fetch the complete documentation index at: https://cinch-api.crex.page/llms.txt
> Use this file to discover all available pages before exploring further.

# Get all order emissions for a customer

> Return all order emissions for a customer



## OpenAPI

````yaml get /api/customer-emissions/{id}
openapi: 3.0.0
info:
  title: CREX API
  version: '1.0'
servers:
  - url: https://api.gocrex.com
    variables: {}
security:
  - ApiKeyAuth: []
tags: []
paths:
  /api/customer-emissions/{id}:
    get:
      tags: []
      summary: Get all order emissions for a customer
      description: Return all order emissions for a customer
      operationId: GrootApi.CustomerEmissionsController.show
      parameters:
        - description: Customer ID
          example: CUST-123
          in: path
          name: id
          required: true
          schema:
            type: string
            x-struct: null
            x-validate: null
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerOrderEmissionsResponse'
          description: CustomerOrderEmissionsResponse
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ErrorResponse
      callbacks: {}
components:
  schemas:
    CustomerOrderEmissionsResponse:
      description: Customer order emissions by customer ID
      example:
        customer_id: some-customer-id
        emission_unit: kgCO2e
        number_of_orders: 1
        orders:
          - created_at: '2025-02-07T09:24:16.498110Z'
            customer_id: some-customer-id
            emission_unit: kgCO2e
            items:
              - device_id: lap-app-lap-app-m3mba138c8g16c8g
                emission_breakdown:
                  packaging:
                    description: Packaging of the device
                    emission: 1.47325
                    emission_unit: kgCO2e
                    ghg_category: 'Category 1: Purchased goods and services'
                    ghg_scope: '3'
                    type: estimated
                  product_embodied_emission:
                    description: >-
                      Embodied emission of Apple MacBook Air 13 M3 (8C CPU + 8C
                      GPU + 16C NE + 8GB)
                    emission: 6.834375
                    emission_unit: kgCO2e
                    ghg_category: 'Category 1: Purchased goods and services'
                    ghg_scope: '3'
                    type: estimated
                  product_use:
                    description: >-
                      Emission from use of Apple MacBook Air 13 M3 (8C CPU + 8C
                      GPU + 16C NE + 8GB)
                    emission: 1.603125
                    emission_unit: kgCO2e
                    ghg_category: Electricity
                    ghg_scope: '2'
                    type: indicative
                  transportation:
                    description: Upstream transportation of the device
                    emission: 0.01815
                    emission_unit: kgCO2e
                    ghg_category: 'Category 4: Upstream transportation and distribution'
                    ghg_scope: '3'
                    type: estimated
                serial_number: XYX
                total_emission: 9.9289
                type: product
            order_date: '2024-12-12'
            order_id: some-order-id-1A
            status: created
            tenure_start_date: '2025-01-01'
            total_emission: 9.9289
        total_emission: 9.9289
      properties:
        customer_id:
          description: Your customer ID
          type: string
          x-struct: null
          x-validate: null
        emission_unit:
          description: Emission unit
          type: string
          x-struct: null
          x-validate: null
        number_of_orders:
          description: Number of orders
          example: 2
          type: integer
          x-struct: null
          x-validate: null
        orders:
          description: List of orders
          items:
            $ref: '#/components/schemas/OrderResponse'
          type: array
          x-struct: null
          x-validate: null
        total_emission:
          description: Total emission
          example: 135
          type: number
          x-struct: null
          x-validate: null
      title: CustomerOrderEmissionsResponse
      type: object
      x-struct: Elixir.GrootApi.ApiSpec.Schemas.CustomerOrderEmissionsResponse
      x-validate: null
    ErrorResponse:
      example:
        code: unauthorized
        detail: Invalid API key
      properties:
        code:
          type: string
          x-struct: null
          x-validate: null
        detail:
          type: string
          x-struct: null
          x-validate: null
      title: ErrorResponse
      type: object
      x-struct: Elixir.GrootApi.ApiSpec.Schemas.ErrorResponse
      x-validate: null
    OrderResponse:
      properties:
        created_at:
          description: Order creation date
          format: date-time
          type: string
          x-struct: null
          x-validate: null
        customer_id:
          description: Customer ID
          type: string
          x-struct: null
          x-validate: null
        emission_unit:
          description: Unit of GHG emission
          example: kgCO2e
          type: string
          x-struct: null
          x-validate: null
        items:
          description: List of items in the order
          items:
            $ref: '#/components/schemas/ItemSchema'
          type: array
          x-struct: null
          x-validate: null
        order_date:
          description: Order date
          format: date
          type: string
          x-struct: null
          x-validate: null
        order_id:
          description: Order ID
          type: string
          x-struct: null
          x-validate: null
        status:
          description: Order status
          example: created
          type: string
          x-struct: null
          x-validate: null
        tenure_start_date:
          description: Order's tenure start date
          format: date
          type: string
          x-struct: null
          x-validate: null
        total_emission:
          description: Total GHG emission of the order
          type: number
          x-struct: null
          x-validate: null
      title: OrderResponse
      type: object
      x-struct: Elixir.GrootApi.ApiSpec.Schemas.OrderResponse
      x-validate: null
    ItemSchema:
      properties:
        device_id:
          description: Device ID
          type: string
          x-struct: null
          x-validate: null
        emission_breakdown:
          properties:
            packaging:
              $ref: '#/components/schemas/EmissionBreakdownSchema'
            product_embodied_emission:
              $ref: '#/components/schemas/EmissionBreakdownSchema'
            product_use:
              $ref: '#/components/schemas/EmissionBreakdownSchema'
            transportation:
              $ref: '#/components/schemas/EmissionBreakdownSchema'
          type: object
          x-struct: null
          x-validate: null
        serial_number:
          description: Serial number of the product
          type: string
          x-struct: null
          x-validate: null
        total_emission:
          description: Total GHG emission of the item
          type: number
          x-struct: null
          x-validate: null
        type:
          description: Type of item
          enum:
            - product
            - packaging
            - transportation
          example: product
          type: string
          x-struct: null
          x-validate: null
      title: ItemSchema
      type: object
      x-struct: Elixir.GrootApi.ApiSpec.Schemas.OrderResponse.ItemSchema
      x-validate: null
    EmissionBreakdownSchema:
      properties:
        description:
          description: Description of the emission source
          type: string
          x-struct: null
          x-validate: null
        emission:
          description: GHG Emission value
          type: number
          x-struct: null
          x-validate: null
        emission_unit:
          description: Unit of GHG emission
          example: kgCO2e
          type: string
          x-struct: null
          x-validate: null
        ghg_category:
          description: GHG category
          type: string
          x-struct: null
          x-validate: null
        ghg_scope:
          description: GHG Scope category
          type: string
          x-struct: null
          x-validate: null
        type:
          description: Type of emission computation result (e.g., estimated, indicative)
          type: string
          x-struct: null
          x-validate: null
      title: EmissionBreakdownSchema
      type: object
      x-struct: Elixir.GrootApi.ApiSpec.Schemas.OrderResponse.EmissionBreakdownSchema
      x-validate: null
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: X-API-Key
      type: apiKey

````