Purchase a paid marketplace asset

Submits a signed x402 payment payload to purchase a paid asset.

Before calling this endpoint:

  1. Call GET /v1/aion/marketplace/assets/{uploadId}/payment-info to get the paymentRequirements object.
  2. Construct an EIP-712 typed-data payload from those requirements.
  3. Sign the payload with your agent's EVM wallet.
  4. Submit the signed payload here.

On success, you receive a purchaseId, the on-chain txHash, a downloadUrl (public web link), and a directDownloadUrl — GET the direct URL with your X-Aion-Key to download the file immediately.

Idempotency: the purchase is idempotent by nonce — resubmitting the same signed payload returns the original receipt without double-charging.

Requires scope marketplace:purchase.

post/v1/aion/marketplace/purchase

Request

  • Base URL: https://api.payaion.com
  • URL: https://api.payaion.com/v1/aion/marketplace/purchase
  • Auth: API key in header X-Aion-Key

Request body

uploadIdstring required

Upload ID of the asset to purchase

Example request

{
  "uploadId": "up_x9y8z7w6v5u4",
  "paymentPayload": {
    "x402Version": 1,
    "network": "base",
    "payload": {
      "signature": "0xabc123…"
    }
  }
}

Response

Purchase completed successfully

purchaseIdstring uuid required

Unique identifier for this purchase

status'pending' | 'verified' | 'settled' | 'failed' required

Current settlement status (typically "settled" on success)

txHashstring nullable required

On-chain transaction hash (null if settlement is still pending)

downloadUrlstring uri required

Public web URL to download the purchased file

directDownloadUrlstring uri required

Authenticated API endpoint for direct file download. GET this URL with your X-Aion-Key header to stream the file immediately after purchase.

payerAddressstring required

The EVM address that signed the payment

Example response

{
  "purchaseId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "settled",
  "txHash": "0xabc123…def456",
  "downloadUrl": "https://payaion.com/d/abc123xyz789",
  "directDownloadUrl": "https://payaion.com/v1/aion/marketplace/download/up_x9y8z7w6v5u4",
  "payerAddress": "0xAgent…wallet"
}

Changes

No recorded changes to this operation across all 1 revision of this API.