Hi,
since March 29 2023, I cannot figure out why my application to make orders stopped working, using /api/v3/brokerage/orders
API.
I am currently rececieving as response:
'{"error":"unknown","error_details":"Invalid product_id","message":"Invalid product_id"}'
.
Have any of you encountered the same issue?
Currently I am triyng to debug the error using this python code (extracted from the application):
import os
from dotenv import load_dotenv
load_dotenv('../.env')
api_key=os.getenv('API_KEY_WRITE')
api_secret=os.getenv('API_SECRET_WRITE')
import json, hmac, hashlib, time, base64
from requests.utils import to_native_string
import requests
from urllib import parse
import http.client
import json
import uuid
def create_header(method = "GET", endpoint = "", body = ""):
timestamp = str(int(time.time()))
message = timestamp + method + endpoint + str(body or '')
signature = hmac.new(api_secret.encode('utf-8'), message.encode('utf-8'), digestmod=hashlib.sha256).hexdigest()
payload = body
headers = {
"Content-Type": "application/json",
"CB-ACCESS-KEY": to_native_string(api_key),
"CB-ACCESS-SIGN": to_native_string(signature),
"CB-ACCESS-TIMESTAMP": to_native_string(timestamp)
}
return headers, payload
#### API CALL ####
conn = http.client.HTTPSConnection("api.coinbase.com")
endpoint= f'/api/v3/brokerage/orders'
method = 'POST'
guid = str(uuid.uuid1())
body = json.dumps({
"order_configuration":{
'limit_limit_gtd': {'base_size': '0.00216872', 'limit_price': '1375', 'end_time': '2023-04-13T18:23:00.000000Z', 'post_only': False},
},
"client_order_id": guid,
"product_id": "ETH-EUR",
"side": "BUY"
})
print(body)
headers, payload = create_header(method=method, endpoint=endpoint, body=body)
conn.request(method, endpoint, payload, headers)
res = conn.getresponse()
data = res.read()
print(data)
Thank you in advance.