Skip to main content

Overview

The Terminal Gateway enables communication between your POS (Point of Sale) system and payment terminals. Choose between two protocols based on your integration needs:
  • HTTP API - Synchronous request/response pattern with long-polling for payments
  • WebSocket API - Real-time bidirectional communication with push notifications
Version 1.0 - This documentation covers the current Terminal Gateway API. Contact support@moduluslabs.io to obtain your endpoint URL and credentials.

Protocol Comparison

FeatureHTTP APIWebSocket API
CommunicationRequest/response (synchronous)Bidirectional (asynchronous)
ConnectionStateless, per-requestPersistent connection
Payment flowLong-polling (up to 90 seconds)Push notification on completion
Terminal discoveryPoll GET /terminalsReal-time terminalStatusUpdate events
Best forSimple integrations, serverlessReal-time dashboards, multi-terminal management
AuthenticationHMAC-SHA256 per requestAPI key at connection time
ComplexityLowerHigher

Choosing a Protocol

HTTP API

Choose HTTP if you need:
  • Simple request/response pattern
  • Serverless or stateless architecture
  • Minimal client-side complexity
  • Occasional terminal interactions

WebSocket API

Choose WebSocket if you need:
  • Real-time terminal status updates
  • Instant payment notifications
  • Multi-terminal management
  • Persistent connection with push events

API Endpoints

https://{your-api-endpoint}/v1
EndpointDescription
GET /v1/terminalsList available terminals
POST /v1/terminals/{terminalId}/paymentsInitiate a payment
GET /v1/transactions/{transactionId}Check transaction status

Quick Start

1

Obtain API credentials

Contact support@moduluslabs.io to request API credentials. You will receive an API key and API secret pair.
2

Choose your protocol

Select HTTP for simple integrations or WebSocket for real-time features. See the protocol comparison above.
3

Follow the quick start guide

HTTP Quick Start

Get started with HTTP API

WebSocket Quick Start

Get started with WebSocket API

Core Concepts

Both protocols share these core concepts:

Single Device Enforcement

One active connection per API key for security

Reconnection Resilience

60-second grace period for terminal reconnections during payments

Authentication

API key provisioning and authentication methods

Data Types

Shared schemas for payments, terminals, and errors

Documentation Structure

HTTP API

WebSocket API

Support

For technical support or questions about the Terminal Gateway:
  • Email: support@moduluslabs.io
  • Documentation: Browse the pages in this section for detailed implementation guides