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, setwebhookMode: 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 whenwebhookMode: 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: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
Authentication Issues
Authentication Issues
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)
- Verify your API key and secret are correct
- Check your system clock is synchronized with NTP
- Log the string-to-sign and compare with documentation
- Ensure body hash is computed on the exact JSON string sent
Payment Timeouts
Payment Timeouts
What to do after a 504 timeout:
- Do not retry the payment immediately
- Call
GET /v1/transactions/{transactionId}to check actual status - The payment may have completed on the terminal
- Only retry if status is
FAILEDorCANCELLED
- Verify terminal is online before initiating payments
- Monitor terminal status with
GET /v1/terminals
Terminal Not Found
Terminal Not Found
Causes:
- Terminal is offline
- Using wrong terminal ID (connectionId vs deviceId)
- Terminal in different group
- Refresh terminal list with
GET /v1/terminals - Use
deviceIdinstead ofconnectionId - Verify API key matches terminal’s group
Payment In Progress (409)
Payment In Progress (409)
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