Skip to content

Get account using URN (unique reference number)

Returns an account using the given urn.

URN is a unique reference number that is used to refer an account with their previous energy retailer (if applicable).

Authentication Required

Requires CAN_QUERY_ACCOUNTS_WITH_URN permission.

Arguments

  • urn: String!

Returns

query getAccountWithUrn($urn: String!) {
    getAccountWithUrn(urn: $urn) {
        billingName
        number
        status
        users {
        givenName
        }
        accountType
        urn
        id
    }
}
import pprint

import requests

# API_URL = "https://api.oeus-kraken.energy/v1/graphql/" # prod
API_URL = "https://api.oeus-kraken.systems/v1/graphql/" # test
JWT_TOKEN = "PLACE_JWT_TOKEN_HERE"
HEADERS = {
    "Authorization": f"JWT {JWT_TOKEN}"
}

QUERY = """
    query getAccountWithUrn($urn: String!){
        getAccountWithUrn(urn:$urn){
            number
            accountType
            status
            billingName
        }
    }
"""
VARIABLES =     {
  "urn":"7"
}

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 apiUrl = "https://api.oeus-kraken.energy/v1/graphql/" // Prod
const apiUrl = "https://api.oeus-kraken.systems/v1/graphql/" // Test

const jwtToken = "PLACE_JWT_TOKEN_HERE"

let headers = {
  "Authorization": `JWT ${jwtToken}`
}

const query = `
query getAccountWithUrn($urn: String!){
    getAccountWithUrn(urn:$urn){
        number
        accountType
        status
        billingName
    }
}
`
const variables = {
  "urn": "7"
}

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

export const jwtToken = "PLACE_JWT_TOKEN_HERE"

let headers = {"Authorization": `JWT ${jwtToken}`}

export const query = `
query getAccountWithUrn($urn: String!){
    getAccountWithUrn(urn:$urn){
        number
        accountType
        status
        billingName
    }
}
`
export const variables = {
  "urn": "7"
}

axios({
  url: apiUrl,
  method: "post",
  data: {
    query: query,
    variables: variables,
  },
  headers: headers,
}).then((response) => {
  console.log(JSON.stringify(response.data, null, 4));
});
1
2
3
4
5
6
7
8
    "data": {
        "getAccountWithUrn": {
          "number": "A-5F175559",
          "accountType": "DOMESTIC",
          "status": "PENDING",
          "billingName": "Timothy Hart"
        }
    }
Back to top