Normative shapes for lendpay-backend consumers (lendpay-app, automation, etc.). Errors use JSON with at least error (string) and usually code (string).
Base path in production is typically the App Runner / reverse-proxy origin (no trailing slash).
200 — liveness.
{
"status": "ok",
"service": "paid-workflow-gateway"
}200 — readiness metadata (always 200; inspect checks for configuration state).
{
"status": "ready",
"service": "paid-workflow-gateway",
"checks": {
"x402PayeeConfigured": true,
"settlementKeyConfigured": true
}
}x402PayeeConfigured:X402_RECEIVING_ADDRESSmatches0x+ 40 hex.settlementKeyConfigured:BASE_SETTLEMENT_PRIVATE_KEYmatches0x+ 64 hex.
200 — JSON array of workflow definitions (id, name, description, paymentMinUsd, paymentMaxUsd, requiredFields). Listed workflows include at least: simple-workflow, og-beta-signup, og-paid-beta-signup, lendpay-paid-beta-signup, claimlayer-paid-claimall.
Path: workflowId must match a listed workflow id (see GET /workflows). 404 with code: "WORKFLOW_NOT_FOUND" if unknown.
Headers
Content-Type: application/jsonX-PAYMENTorPAYMENT-SIGNATURE: x402 v2 payment payload when payment is required / supplied.Authorization: optionalBearer <KeeperHub API key>(elseDEFAULT_KEEPERHUB_API_KEYfrom env for dev).
Body / parameters — depends on workflowId:
| Field | Type | Notes |
|---|---|---|
chain |
string | e.g. algorand |
protocol |
string | e.g. dorkfi |
action |
string | e.g. repay |
targetAddress |
string | EVM (0x + 40 hex) or 58-char Algorand |
benefactorAddress |
string | EVM (0x + 40 hex) or 58-char Algorand |
asset |
string | e.g. USDC |
amount |
string | USD decimal within workflow min/max |
triggerData |
object | marketAppId, assetId, poolId (positive ints); optional underlyingAssetId |
| Field | Type | Notes |
|---|---|---|
email |
string | valid email |
discord |
string | required |
network |
string | required |
projectName |
string | required |
governanceToken |
string | required |
amount |
string | USD (fixed band for this workflow) |
Pass email, discord, network, projectName, governanceToken, amount (USD) as query parameters so they bind to the x402 resource.url. JSON body is ignored; payer EVM address comes from the verified x402 payment.
Pass email, discord, telegram, baseAddress (0x + 40 hex), algorandAddress (58-char Algorand), amount (USD) as query parameters (same x402 resource.url pattern as og-paid-beta-signup).
Hits
GET /workflows— workflow appears in the list (id:claimlayer-paid-claimall).POST /workflows/claimlayer-paid-claimall/execute— execute with JSON body and optional x402 payment headers (same rules asPOST /workflows/:workflowId/executeabove).
x402 resource.url (e.g. on 400 PAYMENT_REQUIRED): canonical payment resource is https://<origin>/workflows/claimlayer-paid-claimall/execute with no query string; parameters stay in the JSON body, not on the URL (unlike og-paid-beta-signup / lendpay-paid-beta-signup).
JSON body
| Field | Type | Notes |
|---|---|---|
paymentAddress |
string | EVM (0x + 40 hex) or 58-char Algorand |
address |
string | optional; EVM or 58-char Algorand — if present, sent to KeeperHub as targetAddress (preferred over body targetAddress when both are sent) |
targetAddress |
string | optional if address is set; EVM (0x + 40 hex) or 58-char Algorand |
chain |
string | chain id or label for the payment leg (e.g. eip155:8453) |
targetChain |
string | chain id or label for the claim target |
amount |
string | USD decimal within workflow min/max |
txid |
string | optional; ignored — gateway sets settlement txid after payment |
Responses (selection)
| Status | code (when present) |
Meaning |
|---|---|---|
| 200 | — | success, workflowId, executionId, status: "submitted", settlement |
| 404 | WORKFLOW_NOT_FOUND |
Unknown workflowId |
| 400 | VALIDATION_ERROR |
Body or query failed validation; details.fieldErrors |
| 400 | AMOUNT_OUT_OF_RANGE |
amount outside USD bounds |
| 400 | PAYMENT_REQUIRED |
Missing payment header; includes x402Version, resource, accepts |
| 402 | PAYMENT_INVALID |
x402 verification failed |
| 503 | MISCONFIGURED |
Missing/invalid x402 payee env |
| 503 | SETTLEMENT_MISCONFIGURED |
Missing/invalid relayer key |
| 502 | SETTLEMENT_FAILED |
On-chain settlement error |
| 5xx | KEEPERHUB_* / INTERNAL_ERROR |
Downstream / unexpected |