Overview
This guide walks you through making your first HTTP API requests to discover terminals, initiate a payment, and check transaction status.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:Response:
cURL
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.Successful Response (200 OK):
cURL
4
Check transaction status (optional)
If a payment times out or you need to verify status later:Response:
cURL
Complete Code Examples
Error Handling
Handle common error scenarios:Authentication Errors (401)
Authentication Errors (401)
Terminal Errors (404, 503)
Terminal Errors (404, 503)
Payment Errors (409, 504)
Payment Errors (409, 504)
Recovering from a timeout
A504 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.
- Do not retry the payment immediately - you risk charging twice.
- Call
GET /v1/transactions/{transactionId}to read the real status. - Only retry when the transaction record’s status is
FailedorCancelled.
GET /v1/terminals before you charge.
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