LOOMAL
SDK / API ReferencePayments

Get Payment

Fetch a single payment with the signed receipt

Scope: payments:accept

Returns a single payment row including the full Ed25519 receipt — the seller-issued proof that the payment happened.

Request

import { Loomal } from "@loomal/sdk";

const loomal = new Loomal({ apiKey: process.env.LOOMAL_API_KEY! });
const payment = await loomal.payments.get("cmoh...");
import os
from loomal import Loomal

loomal = Loomal(api_key=os.environ["LOOMAL_API_KEY"])
payment = loomal.payments.get("cmoh...")
curl https://api.loomal.ai/v0/payments/cmoh... \
  -H "Authorization: Bearer loid-your-api-key"

Response — 200 OK

{
  "id": "cmoh…",
  "endpointId": "se_abc123",
  "network": "base",
  "payerAddress": "0x<buyer-eoa-address>",
  "recipientAddress": "0x<your-identity-wallet-address>",
  "amountUsdcRaw": "50000",
  "authorizationNonce": "0x<32-byte-hex>",
  "txHash": "0x<onchain-settle-tx-hash>",
  "status": "settled",
  "resourceUrl": "https://your-api.com/search",
  "failureReason": null,
  "createdAt": "2026-04-28T12:34:56.789Z",
  "settledAt": "2026-04-28T12:34:57.123Z",
  "signedReceipt": {
    "body": {
      "version": 1,
      "paymentInId": "cmoh…",
      "endpointId": "se_abc123",
      "identityId": "id-…",
      "payerAddress": "0x<buyer-eoa-address>",
      "recipientAddress": "0x<your-identity-wallet-address>",
      "amountUsdcRaw": "50000",
      "network": "base",
      "txHash": "0x<onchain-settle-tx-hash>",
      "timestamp": "2026-04-28T12:34:57.000Z"
    },
    "signature": "<base64 Ed25519 signature>",
    "publicKey": "z6Mk…",
    "did": "did:web:loomal.ai:identities:id-…"
  }
}

Verifying the receipt

The receipt's signature is over a canonical JSON serialization of body, signed with the Identity's Ed25519 DID key. Verify with:

import nacl from "tweetnacl"
import canonicalize from "canonicalize"
import { decodeBase58btc } from "multiformats/bases/base58"

// publicKey is multibase-encoded (z…). Strip prefix byte (0xed01 for Ed25519) before nacl.verify.
const pubBytes = decodeBase58btc(receipt.publicKey).slice(2)
const sigBytes = Buffer.from(receipt.signature, "base64")
const msgBytes = new TextEncoder().encode(canonicalize(receipt.body))
const ok = nacl.sign.detached.verify(msgBytes, sigBytes, pubBytes)

Or in MCP-land, use the identity.verify tool.

Errors

StatusCause
401Missing or invalid Authorization
403API key lacks payments:accept scope
404No payment with that ID owned by this Identity

On this page