cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IAF token supplied is invalid - with valid token?

Hello all, been working on my app, and I'm to the point where I can create an item, an offer, and now I'm trying to publish.

After handling countless errors - it seems the publish function no longer is throwing any errors related to types, variables, etc.. Just about the token.

 

However, my token is working fine. I can seemingly do absolutely everything - except publish.

 

Any ideas?

 

def publish_offer(access_token, offer_id):
    url = f"https://api.ebay.com/sell/inventory/v1/offer/{offer_id}/publish"
    headers = {
        'Authorization': f'Bearer {access_token}',
        'Content-Type': 'application/json',
        'Accept': 'application/json',
        'Content-Language': 'en-US'
    }

    response = requests.post(url, headers=headers)
    
    if response.status_code == 200 or response.status_code == 201:
        print("Offer published successfully!")
    else:
        print(f"Failed to publish offer. Status Code: {response.status_code}")
        print("Response:", response.json())

    return response.json()

 Error:

Response: {'errors': [{'errorId': 25002, 'domain': 'API_INVENTORY', 'subdomain': 'Selling', 'category': 'Request', 'message': 'A user error has occurred. IAF token supplied is invalid.'}]}
{'errors': [{'errorId': 25002, 'domain': 'API_INVENTORY', 'subdomain': 'Selling', 'category': 'Request', 'message': 'A user error has occurred. IAF token supplied is invalid.'}]}
Message 1 of 1
latest reply
0 REPLIES 0