curl --request POST \
--url https://api.platform.dakota.xyz/payment-agents/{payment_agent_id}/x402/signatures \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"resource_url": "https://api.marketpulse.example/v1/reports/copper-spot",
"payment_requirements": {
"scheme": "exact",
"network": "base-sepolia",
"maxAmountRequired": "100000",
"resource": "https://api.marketpulse.example/v1/reports/copper-spot",
"payTo": "0x94aE0f8B9F3c2A1d5E6b7C8D9e0F1a2B3c4D5E6F",
"asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"maxTimeoutSeconds": 120,
"extra": {
"name": "USDC",
"version": "2"
}
}
}
'const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
resource_url: 'https://api.marketpulse.example/v1/reports/copper-spot',
payment_requirements: {
scheme: 'exact',
network: 'base-sepolia',
maxAmountRequired: '100000',
resource: 'https://api.marketpulse.example/v1/reports/copper-spot',
payTo: '0x94aE0f8B9F3c2A1d5E6b7C8D9e0F1a2B3c4D5E6F',
asset: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
maxTimeoutSeconds: 120,
extra: {name: 'USDC', version: '2'}
}
})
};
fetch('https://api.platform.dakota.xyz/payment-agents/{payment_agent_id}/x402/signatures', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.platform.dakota.xyz/payment-agents/{payment_agent_id}/x402/signatures"
payload = {
"resource_url": "https://api.marketpulse.example/v1/reports/copper-spot",
"payment_requirements": {
"scheme": "exact",
"network": "base-sepolia",
"maxAmountRequired": "100000",
"resource": "https://api.marketpulse.example/v1/reports/copper-spot",
"payTo": "0x94aE0f8B9F3c2A1d5E6b7C8D9e0F1a2B3c4D5E6F",
"asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"maxTimeoutSeconds": 120,
"extra": {
"name": "USDC",
"version": "2"
}
}
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.platform.dakota.xyz/payment-agents/{payment_agent_id}/x402/signatures"
payload := strings.NewReader("{\n \"resource_url\": \"https://api.marketpulse.example/v1/reports/copper-spot\",\n \"payment_requirements\": {\n \"scheme\": \"exact\",\n \"network\": \"base-sepolia\",\n \"maxAmountRequired\": \"100000\",\n \"resource\": \"https://api.marketpulse.example/v1/reports/copper-spot\",\n \"payTo\": \"0x94aE0f8B9F3c2A1d5E6b7C8D9e0F1a2B3c4D5E6F\",\n \"asset\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"maxTimeoutSeconds\": 120,\n \"extra\": {\n \"name\": \"USDC\",\n \"version\": \"2\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"payment_header": "eyJ4NDAyVmVyc2lvbiI6MSwic2NoZW1lIjoiZXhhY3QiLCJuZXR3b3JrIjoiYmFzZS1zZXBvbGlhIn0",
"payment_header_name": "X-PAYMENT",
"signature": "0x9f2b1c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b1c001c",
"authorization_id": "2vWxX402Hold000000000000001",
"mandate_id": "2vWxX402Mandate000000000001",
"payer": "0x8f2A55949038A9610F50FB23B5883Af3B4ecB3a1",
"pay_to": "0x94aE0f8B9F3c2A1d5E6b7C8D9e0F1a2B3c4D5E6F",
"value": "100000",
"nonce": "0x3f1c8a5b2d7e4906c1a3f85b2e6d04971c8a5b3f2d7e4906c1a3f85b2e6d0497",
"valid_before": "2026-09-08T00:02:00Z",
"window_committed": "100000"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}Sign an x402 payment authorization (BETA)
Beta — early access.
Returns the X-PAYMENT header for a seller’s 402 challenge, signed by the agent’s Dakota-custodied wallet. The caller never holds a key.
Supported asset: USDC only, on Base (base / eip155:8453) and Base Sepolia (base-sepolia / eip155:84532). A seller pricing in any other token, or on any other network, is refused with a 403 naming the supported set; no signature is issued and no budget is held.
Issuing this signature IS spending money: it is an EIP-3009 TransferWithAuthorization that any holder can settle on-chain until validBefore passes, with no further approval from us. So both controls run here, before any signature exists: the seller’s payTo is screened for sanctions and other high-risk activity, and the agent’s x402 mandate is evaluated together with a hold recorded against its budget, atomically.
A refusal is a 403 naming the reason. If the payee cannot be screened the payment is refused with a 503, never signed unscreened; retry it.
Idempotent per X-Idempotency-Key: a retry with the same key and the same payment returns the SAME authorization (same nonce, same validity window), signed again - never a second one - so at most one can settle. The response is never cached: the signed header is a bearer instrument.
curl --request POST \
--url https://api.platform.dakota.xyz/payment-agents/{payment_agent_id}/x402/signatures \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"resource_url": "https://api.marketpulse.example/v1/reports/copper-spot",
"payment_requirements": {
"scheme": "exact",
"network": "base-sepolia",
"maxAmountRequired": "100000",
"resource": "https://api.marketpulse.example/v1/reports/copper-spot",
"payTo": "0x94aE0f8B9F3c2A1d5E6b7C8D9e0F1a2B3c4D5E6F",
"asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"maxTimeoutSeconds": 120,
"extra": {
"name": "USDC",
"version": "2"
}
}
}
'const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
resource_url: 'https://api.marketpulse.example/v1/reports/copper-spot',
payment_requirements: {
scheme: 'exact',
network: 'base-sepolia',
maxAmountRequired: '100000',
resource: 'https://api.marketpulse.example/v1/reports/copper-spot',
payTo: '0x94aE0f8B9F3c2A1d5E6b7C8D9e0F1a2B3c4D5E6F',
asset: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
maxTimeoutSeconds: 120,
extra: {name: 'USDC', version: '2'}
}
})
};
fetch('https://api.platform.dakota.xyz/payment-agents/{payment_agent_id}/x402/signatures', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.platform.dakota.xyz/payment-agents/{payment_agent_id}/x402/signatures"
payload = {
"resource_url": "https://api.marketpulse.example/v1/reports/copper-spot",
"payment_requirements": {
"scheme": "exact",
"network": "base-sepolia",
"maxAmountRequired": "100000",
"resource": "https://api.marketpulse.example/v1/reports/copper-spot",
"payTo": "0x94aE0f8B9F3c2A1d5E6b7C8D9e0F1a2B3c4D5E6F",
"asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"maxTimeoutSeconds": 120,
"extra": {
"name": "USDC",
"version": "2"
}
}
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.platform.dakota.xyz/payment-agents/{payment_agent_id}/x402/signatures"
payload := strings.NewReader("{\n \"resource_url\": \"https://api.marketpulse.example/v1/reports/copper-spot\",\n \"payment_requirements\": {\n \"scheme\": \"exact\",\n \"network\": \"base-sepolia\",\n \"maxAmountRequired\": \"100000\",\n \"resource\": \"https://api.marketpulse.example/v1/reports/copper-spot\",\n \"payTo\": \"0x94aE0f8B9F3c2A1d5E6b7C8D9e0F1a2B3c4D5E6F\",\n \"asset\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"maxTimeoutSeconds\": 120,\n \"extra\": {\n \"name\": \"USDC\",\n \"version\": \"2\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"payment_header": "eyJ4NDAyVmVyc2lvbiI6MSwic2NoZW1lIjoiZXhhY3QiLCJuZXR3b3JrIjoiYmFzZS1zZXBvbGlhIn0",
"payment_header_name": "X-PAYMENT",
"signature": "0x9f2b1c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b1c001c",
"authorization_id": "2vWxX402Hold000000000000001",
"mandate_id": "2vWxX402Mandate000000000001",
"payer": "0x8f2A55949038A9610F50FB23B5883Af3B4ecB3a1",
"pay_to": "0x94aE0f8B9F3c2A1d5E6b7C8D9e0F1a2B3c4D5E6F",
"value": "100000",
"nonce": "0x3f1c8a5b2d7e4906c1a3f85b2e6d04971c8a5b3f2d7e4906c1a3f85b2e6d0497",
"valid_before": "2026-09-08T00:02:00Z",
"window_committed": "100000"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Customer Not Found",
"status": 404,
"detail": "Customer cst_2abc123 was not found in your organization.",
"instance": "https://api.platform.dakota.xyz/customers/cst_2abc123",
"request_id": "req_7f3a8b2c"
}Authorizations
Headers
Unique key (UUID) to ensure request idempotency on POST, PUT and PATCH requests.
A key is scoped to your client, the HTTP method and the path, and is remembered for 24 hours after a
successful (below 400) response. Repeating the same request (same JSON body, whatever the key order or
whitespace) with the same key within that window returns the original response with
X-Idempotent-Replayed: true instead of executing the request again. Using the same key on the same
endpoint with a different body returns 422 with problem type idempotency-key-reused; the request is
not executed. Error responses (4xx and 5xx) are not remembered, so a request refused for a fixable reason
can be corrected and retried under the same key. Request bodies that are not JSON (for example file
uploads) are not compared.
Path Parameters
Body
One payment option from a seller's 402 response, forwarded verbatim. Field names are the x402 protocol's own, not Dakota's. Both protocol versions are accepted: v1 terms carry maxAmountRequired, v2 terms carry amount and a CAIP-2 network.
Show child attributes
Show child attributes
The 402-metered URL being paid for. Required when the mandate restricts payees by domain.
The x402 version the seller spoke — x402Version in its 402 response. Decides how the signed payment is packaged: v1 as the X-PAYMENT header, v2 as PAYMENT-SIGNATURE. Defaults to 1.
1, 2 Response
The signed payment authorization
The payment header's value — base64 of the payment payload — to send in the header named by payment_header_name.
The request header the seller expects the payment in: X-PAYMENT for x402 v1, PAYMENT-SIGNATURE for v2.
X-PAYMENT, PAYMENT-SIGNATURE The hold this authorization is recorded against.
Committed spend in the mandate's window after this authorization.
Was this page helpful?

