Authentication with API keys
The Pricer API uses API keys to authenticate requests. You can view and manage your API keys from the Pricer Home portal.
You'll need to authenticate your requests to access any of our endpoints. In this guide, we'll look at how authentication works. Your API keys can carry one or several permissions, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
authenticate with API key
With the API key you can request a bearer token to use in API calls.
Python example: Request token with API key
import requests
# Define the endpoint URL
url = "https://iam.stage.pricer-plaza.com/api/v1/oauth/token"
# Define headers with the required information
headers = {
"Access-Key": "your_access_key_value", # Replace with your actual API key
"X-Pricer-Transaction-Id": "your_transaction_id_value", # Replace with actual transaction id
"X-Pricer-Client-Id": "your_client_id_value" # Replace with actual client id
}
# Make the GET request
response = requests.get(url, headers=headers)
# Print the response status code and content
print("Status Code:", response.status_code)
print("Response Content:", response.text)
API call with bearer token
Example request with bearer token
curl https://store.pricer-plaza.com/api/v1/stores \
-H "Authorization: Bearer {token}"
Regenerate an API key
Always keep your API key safe and reset it if you suspect it has been compromised.
Reset your access-key
import requests
# Define the endpoint URL
url = "https://iam.pricer-plaza.com/api/v1/access-keys/{id}/regenerate"
# Define headers with the required information
headers = {
"id": "your_access_key_value", # Replace with your current access key
"X-Pricer-Transaction-Id": "your_transaction_id_value", # Replace with actual transaction id
"X-Pricer-Client-Id": "your_client_id_value" # Replace with actual client id
}
# Make the GET request
response = requests.get(url, headers=headers)
# Print the response status code and content
print("Status Code:", response.status_code)
print("Response Content:", response.text)