Authentication Guide

This guide covers the authentication methods available for integrating with the E-Invoicing API. There are two main authentication methods, each with different requirements and use cases.

1. Direct Integration Authentication Method

Overview

Direct Authentication uses the OAuth 2.0 Client Credentials flow, which is suitable for server-to-server communication where your application acts on its own behalf. Use Case: When your application directly manages your own invoices. Authentication Method: OAuth 2.0 Client Credentials Flow

Authentication Flow

  1. Register Application: Get client credentials from the developer portal
  2. Request Access Token: Use client credentials to obtain an access token
  3. Make API Calls: Include the access token in API requests
  4. Refresh Token: Renew the access token before expiration

Step 1: Get Access Token

Step 2: Use Access Token

2. On Behalf Integration (Delegated) Authentication Method

Overview

On Behalf Authentication uses a combination of Client Credentials (for Resource APIs) and Authorization Code flow (for Invoice APIs). This allows your application to act on behalf of multiple businesses with their explicit consent. Use Case: When your application manages invoices on behalf of multiple tax payers. Authentication Method:
  • OAuth 2.0 Client Credentials Flow (for Resource APIs)
  • OAuth 2.0 Authorization Code Flow (for Invoice APIs)

Authentication Flow

  1. Invoice APIs: Use Authorization Code flow with user consent
  2. User Authorization: Redirect users to authorization endpoint
  3. Exchange Code: Exchange authorization code for access token
  4. Make API Calls: Use appropriate token for each API type

Step 1: Redirect User for Authorization (Invoice APIs)

Step 2: Handle Authorization Callback

Step 3: Use Token to call API

Token Management

Access Token Expiration

Both authentication methods use access tokens that expire after a certain period (typically 1 hour). Implement proper token refresh logic:

Next Steps

Now that you understand the authentication methods, explore these related topics: