Before I allow the customers to use maya payment during checkout, it is important for me to know whether the public and secret keys I entered are correct or not.
What are the api endpoints to verify the api public and secret keys while setting them up in the admin configuration panel?
There is no dedicated API endpoint to validate API keys before making payments. The only way to verify that your public and secret API keys are correct is to make a test API request to any endpoint (e.g., a sandbox endpoint) and observe the response. If the keys are invalid, expired, or incorrectly formatted, Maya will return one of the following authentication errors:
K001: Missing authentication headerK002: Key has expiredK003orK006: Invalid authentication credentials (incorrect key or Base64 encoding)K004: Invalid endpoint (wrong key type or URL)
To validate your keys:
- Use the public key (
pk-...) or secret key (sk-...) as the username in Basic Authentication (with blank password). - Encode the string
your_api_key:in Base64. - Include it in the
Authorizationheader asBasic <encoded_string>. - Send a request to a known endpoint (e.g., a sandbox endpoint for Maya Checkout).
- If you receive a 200 OK response, your keys are valid. If you receive a 401 error, check your key format, encoding, and environment (Sandbox vs Production).
Refer to the Authentication and API Key Errors guide for detailed error handling.
For Sandbox concerns and other technical implementation inquiries, please get in touch with us via:
- Sandbox Health Page: Check real-time service status updates.
- Maya Developer Hub Service Desk: File
a ticket in Sandbox.
To Know More:
We value your input and would love to hear your insights. Please submit you feedback here.
The public key can be checked using the checkout endpoint with a dummy payload, but what about the secret key? How can the secret key be authenticated before allowing users to make a payment using the Maya payment method?
The secret API key can be validated by using it in an API that needs a secret API key.
Or as the Maya Manager administrator, you can just check the API keys settings page in your Maya Manager, to visually check if the public (or secret) API key is generated under the merchant account enabled for a specific Maya product/solution. Thanks