woocommerce / woocommerce/wc-api-python
Fetching 'products' fails with a 403 error despite other successful API calls
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 216
- Forks
- 108
- Avg merge
- 6h 34m
- Merged PRs (30d)
- 1
Description
Hello! Thanks for this library, though I'm having a little trouble retrieving products specifically. I have no trouble retrieving e.g. orders and customers.
This works:
import os
from woocommerce import API
WOOCOMMERCE_API_CONSUMER_KEY = os.environ.get('WOOCOMMERCE_API_CONSUMER_KEY')
WOOCOMMERCE_API_CONSUMER_SECRET = os.environ.get('WOOCOMMERCE_API_CONSUMER_SECRET') # noqa
wcapi = API(
url='https://xxxxxxxx.org',
consumer_key=WOOCOMMERCE_API_CONSUMER_KEY,
consumer_secret=WOOCOMMERCE_API_CONSUMER_SECRET,
version='wc/v3',
user_agent='PostmanRuntime/7.26.5'
)
data = wcapi.get('orders')
# data = wcapi.get('customers')
print(data.status_code)
Trying wcapi.get('products'), however, throws a 403 status code:
import os
from woocommerce import API
WOOCOMMERCE_API_CONSUMER_KEY = os.environ.get('WOOCOMMERCE_API_CONSUMER_KEY')
WOOCOMMERCE_API_CONSUMER_SECRET = os.environ.get('WOOCOMMERCE_API_CONSUMER_SECRET') # noqa
wcapi = API(
url='https://xxxxxxxx.org',
consumer_key=WOOCOMMERCE_API_CONSUMER_KEY,
consumer_secret=WOOCOMMERCE_API_CONSUMER_SECRET,
version='wc/v3',
user_agent='PostmanRuntime/7.26.5'
)
data = wcapi.get('products')
print(data.status_code)
Any help is much appreciated, thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository files or tests are named. Start by running the provided Python examples and comparing the requests and 403 response for products with the successful orders and customers calls; done means establishing whether the wrapper or the WooCommerce endpoint causes the failure and documenting a reproducible next step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100