Skip to main content

Overview

The Ecom API lets you create hosted payment links — shareable checkout URLs that collect payments online. Create a link, send your customer the hosted_url, and Modulus hosts the checkout page, processes the payment, and notifies you through webhooks.

Authentication

Learn how to authenticate with API keys and understand entity scoping

API Reference

Explore all available endpoints

Webhooks

Receive real-time payment events on your endpoint

Rate Limits

Review per-endpoint rate limits and idempotency rules
Errors return the format { "error": { "code": "...", "message": "...", "correlationId": "..." } }. Common codes include invalid_request (400), invalid_api_key (401), insufficient_permissions (403), not_found (404), idempotency_mismatch (409), invalid_state (422), and rate_limited (429). Each endpoint’s reference page lists the codes it can return.

Base URL

All requests are made against the sandbox base URL:
https://api.sbx.moduluslabs.io/ecom/v1
TypeBehavior
one_timeAccepts exactly one successful payment, then becomes CONSUMED.
multi_useAccepts multiple payments, optionally up to a configured max_uses.

Lifecycle

A payment link moves through the following statuses:
StatusMeaning
ACTIVEThe link is accepting payments.
CONSUMEDThe link has reached its usage limit.
EXPIREDThe link has passed its expires_at time.
CANCELLEDThe link was manually cancelled.

How it works

1

Create a payment link

Call Create a Payment Link with the amount, line items, and an expires_at. You receive a hosted_url.
2

Share the hosted URL

Send the hosted_url to your customer. They complete payment on the Modulus-hosted checkout page.
3

Receive a webhook

Modulus sends a payment.succeeded (or payment.declined / payment.failed) event to your configured endpoint. See Webhooks.
4

Reconcile

Use the order_reference and metadata you set at creation to match the payment to your records.

Working with amounts

All monetary values are integers in the smallest currency unit (centavos for PHP). For example, 150000 represents PHP 1,500.00. The link amount must equal the sum of all line items (unit_price × quantity).
This documentation targets the sandbox environment. Use sk_test_ keys to test the full flow — no real money is moved.