Skip to content

Referral rewards

Returns referrals rewards that have been applied to an account.

Authentication required

Requires account user level access.

Arguments

  • accountNumber: String!

Returns

Examples

Get all rewards

query getAccountReferralRewards($accountNumber: String!) {
       account(accountNumber: $accountNumber) {
          referrals{
              edges {
                  node {
                      id
                      referredUserName
                      paymentDate
                      paymentStatus
                      referredUserJoinDate
                      code
                      referredUserPaymentAmount
                      referringUserPaymentAmount
                      combinedPaymentAmount
                  }
              }
          }
       }
}
1
2
3
4
# Input variables
{
  "accountNumber":"A-12345"
}
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 getAccountReferralRewards($accountNumber: String!) {
       account(accountNumber: $accountNumber) {
          referrals{
              edges {
                  node {
                      id
                      referredUserName
                      paymentDate
                      paymentStatus
                      referredUserJoinDate
                      code
                      referredUserPaymentAmount
                      referringUserPaymentAmount
                      combinedPaymentAmount
                  }
              }
          }
       }
    }
"""

VARIABLES =     {
    "accountNumber":"A-12345"
}

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 getAccountReferralRewards($accountNumber: String!) {
   account(accountNumber: $accountNumber) {
      referrals{
          edges {
              node {
                  id
                  referredUserName
                  paymentDate
                  paymentStatus
                  referredUserJoinDate
                  code
                  referredUserPaymentAmount
                  referringUserPaymentAmount
                  combinedPaymentAmount
              }
          }
      }
   }
}
`

const variables = {
  "accountNumber": "A-12345"
}

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 getAccountReferralRewards($accountNumber: String!) {
   account(accountNumber: $accountNumber) {
      referrals{
          edges {
              node {
                  id
                  referredUserName
                  paymentDate
                  paymentStatus
                  referredUserJoinDate
                  code
                  referredUserPaymentAmount
                  referringUserPaymentAmount
                  combinedPaymentAmount
              }
          }
      }
   }
}
`

export const variables = {
    "accountNumber": "A-12345"
}

axios({
  url: apiUrl,
  method: "post",
  data: {
    query: query,
    variables: variables,
  },
  headers: headers,
}).then((response) => {
  console.log(JSON.stringify(response.data, null, 4));
});
{
    "data": {
        "account": {
        "referrals": {
            "edges": [
                    {
                        "node": {
                        "id": "15",
                        "referredUserName": "Artras Urbonas",
                        "paymentDate": null,
                        "paymentStatus": "Switch in progress",
                        "referredUserJoinDate": "2022-02-28T16:41:52.431740+00:00",
                        "code": "SCHEME-0",
                        "referredUserPaymentAmount": 1500,
                        "referringUserPaymentAmount": 1000,
                        "combinedPaymentAmount": 2500
                        }
                    },
                    {
                        "node": {
                        "id": "16",
                        "referredUserName": "Bruna Silveira",
                        "paymentDate": null,
                        "paymentStatus": "Switch in progress",
                        "referredUserJoinDate": "2022-02-28T16:41:53.094757+00:00",
                        "code": "SCHEME-1",
                        "referredUserPaymentAmount": 1500,
                        "referringUserPaymentAmount": 1500,
                        "combinedPaymentAmount": 3000
                        }
                    }
                ]
            }
        }
    }
}

Get the first X number of rewards

query getAccountReferralRewards($accountNumber: String!, $first:Int!) {
       account(accountNumber: $accountNumber) {
          referrals(first:$first){
              edges {
                  node {
                      id
                      referredUserName
                      paymentDate
                      paymentStatus
                      referredUserJoinDate
                      code
                      referredUserPaymentAmount
                      referringUserPaymentAmount
                      combinedPaymentAmount
                  }
              }
          }
       }
}
1
2
3
4
5
# Input variables
{
  "accountNumber":"A-78910"
  "first":1
}
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 getAccountReferralRewards($accountNumber: String!, $first:Int!) {
        account(accountNumber: $accountNumber) {
            referrals(first:$first){
                edges {
                    node {
                        id
                        referredUserName
                        paymentDate
                        paymentStatus
                        referredUserJoinDate
                        code
                        referredUserPaymentAmount
                        referringUserPaymentAmount
                        combinedPaymentAmount
                    }
                }
            }
        }
    }

"""

VARIABLES =     {
    "accountNumber":"A-78910",
    "first":1
}

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 getAccountReferralRewards($accountNumber: String!, $first:Int!) {
    account(accountNumber: $accountNumber) {
        referrals(first:$first){
            edges {
                node {
                    id
                    referredUserName
                    paymentDate
                    paymentStatus
                    referredUserJoinDate
                    code
                    referredUserPaymentAmount
                    referringUserPaymentAmount
                    combinedPaymentAmount
                }
            }
        }
    }
}
`

const variables = {
    "accountNumber": "A-78910",
    "first": 1
}

axios({
  url: apiUrl,
  method: "post",
  data: {
    query: query,
    variables: variables,
  },
  headers: headers,
}).then((response) => {
  console.log(JSON.stringify(response.data, null, 4));
});
{
"data": {
    "account": {
        "referrals": {
                "edges": [
                    {
                        "node": {
                        "id": "16",
                        "referredUserName": "Bruna Silveira",
                        "paymentDate": null,
                        "paymentStatus": "Switch in progress",
                        "referredUserJoinDate": "2022-02-28T16:41:53.094757+00:00",
                        "code": "SCHEME-1",
                        "referredUserPaymentAmount": 1500,
                        "referringUserPaymentAmount": 1000,
                        "combinedPaymentAmount": 2500
                        }
                    }
                ]
            }
        }
    }
}
Back to top