Scan your whole stack
From OX Research Newsroom
Are you using paymos-sdk?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.7.3
paymos-sdk was last scanned on 30 Nov 2026 at version 1.7.3. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.7.3 LATEST | 30 Nov 2026 | No rules fired |
| 1.7.2 | 22 Nov 2026 | No rules fired |
| 1.7.1 | 17 Nov 2026 | No rules fired |
| 1.7.0 | 16 Nov 2026 | Not shown |
| 1.6.1 | 13 Nov 2026 | Not shown |
Findings for v1.7.3. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.7.3; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
English | 简体中文 | Русский | Español | Deutsch | Türkçe
Official Python 3.10+ client for the Paymos Merchant API. It includes HMAC request signing, invoices, withdrawals, balances, static per-customer wallets and their deposit feed, bounded cursor iterators, structured errors, safe retries, and raw-body webhook verification.
Video walkthrough (1:22, subtitles in 6 languages): Watch on YouTube
pip install paymos-sdk
import os
from paymos import InvoiceProduct, Paymos
paymos = Paymos(
api_key=os.environ["PAYMOS_API_KEY"],
api_secret=os.environ["PAYMOS_API_SECRET"],
)
# Compatible amount-only call (products omitted or None)
invoice = paymos.invoices.create(
project_id="prj_...",
amount="10.00",
currency="USD",
external_order_id="order_123",
)
Use decimal strings for money.
products[])Pass an optional sequence of InvoiceProduct dicts (1..50 items) via products to show line items on hosted checkout, or omit products / pass products=None for a compatible amount-only invoice. Each item requires title (\<= 200 Unicode scalar values), positive int32 quantity, and decimal string unit_amount (in the invoice currency); description (plain text, \<= 2000 scalars) is optional and nullable and is omitted on the wire when None.
# 1-item invoice with optional description
single_item: InvoiceProduct = {
"title": "Studio Pro",
"description": "One-month access",
"quantity": 2,
"unit_amount": "24.50",
}
single_invoice = paymos.invoices.create(
project_id="prj_...",
amount="47.00",
currency="USD",
external_order_id="order_product_single",
products=[single_item],
)
# Multi-item cart including a minimal 3-field item (no description)
cart_invoice = paymos.invoices.create(
project_id="prj_...",
amount="59.00",
currency="USD",
external_order_id="order_product_multi",
products=[
single_item,
{"title": "Priority Support", "quantity": 1, "unit_amount": "12.00"},
],
)
for item in cart_invoice["order"].get("products", []):
print(item["title"], item["quantity"], item["unit_amount"])
amount: amount is the exact order total and is never recomputed from sum(quantity * unit_amount).order["products"] on the invoice. Retrying the same external_order_id with the same (amount, currency, network) returns HTTP 200 with the original invoice and original order["products"] even if products changed; changing (amount, currency, network) raises ConflictError (409 invoice_idempotency_conflict). Legacy and amount-only invoices omit order["products"].products.list() returns one cursor page; iterate()
follows cursors lazily and stops after 100 pages by default.
for invoice in paymos.invoices.iterate(status=["paid", "paid_over"], max_pages=10):
print(invoice["invoice_id"])
A payment channel is one payer's reusable set of deposit addresses. Create it, read its rails, then poll the confirmed-deposit feed and persist the cursor:
channel = paymos.payment_channels.create(project_id="prj_...", external_id="customer_42")
for rail in channel["networks"]:
print(rail["network"], rail["status"], rail.get("address", "not provisioned yet"))
feed = paymos.payment_channel_deposits.read(cursor=saved_cursor, limit=100)
for deposit in feed["items"]:
credit_deposit(deposit) # one credit per deposit["id"], see below
save_cursor(feed["next_cursor"])
The feed and the deposit webhook report the same deposits, so both go through one
credit_deposit keyed by the deposit's own id (pcd_...). A sketch with a SQL store
(credited_deposits.deposit_id is the primary key; PostgreSQL syntax):
def credit_deposit(deposit):
if not deposit["is_final"] or deposit["project_id"] != MY_PROJECT_ID or deposit["is_test"] != MY_IS_TEST:
return
with db.transaction() as tx:
# The insert and the balance update commit together or not at all. A second
# delivery, a second endpoint's copy, or a re-read feed page inserts nothing.
inserted = tx.execute(
"INSERT INTO credited_deposits (deposit_id, payer, amount) VALUES (%s, %s, %s::numeric)"
" ON CONFLICT (deposit_id) DO NOTHING",
(deposit["id"], deposit["payment_channel_external_id"], deposit["net"]),
)
if inserted.rowcount == 1:
tx.execute(
"UPDATE balances SET amount = amount + %s::numeric WHERE payer = %s",
(deposit["net"], deposit["payment_channel_external_id"]),
)
Four things that bite a caller who guesses. Repeating the same external_id
returns the same channel — 200 instead of 201, and both bodies are a
channel, so calling this on every checkout is safe: a repeat is not a duplicate
and not an error. A rail's address is absent until that rail finishes
provisioning and never changes once it appears, so absent means "not yet", not
"no address". An absent minimum_deposit means "we cannot quote a minimum right
now", never "there is no minimum" — reading it as zero is how a merchant accepts
a deposit that lands below the live minimum and is never credited. And
next_cursor is never empty, not even on a page with no items: store it and
resume from it, and never loop until it is falsy the way iterate() ends a
list, because that loop either spins forever or stops on the first quiet page
and leaves reconciliation silently behind. confirmed_from is the first poll's
lower bound only; afterwards the stored cursor is the resume mechanism.
API failures raise typed subclasses of ApiError and preserve the HTTP status,
problem details, field, error code, headers, and Retry-After value. The default
transport does not follow redirects: a signed request is sent only to base_url, and a
3xx answer raises ApiError with that status. timeout (seconds, default 30) bounds each
blocking socket operation — connecting and every read — not the whole request: a server that keeps
sending slowly can make one attempt last longer than timeout. Retries add their own attempts.
Verify webhooks against the exact raw request body before parsing it:
from paymos import WebhookVerifier
event = WebhookVerifier(os.environ["PAYMOS_WEBHOOK_SECRET"]).construct_event(
request.headers["X-Webhook-Signature"], request.get_data()
)
The three payment_channel.deposit.* events each carry a full payment-channel deposit as
their data. construct_event returns it untyped, so bind it to PaymentChannelDeposit
yourself:
from typing import cast
from paymos import PaymentChannelDeposit
if event["event_type"] == "payment_channel.deposit.confirmed":
deposit = cast(PaymentChannelDeposit, event["data"])
if deposit["is_final"]:
credit_deposit(deposit) # once per deposit["id"], shared with the feed
event["event_id"] identifies one delivery, not one payment. Paymos creates a separate
event, with its own event_id, for every webhook endpoint subscribed to the event, and
every later event about the same invoice or deposit has its own event_id too. Store
event_id to skip a redelivered request, but key money and fulfilment on the business
identity: the invoice/order (data["invoice_id"], data["order"]["external_id"]) for
invoice events, the deposit id for deposit events. Write that key in the same database
transaction as the order or balance change.
confirming and reorged are advisory and may arrive out of order — a confirming can
land after the confirmed for the same deposit, and a reorged can be superseded by a
later confirmed. Credit only on payment_channel.deposit.confirmed with is_final true,
and never let an advisory event regress a deposit already known to be confirmed: crediting
on confirming releases goods against money a reorg can still take back.
Never use the API secret in browser or mobile code. Full documentation: https://paymos.io/docs/server-sdks
A 401 means the credential is absent, malformed or unverifiable — fix the key or the signing clock, and stop retrying.
A 403 means the credential was accepted and something else refused. It covers two very different situations:
payout_key_required, payment_key_required,
forbidden;whitelist_required,
merchant_suspended, widget_inactive, terminal_not_enabled, not_sandbox.A customer entering a payout address that is not whitelisted yet is the second kind: nothing is
wrong with your credentials, and paging the on-call engineer about them is the wrong move. Always
switch on the error code before deciding what to do.
PermissionError subclasses AuthenticationError, so except AuthenticationError written
before this split keeps catching 403.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.