Why is my API request rejected with an authentication error?
Usually the access token has expired or the signature doesn't match what we calculate. Check these in order.
- If the access token has expired, get a new one from the refresh-token endpoint using your refresh token. If the refresh token has expired too, check the authentication guide, or email support@pexx.com.
- Check the timestamp is the current Unix time in seconds, not milliseconds, and that your server clock is correct.
- Use a new nonce for every request. A nonce you've already used is rejected.
- Hash the request body exactly as the guide describes, and use the same access token in the string you sign as in the authorisation header.
- Check you're using keys for the right environment: sandbox keys don't work in production.
If it still fails, email support@pexx.com with your business name, the endpoint and the X-Trace-Id value from the response header. Never send your private key or secret key.