Skip to main content
Create order with emissions
curl --request POST \
  --url https://api.gocrex.com/api/customer-orders \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "customer_id": "<string>",
  "order_date": "2023-12-25",
  "order_id": "<string>",
  "tenure_start_date": "2023-12-25",
  "items": [
    {
      "config": {
        "product_id": "<string>",
        "serial_number": "<string>",
        "tenure_months": 123,
        "weight_kg": 123
      }
    }
  ]
}
'
{
  "created_at": "2023-11-07T05:31:56Z",
  "customer_id": "<string>",
  "emission_unit": "kgCO2e",
  "items": [
    {
      "device_id": "<string>",
      "emission_breakdown": {
        "packaging": {
          "description": "<string>",
          "emission": 123,
          "emission_unit": "kgCO2e",
          "ghg_category": "<string>",
          "ghg_scope": "<string>",
          "type": "<string>"
        },
        "product_embodied_emission": {
          "description": "<string>",
          "emission": 123,
          "emission_unit": "kgCO2e",
          "ghg_category": "<string>",
          "ghg_scope": "<string>",
          "type": "<string>"
        },
        "product_use": {
          "description": "<string>",
          "emission": 123,
          "emission_unit": "kgCO2e",
          "ghg_category": "<string>",
          "ghg_scope": "<string>",
          "type": "<string>"
        },
        "transportation": {
          "description": "<string>",
          "emission": 123,
          "emission_unit": "kgCO2e",
          "ghg_category": "<string>",
          "ghg_scope": "<string>",
          "type": "<string>"
        }
      },
      "serial_number": "<string>",
      "total_emission": 123,
      "type": "product"
    }
  ],
  "order_date": "2023-12-25",
  "order_id": "<string>",
  "status": "created",
  "tenure_start_date": "2023-12-25",
  "total_emission": 123
}

Authorizations

X-API-Key
string
header
required

Body

application/json

OrderParams

Order Params

customer_id
string
required

Your customer ID. This is used to identify the customer in your system.

order_date
string<date>
required

The date of the Order (YYYY-MM-DD)

order_id
string
required

Your order ID. This is used to identify the order in your system.

tenure_start_date
string<date>
required

The start date of the order (YYYY-MM-DD)

items
OrderItemSchema · object[]

Response

OrderResponse

created_at
string<date-time>

Order creation date

customer_id
string

Customer ID

emission_unit
string

Unit of GHG emission

Example:

"kgCO2e"

items
ItemSchema · object[]

List of items in the order

order_date
string<date>

Order date

order_id
string

Order ID

status
string

Order status

Example:

"created"

tenure_start_date
string<date>

Order's tenure start date

total_emission
number

Total GHG emission of the order