Skip to content

Get product using an id

Returns a product using the given id.

Authentication not required

products does not require authentication.

Arguments

  • id: ID

Returns

query getAllAvailableProducts($id:ID!){
    products(id:$id){
        id
        availableFrom
        availableTo
        availabilityStatus
        autoTopUpDefaultAmount
        autoTopUpMinimumAmount
        basedOnTimeOfUse
        code
        description
        displayName
        fullName
        generationCredit
        isWholesale
        marketName
        notes
        prepay
        term
        termsContractType
    }
}

Example

query productUsingId($id:ID){
    products(id:$id){
        id
        availableFrom
        availableTo
        availabilityStatus
        autoTopUpDefaultAmount
        autoTopUpMinimumAmount
        basedOnTimeOfUse
        code
        description
        displayName
        fullName
        generationCredit
        isWholesale
        marketName
        notes
        prepay
        term
        termsContractType
    }
}
1
2
3
4
# Input Variables
{
  "id":36
}
import pprint

import requests

# API_URL = "https://api.oeus-kraken.energy/v1/graphql/" # Prod
API_URL = "https://api.oeus-kraken.systems/v1/graphql/" # Test
HEADERS = {}

QUERY = """
    query productUsingId($id:ID){
            products(id:$id){
                id
                availableFrom
                availableTo
                availabilityStatus
                autoTopUpDefaultAmount
                autoTopUpMinimumAmount
                basedOnTimeOfUse
                code
                description
                displayName
                fullName
                generationCredit
                isWholesale
                marketName
                notes
                prepay
                term
                termsContractType
            }
        }
"""

VARIABLES = {"id": 36}

session = requests.Session()
session.headers.update(HEADERS)
response = session.post(
    url=API_URL,
    json={"query": QUERY, "variables": VARIABLES}
)
pprint.pprint(response.json())
const axios = require("axios")

// const API_URL = "https://api.oeus-kraken.energy/v1/graphql/" // Prod
const apiUrl = "https://api.oeus-kraken.systems/v1/graphql/" // Test
let headers = {'content-type': 'application/json'}

const query = `
  query productUsingId($id:ID){
      products(id:$id){
          id
          availableFrom
          availableTo
          availabilityStatus
          autoTopUpDefaultAmount
          autoTopUpMinimumAmount
          basedOnTimeOfUse
          code
          description
          displayName
          fullName
          generationCredit
          isWholesale
          marketName
          notes
          prepay
          term
          termsContractType
      }
  }
`
const variables = {
  "id":36
}

axios({
  url: apiUrl,
  method: "post",
  data: {
    query: query,
    variables: variables,
  },
  headers: headers,
}).then((response) => {
  console.log(JSON.stringify(response.data, null, 4));
});
import axios from 'axios';

// const API_URL = "https://api.oeus-kraken.energy/v1/graphql/" // Prod
export const apiUrl = "https://api.oeus-kraken.systems/v1/graphql/" // Test
let headers = {'content-type': 'application/json'}

export const query = `
  query productUsingId($id:ID){
      products(id:$id){
          id
          availableFrom
          availableTo
          availabilityStatus
          autoTopUpDefaultAmount
          autoTopUpMinimumAmount
          basedOnTimeOfUse
          code
          description
          displayName
          fullName
          generationCredit
          isWholesale
          marketName
          notes
          prepay
          term
          termsContractType
      }
  }
`

export const variables = {
    "id": 36
}

axios({
  url: apiUrl,
  method: "post",
  data: {
    query: query,
    variables: variables,
  },
  headers: headers,
}).then((response) => {
  console.log(JSON.stringify(response.data, null, 4));
});
{
"data": {
    "products": [
            {
                "id": "36",
                "availableFrom": "2021-12-10T00:00:00-06:00",
                "availableTo": null,
                "availabilityStatus": "PUBLIC",
                "autoTopUpDefaultAmount": null,
                "autoTopUpMinimumAmount": null,
                "basedOnTimeOfUse": false,
                "code": "OCTOPLUS-24M",
                "description": "24 Month Fixed Rate with no exit fees.",
                "displayName": "OctoPlus 24M",
                "fullName": "OctoPlus 24M",
                "generationCredit": true,
                "isWholesale": false,
                "marketName": "USA_ERCOT_ELECTRICITY",
                "notes": "",
                "prepay": false,
                "term": 24,
                "termsContractType": ""
            }
        ]
    }
}
Back to top