Developer Preview · Test and pilot use only · View program boundaries
V VelarumPay Docs
REST API v1

REST API reference

The official testnet origin is https://api-testnet.velarumpay.com; local contract tests may use http://127.0.0.1:8787. All API paths below are prefixed with /v1.

Download the canonical OpenAPI 3.1 document. Legacy /v1/payment-intents and OpenClaw-specific routes are migration-only and are not part of this public contract.

Authentication

Credentials are separated by caller and purpose:

CallerCredentialHow to send
Merchant operatorHttpOnly merchant session + CSRF proofSame-origin cookie; X-CSRF-Token on mutations.
Registered AgentShort Agent tokenAuthorization: Bearer <agent-token>; currently used for authenticated Connect claim.
Connected AgentConnection tokenAuthorization: Bearer <connection-token> for scoped context and Payment Request calls.
Connect claimantShort claim tokenBearer token only on invitation detail and exchange.
Wallet appApp device tokendevice_id + token in the body (or query for GET)

Never place merchant_id, tenant_id, or self-declared Agent identity in a request to obtain authorization. The API derives tenant and actor identity from the verified credential.

Idempotency: send X-Idempotency-Key (or idempotency_key in the body) when creating payment requests so retries never double-charge.

Pairing & connections

MethodPathWhoPurpose
POST/v1/pairing/sessionsAgentStart a pairing session; returns a short code + velarumpay://pair?... URI.
GET/v1/pairing/sessions/:idAgentCheck pairing status (pass ?code=).
POST/v1/pairing/sessions/:id/approveWalletApprove scopes; returns the connection token.
POST/v1/pairing/sessions/:id/rejectWalletReject the pairing request.
GET/v1/connectionsWalletList connections for a device.
PATCH/v1/connections/:idWalletPause or re-activate a connection.
DELETE/v1/connections/:idWalletRevoke a connection.
POST/v1/connections/:id/rotate-tokenWalletRotate the connection token.

Merchant control plane

MethodPathPurpose
POST/v1/merchant-accounts/registrationsStart enumeration-safe email registration.
POST/v1/merchantsConsume the email-verification session grant and create an organization.
POST/v1/merchant-sessionsConsume the next one-time grant and issue an HttpOnly session plus CSRF proof.
POST/v1/merchant-domainsRegister an exact DNS/HTTPS verification challenge.
POST/v1/recipientsCreate a versioned Recipient; verify and activate before payments.
POST/v1/agentsRegister an Agent and its allowed scopes.
POST/v1/agents/{agentId}/credentialsRegister an Ed25519 public credential; activate it with the returned proof challenge.
POST/v1/webhook-endpointsCreate a signed Webhook endpoint; generated secret is shown once.
GET/v1/webhook-deliveriesInspect tenant-scoped delivery attempts without response bodies or secrets.

Agent Auth and Connect

MethodPathCredential
POST/v1/agent-auth/tokenLocally signed Agent Assertion.
POST/v1/connect-invitations/claimShort Agent token.
GET/v1/connect-invitations/{id}Connect claim token or authenticated wallet.
POST/v1/connect-invitations/{id}/exchangeConnect claim token after wallet approval.

Payments & context

MethodPathWhoPurpose
POST/v1/transaction-contextsAgentCreate the human-readable review context. Scope: transaction_contexts.create.
GET/v1/transaction-contexts/:transaction_idAgentRead the latest context. Scope: transaction_contexts.read.
POST/v1/payment-requestsAgentCreate a payment request. Scope: payment.requests.create.
GET/v1/payment-requests/:idAgentRead one payment request. Scope: payment.requests.read.
GET/v1/payment-requests/eventsAgentPoll status events (pass ?since=).
POST/v1/payment-requests/:id/statusWalletReport a status transition.

Operations

MethodPathPurpose
GET/healthLiveness check (used by Docker / load balancer).
GET/metricsPrometheus metrics (token-protected if configured).

Example: create a payment request

curl -X POST https://api-testnet.velarumpay.com/v1/payment-requests \
  -H "Authorization: Bearer $VELARUMPAY_CONNECTION_TOKEN" \
  -H "X-Idempotency-Key: demo-payment-1" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient_id": "recipient_test_0001",
    "recipient_version_id": "recipient_version_test_0001",
    "payment": {
      "amount": "1.00"
    },
    "policy": { "requires_user_approval": true }
  }'
Recipient network, asset, address, memo, contract, and issuer are server-derived from the active verified Recipient version. The response remains pending until the wallet user approves and signs locally.

Errors

Failures return ok: false with a structured error object (code, a human message, request_id, and field when relevant). Risk and validation problems list every issue so you can fix them in one pass. A retry must retain the same idempotency key and request intent.