You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to retrieve only the currently open Receipts in my store with the getShopReceipt endpoint.
For that, I'm trying to pass the status as a parameter.
However, independent of what I pass as a status, I always get a wild combination of Receipts.
For example:
def get_receipts(params,save=False,shop_id=shop_id, access_token=access_token, x_api_key=etsy_keystring,output_file="EtsyOrdersTest.json"):
url = f"https://api.etsy.com/v3/application/shops/{shop_id}/receipts"
headers = {
"Authorization": f"Bearer {access_token}",
"x-api-key": x_api_key
}
try:
response = requests.get(url, headers=headers, params=params)
if response.status_code == 401:
new_token = refresh_old_token(token)
access_token = new_token["access_token"]
headers = {
"Authorization": f"Bearer {access_token}",
"x-api-key": x_api_key
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
print("Access granted. Response received.")
if save:
with open(output_file, 'w') as f:
json.dump(response.json(), f, indent=4)
print(f"Response saved to {output_file}")
# Return the response data as json
response_data = response.json()
return response_data
else:
print(f"Error {response.status_code}: {response.text}")
except Exception as e:
print(f"An error occurred: {e}")
params = {
"status": "open"
}
get_receipts(params, save=True)
I also get complete orders when filtering for paid, so at first, I thought it was how the logic is handled internally by Etsy: E.g. Each complete Shipment is also paid, therefore one is a subset of the other.
However, there should be no logic where "open" is a subset of "complete" as seen in the example above.
Am I doing something wrong when trying to retrieve all open orders filtered by status, or is that an error in how Etsy handles my request?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to retrieve only the currently open Receipts in my store with the getShopReceipt endpoint.
For that, I'm trying to pass the status as a parameter.
However, independent of what I pass as a status, I always get a wild combination of Receipts.
For example:
returns a json containing the following receipt:
I also get complete orders when filtering for paid, so at first, I thought it was how the logic is handled internally by Etsy: E.g. Each complete Shipment is also paid, therefore one is a subset of the other.
However, there should be no logic where "open" is a subset of "complete" as seen in the example above.
Am I doing something wrong when trying to retrieve all open orders filtered by status, or is that an error in how Etsy handles my request?
Beta Was this translation helpful? Give feedback.
All reactions