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 16 Next »

Query REC Inventory

Table of Contents

Changelogs

Version

Date

Changes by

Description of change

V1.0

Que Nguyen

  • Added Table of Contents.

  • Added Changelogs.

V1.0.1

Que Nguyen

  • Added Release Status

  • Modified the document format

  • Added Rate Limit

Release status

Environment

Status

Released Date

Version

DEV

RELEASED

V1.0.1

UAT

RELEASED

V1.0.1

PROD

NOT RELEASED

N/A

N/A

The Inventory’s REC Resource

Id uuid

REC Unique Identifier

DeviceId uuid

Device Unique Identifier

DeviceName text

Name on Registry Of Registered Device

DeviceUniqueId text

Human readable device Unique Id

RegistryId text

Registry Device Unique ID - the ID managed by Registry

Registry:Value text

Value of Registry (IREC, TIGR)

Registry:Description text

Description of Registry (I-REC, TIGR)

SerialNumber text

REC Serial Number

Serial number is combination of RecPrefix

Total number - decimal(18,6)

REC Total Quantity

Retired number - decimal(18,6)

Retired REC Quantity: number of RECs retired

OnSale number - decimal(18,6)

On Sale: number of RECs on sale

OnRetirement number - decimal(18,6)

On Retirement: number of RECs on retirement

OnExporting number - decimal(18,6)

On Exporting: number of RECs on exporting

Exported number - decimal(18,6)

Exported: number of RECs Exported

OnAuction - number - decimal(18,6)

On Auction: number of RECs on auction

Available number - decimal(18,6)

Available RECs: number of available RECs

Formular: Available numbers = Total - OnSale - OnRetirement - OnExporting - OnAuction - Retired - Exported;

Balance number - decimal(18,6)

Balance of REC items:

Formular: Balance = Available + OnSale + OnRetirement + OnExporting + OnAuction;

VintageFrom datetime

Date Time UTC

VintageTo datetime

Date Time UTC

CountryCode text

2-character country alpha code. ISO-3166. Supported list below:

Country Code i.e. SG, CN, VN, MY, TH, ID

FuelType text

Fuel Type

EnergyValue text

Energy Type

Value: Solar, Wind…

VintageYear text

Vintage Year

TradingCount text

Trading’s total count number. Default = 0.

RecItemType enum text

REC Item’s origination type (Issued, Imported)

{
  "Id": "326be15c-795e-4c33-26f0-08dbf7dca95f",
  "DeviceId": "f26be15c-795e-4c33-26f0-08dbf7dca95f",
  "DeviceName": "Sentosa Fun Pass Singapore",
  "DeviceUniqueId": "SG-SOLAR-11012021-2540515487",
  "RegistryId": "GFNIES10001",
  "SerialNumber": "IREC-GFNIES10001-SG-2021-1106-1110-1767.250000 to 1768.249999",
  "Total": 1,
  "Balance": 1,
  "Available": 1,
  "OnSale": 0,
  "OnRetirement": 0,
  "OnExporting": 0,
  "OnAuction": 0,
  "Retired": 0,
  "Exported": 0,
  "VintageFrom": "2021-11-06T00:00:00",
  "VintageTo": "2021-11-10T00:00:00",
  "CountryCode": "SG",
  "FuelType": "Solar",
  "EnergyValue": "Solar",
  "VintageYear": 2021,
  "TradingCount": 1,
  "RecItemType": "Issued",
  "Registry": {
    "Value": "IREC",
    "Description": "I-REC"
  }
}

API Definition

GET/public/v2/inventories/recs

Request

Headers

Content-Type

application/json

Authorization

Bearer {{access_token}}

Parameters

Parameters

ItemsPerPage - integer

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

每页最多返回数在10 - 100之间,默认为100。

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.

检索下一组逆变器的页码。该数字必须大于1,并且默认为1。

Registries (optional) - array[string]

Filter the items by Registry Value

  • IREC

  • TIGR

DeviceIds (optional) - array[uuid]

Array uuid of Device unique identifier

Example request

curl -X GET https://uat-api.redex.eco/public/v2/inventories/recs?Registries=IREC&CurrentPage=1&ItemsPerPage=10&DeviceIds=8948180e-b531-4442-b1b1-d303f20ec8bd \
     -H 'Authorization: Bearer <access_token>'

Response

Response Body

Data array[object] - objects of Inventory REC Resource

A collection of Inventory REC Resource

Errors list of error objects

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

请查看Getting Started - #Error Object以获得更多信息。

Meta pagination resource

Return Pagination Resource

返回分页信息

StatusCode integer

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

http状态码,如200,201,404

Message text

Response message: Success or error message.

返回成功或错误的信息。

200 Success

{
  "Data": [
    {
      "Id": "326be15c-795e-4c33-26f0-08dbf7dca95f",
      "DeviceId": "f26be15c-795e-4c33-26f0-08dbf7dca95f",
      "DeviceName": "Sentosa Fun Pass Singapore",
      "DeviceUniqueId": "SG-SOLAR-11012021-2540515487",
      "RegistryId": "GFNIES10001",
      "SerialNumber": "IREC-GFNIES10001-SG-2021-1106-1110-1767.250000 to 1768.249999",
      "Total": 1,
      "Balance": 1,
      "Available": 1,
      "OnSale": 0,
      "OnRetirement": 0,
      "OnExporting": 0,
      "OnAuction": 0,
      "Retired": 0,
      "Exported": 0,
      "VintageFrom": "2021-11-06T00:00:00",
      "VintageTo": "2021-11-10T00:00:00",
      "CountryCode": "SG",
      "FuelType": "Solar",
      "EnergyValue": "Solar",
      "VintageYear": 2021,
      "TradingCount": 1,
      "RecItemType": "Issued",
      "Registry": {
        "Value": "IREC",
        "Description": "I-REC"
      }
    }
  ],
  "Meta": {
    "CurrentPage": 5,
    "TotalPage": 7,
    "ItemsPerPage": 1,
    "TotalItems": 64,
  },
  "Errors": null,
  "StatusCode": 200,
  "Message": "Success"
}

404 Not Found

{
  "Data": null,
  "Errors": null,
  "Meta": null,
  "StatusCode": 404,
  "Message": "Not found"
}

401 Unauthorized

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

403 Forbidden

{
  "Data": null,
  "Errors": null,
  "Meta": null,
  "StatusCode": 403,
  "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