Authentication
The Clopos API uses OAuth 2.0 for secure authentication. To interact with the API, submit your credentials to the/auth endpoint to obtain an access token.
Prerequisites
Before you can authenticate you will need:- Client ID: Your application’s unique identifier
- Client Secret: Your application’s secret key
- Brand: The brand identifier you want to access
- Venue ID: The specific venue you want to access
Contact [email protected] to obtain your client credentials.
All Open API requests should use the unified base URL:
https://integrations.clopos.com/open-api/.Authentication Flow
Step 1: Obtain an access token
Send aPOST request to the authentication endpoint:
- Brand:
openapitest - Venue ID:
1 - Client ID:
6553676e0d265ac837e8f79fc - Client Secret:
seCyF_4vja6yddQxE2PlerET0Uhy8ASbJ36hO68PD3JM=
Step 2: Inspect the response
A successful authentication returns:Step 3: Use the token
Important: all API requests (except
/auth) must include the following headers:x-token: Access token from the auth responsex-brand: Brand identifier (for exampleopenapitest)x-venue: Venue ID (for example1)
x-stage: Environment stage, if applicable
Token management
Tokens are valid for 1 hour (3600 seconds). Refresh them before they expire to avoid authentication failures.
Token expiration
- Tokens expire after one hour.
- Once expired, API requests return authentication errors.
- Implement refresh logic in your application.
Best practices
- Store tokens securely — never expose them in client-side code.
- Implement refresh logic — renew tokens automatically before expiry.
- Handle errors gracefully — catch authentication failures and re-authenticate.
- Use HTTPS only — never send credentials over unencrypted connections.
Error handling
Common authentication errors:| Error | Description | Solution |
|---|---|---|
401 Unauthorized | Invalid or expired token | Re-authenticate to obtain a new token |
400 Bad Request | Invalid credentials | Verify client_id, client_secret, brand, and venue_id |
403 Forbidden | Insufficient permissions | Contact support to confirm your access scope |