Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Table of Contents

Changelogs

Version

Date

Changes by

Description of change

V1.0.0

Que Nguyen

  • Initiated document

REC Transaction History Resource

TransactionId text

Transaction unique identifier

TransactionTime datetime

Transaction time

Type object

Transaction Type object includes Value Description

{
  "TransactionId": "TRANS-IREC-RETI-20240522-50N5-00004",
  "TransactionTime": "2024-05-22T06:54:51.863",
  "Type": {
    "Value": "Retirement",
    "Description": "Retirement"
  },
  "Registry": {
    "Value": "IREC",
    "Description": "I-REC"
  },
  "Notes": "",
  "Details": [
    {
      "AssetName": "Khanh Hoa K1234 Looming",
      "SerialNumber": "IREC-KHANES20001-VN-2020-0101-0530-1.066602 to 1.069015",
      "CountryCode": "VN",
      "Energy": "Wind",
      "Vintage": "2020",
      "Total": 0.002414,
      "RecPrefix": "IREC-KHANES20001-VN-2020-0101-0530",
      "VintageFrom": "2020-01-01T17:00:00",
      "VintageTo": "2020-05-30T17:00:00"
    }
  ]
}

Meta Pagination Resource

CurrentPage - integer

Current page returned

TotalPage - integer

Total pages by items per page

TotalItems - integer

 Total items number

ItemsPerPage - integer

Total items per page

{
  "CurrentPage": 1,
  "TotalPage": 6,
  "TotalItems": 576,
  "ItemsPerPage": 100

API Definitions

GET /public/v2/inventories/recs/transaction-histories

Request

Headers

Content-Type

application/json

Authorization

Bearer {{access_token}}

Query Parameters

Types (optional) text - enum

Transaction enum value types

  • Issuance - transaction created upon issuance REC

  • Transfer - transaction created upon a transfer between 2 accounts

  • Listing - transaction created upon receiving REC imported from other platforms

  • Retirement - transaction created upon retiring REC.

  • Delisting - transaction created upon exporting REC to other platforms

DeviceId (optional) uuid

Device unique identifier for approved Device or Grouped Device

Registry (optional) text

Registry value (IREC, TIGR)

CountryCodes (optional) array[text]

Country alpha codes, ISO3166 (VN, CN, …)

CurrentPage (optional) integer

The page number to retrieve the next set of inverters. The number has to be greater than 1, and will default to 1.

ItemsPerPage (optional) integer

The maximum number of inverter brands to return per page. This number can range from 10 to 100 and defaults to 100.

curl --location 'https://uat-api.redex.eco/public/v2/inventories/recs/transaction-histories?CurrentPage=1&ItemsPerPage=100&Types=Retirement&Registry=IREC&DeviceId=7ea1e5a2-f4d8-4e4f-8cc8-b2eeaca5cad7&CountryCodes=VN' \
--header 'Authorization: Bearer {{access_token}}'

Response

Response Body

Errors list of error objects

Please see "Getting Started - #Error Object" for more details

Meta pagination resource

Return Pagination Resource

StatusCode integer

Http Status codes standard. Example 200, 201, 404.

Message text

Response message: Success or error message.

Data array[object] - array object of The System Power Station Resource

A collection of The System Power Station Resource

200 OK

{
  "Data": [
    {
      "TransactionId": "TRANS-IREC-RETI-20240522-50N5-00004",
      "TransactionTime": "2024-05-22T06:54:51.863",
      "Type": {
        "Value": "Retirement",
        "Description": "Retirement"
      },
      "Registry": {
        "Value": "IREC",
        "Description": "I-REC"
      },
      "Notes": "",
      "Details": [
        {
          "AssetName": "Khanh Hoa K1234 Looming",
          "SerialNumber": "IREC-KHANES20001-VN-2020-0101-0530-1.066602 to 1.069015",
          "CountryCode": "VN",
          "Energy": "Wind",
          "Vintage": "2020",
          "Total": 0.002414,
          "RecPrefix": "IREC-KHANES20001-VN-2020-0101-0530",
          "VintageFrom": "2020-01-01T17:00:00",
          "VintageTo": "2020-05-30T17:00:00"
        }
      ]
    }
  ],
  "Meta": {
    "CurrentPage": 1,
    "TotalPage": 46,
    "TotalItems": 46,
    "ItemsPerPage": 1
  },
  "Errors": null,
  "StatusCode": 200,
  "Message": "Success"
}

 

401 Unauthorized

{
  "Data": null,
  "StatusCode": 401,
  "Meta": null,
  "Errors": [],
  "Message": "Unauthorized"
}

 

403 Forbidden

{
  "Data": null,
  "StatusCode": 403,
  "Meta": null,
  "Errors": [],
  "Message": "Forbidden"
}

Rate limit

Rate Limit Algorithm: Fixed Window

In fixed window rate limiting, a fixed time window (e.g., one minute, one hour) is used to track the number of requests or actions allowed within that window. Requests exceeding the limit are either rejected or throttled until the window resets.

Rate Limiting Overview

Our API employs rate limiting to ensure fair usage and protect the performance and availability of the service. Combination of Global Policy and Operation Policy

Global Policy

  • Rate Limit: 3000 requests per 5 minute(s)

  • Renewal Period: 300 second(s)

  • Key: IP Address

  • Increment Condition: Any Request

Operation Policy

  • Rate Limit: 60 requests per 1 minute(s)

  • Renewal Period: 60 second(s)

  • Key: accound-id business account Id.

  • Increment Condition: Any Request.

Rate Limit Details

  1. Rate Limit by Key:

    1. Key: This ensures that rate limits are applied uniquely for each business account id.

    2. Request Limit: Each key is allowed to make up to 60 requests per minute.

    3. Reset Interval: The limit resets every 60 seconds.

  2. Response Headers:

    1. Retry-After: Sent when the rate limit is exceeded, indicating how long to wait before making another request.

Exceeding the Rate Limit

When the rate limit is exceeded, the API will return a 429 Too Many Requests status code. The response will include a Retry-After header specifying the number of seconds to wait before making a new request.

Example Response When Rate Limit is Exceeded

HTTP/1.1 429 Too Many Requests
Retry-After: 60
Content-Type: application/json
{
    "Data": null,
    "Errors": null,
    "StatusCode": 429,
    "Message": "Rate limit exceeded",
    "Meta": null
}

  • No labels