Listar trades
curl --request GET \
--url https://api-bc.pgubright.com/trades \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-bc.pgubright.com/trades', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-bc.pgubright.com/trades"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)[
{
"id": "<string>",
"buyer_sensor_id": "<string>",
"seller_sensor_id": "<string>",
"offer_id": "<string>",
"order_id": "<string>",
"kwh": "<string>",
"price_per_kwh": "<string>",
"total_price": "<string>",
"status": "PENDING_PAYMENT",
"tx_hash": "<string>",
"payment_id": "<string>",
"preparation_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}Mercado
Listar trades
GET
/
trades
Listar trades
curl --request GET \
--url https://api-bc.pgubright.com/trades \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-bc.pgubright.com/trades', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-bc.pgubright.com/trades"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)[
{
"id": "<string>",
"buyer_sensor_id": "<string>",
"seller_sensor_id": "<string>",
"offer_id": "<string>",
"order_id": "<string>",
"kwh": "<string>",
"price_per_kwh": "<string>",
"total_price": "<string>",
"status": "PENDING_PAYMENT",
"tx_hash": "<string>",
"payment_id": "<string>",
"preparation_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}{
"message": "Usuário sem permissão para operar neste sensor.",
"code": "SENSOR_FORBIDDEN"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Filtro por status.
Response
Trades visíveis ao usuário.
