Env: Demo APIs (testnet defaults)
- `buyerSessionId` can be omitted when demo cookie session is present.
- `amount` must be positive decimal notation.
curl -X POST '/api/demo/intents' \
-H 'Content-Type: application/json' \
-d '{"buyerSessionId":"buyer_...","serviceId":"movie tickets","amount":"2","settlementChain":"fast"}'Example success response
{
"intent": {
"intentId": "intent_...",
"status": "pending_payment",
"paymentLink": "https://example.local/merchant-dashboard/checkout?intentId=intent_...",
"paymentLinkAgent": "https://example.local/api/pay?..."
},
"session": {
"sessionId": "buyer_...",
"addressFast": "0x..."
}
}Example failure responses
HTTP 400
{
"error": "Amount is required."
}Recovery: Provide a positive decimal amount.
HTTP 400
{
"error": "Settlement chain must be one of: fast, arbitrum-sepolia."
}Recovery: Use a supported settlement chain value.
HTTP 404
{
"error": "Buyer session not found. Create a session first."
}Recovery: Refresh buyer session and retry.
- Use the latest active intent ID.
- Verifier advances status to settled after payment detection.
curl -X POST '/api/demo/intents/:intentId/pay' \
-H 'Content-Type: application/json' \
-d '{"amount":"2"}'Example success response
{
"intent": {
"intentId": ":intentId",
"status": "source_paid",
"sourceTxHash": "0x..."
},
"session": {
"sessionId": "buyer_..."
}
}Example failure responses
HTTP 400
{
"error": "Payment link expired."
}Recovery: Create a new intent.
HTTP 404
{
"error": "Payment intent not found."
}Recovery: Verify the `intentId`.
- Requires settled status.
- Transitions intent to delivered.
curl -X POST '/api/demo/intents/:intentId/deliver' \
-H 'Content-Type: application/json' \
-d '{}'Example success response
{
"intent": {
"intentId": ":intentId",
"status": "delivered",
"deliveredAt": "2026-01-01T00:00:00.000Z"
}
}Example failure responses
HTTP 400
{
"error": "Intent must be settled before delivery."
}Recovery: Wait for settled status before calling deliver.
HTTP 404
{
"error": "Payment intent not found."
}Recovery: Verify the `intentId`.