# Authentication Overview

Learn about the two authentication methods available for integrating with Cheqi.

## Authentication Methods

Cheqi provides two authentication methods to suit different integration scenarios:

### API Keys

Direct company access for merchants managing their own receipts.

[Learn more about API Keys →](/authentication/api-keys)

### OAuth 2.0

Third-party access for POS systems and integrators.

[Learn more about OAuth 2.0 →](/authentication/oauth)

Trusted Partner Bootstrap
Certified partner applications can also use the OAuth 2.0 `client_credentials` flow for bootstrap operations such as company provisioning. This is separate from the standard merchant authorization flow and is only available to approved trusted partners.

## Choosing the Right Method

### Use API Keys When:

- ✅ You are the **merchant** integrating your own POS system
- ✅ You need to **send receipts** from your own systems
- ✅ You manage **multiple store locations** or a **franchise organization**


**Examples:**

- A restaurant owner integrating their own POS system to send digital receipts
- A franchise organization like Domino's managing receipts for all franchise locations from a centralized system


### Use OAuth 2.0 When:

- ✅ You are a **third-party** building an integration for multiple merchants
- ✅ You want merchants to **authorize your application** to start issuing receipts for them
- ✅ You are building a **POS system, accounting software, or marketplace integration**
- ✅ You may need a **trusted partner bootstrap flow** such as company provisioning before merchant claim


**Example:** A POS system provider offering Cheqi integration to all their customers.

## Security Comparison

| Feature | API Keys | OAuth 2.0 |
|  --- | --- | --- |
| **Setup Complexity** | Simple | Moderate |
| **Access Scope** | Full company + child stores | Granular scopes per company |
| **Multi-Store Support** | Yes (parent + all child stores) | Yes (per authorized company) |
| **Merchant Authorization Flow** | N/A (direct company access) | Required per merchant |
| **Token Expiration** | Never (until revoked) | Access tokens expire |
| **Refresh Tokens** | N/A | Yes |
| **Best For** | Direct merchant integration, franchises | Third-party platforms |


## Next Steps

- [Get Started with API Keys](/authentication/api-keys) - Generate your first API key in minutes
- [Implement OAuth 2.0](/authentication/oauth) - Build a third-party integration