API Key Types
Paymenter supports two types of authentication:Admin API Keys
Admin API keys provide access to the/api/v1/admin/* endpoints and allow you to:
- Manage users, products, services, orders, invoices, and tickets
- Perform administrative operations
- Access all data across your Paymenter instance
OAuth 2.0 (User Profile Access)
OAuth 2.0 is available for user profile access with limited scopes:- profile: View user profile information
Creating an API Key
- Log in to your Paymenter admin panel
- Navigate to Settings → API Keys
- Click Create API Key
- Configure your API key:
- Name: A descriptive name for identification
- Type: Select “Admin” for full API access
- Permissions: Select specific resource permissions
- IP Addresses (optional): Restrict access to specific IPs
- Save and securely store the generated API key
The API key is only shown once during creation. Store it securely - you won’t be able to retrieve it later.
Using API Keys
Include your API key in theAuthorization header using Bearer token authentication:
API Key Permissions
API keys can be configured with granular permissions for specific resources:users.view- View usersusers.create- Create usersusers.update- Update usersusers.delete- Delete usersproducts.view- View productsservices.view- View servicesservices.create- Create servicesservices.update- Update servicesservices.delete- Delete servicesorders.view- View ordersorders.create- Create ordersorders.update- Update ordersorders.delete- Delete ordersinvoices.view- View invoicesinvoices.create- Create invoicesinvoices.update- Update invoicesinvoices.delete- Delete invoicestickets.view- View ticketstickets.create- Create ticketstickets.update- Update ticketstickets.delete- Delete tickets
When using
include parameters, ensure your API key has view permissions for the related resources.OAuth 2.0 Flow
For user-level access with OAuth 2.0:Step 1: Obtain Access Token
Request an access token using the password grant:Step 2: Access User Profile
Use the access token to retrieve user profile information:The
/api/me endpoint requires the profile scope and only returns the authenticated user’s data.IP Whitelisting
For enhanced security, restrict API keys to specific IP addresses:- When creating an API key, add allowed IP addresses
- Requests from other IPs will be rejected with a
403 Forbiddenresponse
IP Restriction Error
Security Best Practices
- Never commit API keys to version control - Use environment variables or secret management systems
- Use IP whitelisting - Restrict API keys to known server IPs when possible
- Apply least privilege - Grant only necessary permissions
- Rotate keys regularly - Create new API keys and revoke old ones periodically
- Monitor usage - Review API key activity in the admin panel
- Disable unused keys - Deactivate API keys that are no longer needed
Common Authentication Errors
Missing Bearer Token (401)
Authorization header with your API key.