Skip to main content

Overview

The HTTP API provides three endpoints for terminal and payment management:

Base URL

Replace {your-api-endpoint} with your provisioned API endpoint. Contact support@moduluslabs.io to obtain your endpoint URL.

GET /v1/terminals

Retrieve all active terminals in your group.

Headers

Response (200 OK)

Response Fields

Error Responses

Code Example


POST /v1/terminals//payments

Initiate a payment to a specific terminal. By default, this endpoint uses long-polling and waits up to 90 seconds for the terminal to respond. Alternatively, set webhookMode: true for immediate response with asynchronous notification via webhook.

Path Parameters

string
required
The terminal identifier. Resolved as deviceId first, falling back to connectionId. See Terminal ID Resolution.
The terminalId is resolved as a deviceId first, falling back to connectionId for legacy integrations. See Terminal ID Resolution for details.

Headers

Request Body

string
Unique transaction identifier. Auto-generated if not provided.
string | number
required
Payment amount.
string
required
ISO 4217 currency code (e.g., "USD", "EUR").
string
required
Payment method: "CARD", "CASH", "MOBILE", or "OTHER".
array
Array of products in the transaction.
object
Customer information.
object
Custom key-value pairs for your use.
boolean
default:"false"
When true, disables 90-second long-polling and returns 202 Accepted immediately. The payment result will be delivered via webhook to your configured endpoints. Requires at least one webhook endpoint to be configured.

Request Example

Response (200 OK) - Success

Response (202 Accepted) - Webhook Mode

Returned when webhookMode: true. The payment has been sent to the terminal and results will be delivered via webhook:
When using webhook mode, you must have at least one webhook endpoint configured. The payment result will be delivered to your endpoints as a payment.completed, payment.failed, payment.cancelled, or payment.timeout event.

Response (202 Accepted) - Terminal Disconnected

Returned when the terminal disconnects during payment processing (standard mode only):

Response (504 Gateway Timeout)

Returned when the terminal doesn’t respond within 90 seconds:
After a timeout, always check the transaction status using GET /v1/transactions/{transactionId}. The payment may have completed on the terminal after the HTTP timeout.

Error Responses

Code Example


GET /v1/transactions/

Retrieve the status of a transaction. Useful for reconciliation or checking status after a timeout.

Path Parameters

string
required
The transaction ID to query.

Headers

Response (200 OK)

Response Fields

Transaction Status Values

Error Responses

Code Example


Rate Limiting

The API implements rate limiting to ensure service stability. Current limits are applied per API key. If you exceed rate limits, you’ll receive a 429 Too Many Requests response:
Contact support@moduluslabs.io if you require higher rate limits for your integration.

Troubleshooting

Common causes:
  • Invalid API key or secret
  • System clock not synchronized (timestamp must be within 5 minutes)
  • Incorrect SHA256 body hash computation (must be hex-encoded)
  • String-to-sign format mismatch (check newline characters)
Debug steps:
  1. Verify your API key and secret are correct
  2. Check your system clock is synchronized with NTP
  3. Log the string-to-sign and compare with documentation
  4. Ensure body hash is computed on the exact JSON string sent
What to do after a 504 timeout:
  1. Do not retry the payment immediately
  2. Call GET /v1/transactions/{transactionId} to check actual status
  3. The payment may have completed on the terminal
  4. Only retry if status is FAILED or CANCELLED
Prevention:
  • Verify terminal is online before initiating payments
  • Monitor terminal status with GET /v1/terminals
Causes:
  • Terminal is offline
  • Using wrong terminal ID (connectionId vs deviceId)
  • Terminal in different group
Solutions:
  1. Refresh terminal list with GET /v1/terminals
  2. Use deviceId instead of connectionId
  3. Verify API key matches terminal’s group
Cause: Another payment is already being processed on the terminal.Solution: Wait for the current payment to complete before initiating a new one. Terminals can only process one payment at a time.

Next Steps

Quickstart

Step-by-step integration guide

Webhook Setup

Configure webhook endpoints

Authentication

HMAC signature details

Data Types

Shared data type reference