You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -41,6 +42,12 @@ signs a Stacks transaction and retries with the payment signature.
41
42
42
43
This API supports x402 v2 (Coinbase-compatible) with Stacks blockchain payments.
43
44
45
+
Canonical public payment lifecycle:
46
+
- \`${PAYMENT_PUBLIC_LIFECYCLE}\`
47
+
- \`submitted\` is never caller-facing
48
+
- relay-owned \`paymentId\` is the stable in-flight identity
49
+
- this service keeps immediate pay-per-call behavior during rollout, but any surfaced payment status follows the canonical lifecycle and may include \`checkStatusUrl\`
- \`submitted\` is internal relay observability only and is never caller-facing
201
+
- \`paymentId\` is relay-owned and stays stable while a payment is in-flight
202
+
- x402-api still uses immediate pay-per-call delivery during this phase, so in-flight payments return retryable payment errors instead of switching to a receipt-only API
203
+
- \`checkStatusUrl\` is an additive canonical polling hint when the relay provides it
- \`accepts[0].extra.pricing\`: Pricing metadata (fixed or dynamic)
1178
1223
1179
1224
## Step 3: Build Payment Payload
1180
1225
@@ -1191,9 +1236,23 @@ For sBTC payments:
1191
1236
Wrap in PaymentPayloadV2:
1192
1237
\`\`\`json
1193
1238
{
1194
-
"version": 2,
1195
-
"transaction": "0x8080000000040a...", // hex-encoded signed Stacks tx
1196
-
"network": "stacks:1"
1239
+
"x402Version": 2,
1240
+
"resource": {
1241
+
"url": "/hashing/sha256",
1242
+
"description": "x402 API - /hashing/sha256",
1243
+
"mimeType": "application/json"
1244
+
},
1245
+
"accepted": {
1246
+
"scheme": "exact",
1247
+
"network": "stacks:1",
1248
+
"amount": "1000",
1249
+
"asset": "STX",
1250
+
"payTo": "SP1XXXXXXXXX",
1251
+
"maxTimeoutSeconds": 300
1252
+
},
1253
+
"payload": {
1254
+
"transaction": "0x8080000000040a..."
1255
+
}
1197
1256
}
1198
1257
\`\`\`
1199
1258
@@ -1232,6 +1291,20 @@ Decode \`payment-response\` to get transaction ID:
1232
1291
{ "version": 2, "txId": "0xabc123..." }
1233
1292
\`\`\`
1234
1293
1294
+
If the relay returns canonical in-flight or terminal failure data instead of immediate success, x402-api surfaces the same public fields when available:
1295
+
1296
+
\`\`\`json
1297
+
{
1298
+
"error": "Payment is still in flight, please retry with the same paymentId",
Terminal outcomes may also include \`terminalReason\`, for example \`sender_nonce_stale\`, \`queue_unavailable\`, \`broadcast_failure\`, \`nonce_replacement\`, or \`unknown_payment_identity\`. When the relay only exposes legacy details, x402-api uses compatibility-only inference after canonical parsing rather than making fallback inference the primary path.
1307
+
1235
1308
## Token Types
1236
1309
1237
1310
### STX (default)
@@ -1298,11 +1371,17 @@ GET /x402.json
1298
1371
Machine-readable payment configuration. Use this to auto-configure x402-stacks:
0 commit comments