Skip to main content

Overview

This guide walks you through making your first HTTP API requests to discover terminals, initiate a payment, and check transaction status.
Full schemas and code samples for each call below are in the Terminal Gateway API Reference. Live calls need your assigned endpoint URL and a signed x-signature header.

Prerequisites

Before you begin, ensure you have:

API Credentials

API key and API secret provided by Modulus Labs

HTTP Client

cURL, Postman, or HTTP client library for your language

JSON Parser

Ability to parse JSON responses

Network Access

Outbound HTTPS access to the API endpoint

Quickstart Flow

Step-by-Step Guide

1

Set up authentication

The HTTP API uses HMAC-SHA256 authentication. Each request requires three headers:See the Authentication page for detailed signature computation.
2

Discover available terminals

List all connected terminals in your group:
cURL
Response:
3

Initiate a payment

Send a payment request to a terminal. This endpoint uses long-polling and waits up to 90 seconds for the terminal to respond.
cURL
Successful Response (200 OK):
4

Check transaction status (optional)

If a payment times out or you need to verify status later:
cURL
Response:

Complete Code Examples

Error Handling

Handle common error scenarios:

Recovering from a timeout

A 504 means the gateway did not hear back from the terminal in time, not that the payment failed. The customer may have completed it on the device.
  1. Do not retry the payment immediately - you risk charging twice.
  2. Call GET /v1/transactions/{transactionId} to read the real status.
  3. Only retry when the transaction record’s status is Failed or Cancelled.
Prevent it by checking the terminal is online with GET /v1/terminals before you charge.
Only one payment can be in progress per API key at a time. Starting a second payment with the same API key while one is pending returns 409 PAYMENT_IN_PROGRESS - even if it targets a different terminal. Wait for the first to finish, or use separate API keys for concurrent terminals.

Next Steps

API Reference

Full request and response schemas for every endpoint

Authentication

Detailed HMAC signature guide

Core Concepts

Device enforcement and reconnection

WebSocket API

Real-time terminal events and notifications