Payment for AceDataCloud Platform Orders

Obtain payment link / QR code / on-chain deduction instructions for orders with Pending status, and initiate the actual deduction.

Behavior of different payment methods:

payment_method Return Content User Action
AliPay Alipay QR code / H5 redirect URL Scan or click the link to complete payment
WeChat WeChat scan QR code Scan with WeChat
Stripe Stripe Checkout Session URL Redirect to Stripe to complete card payment
Paypal PayPal Approve URL Redirect to PayPal to complete payment
X402 / Crypto EIP-3009 / Solana on-chain transfer instructions Wallet signature, on-chain confirmation takes effect

ℹ️ This interface belongs to the AceDataCloud Platform Management API, with a unified prefix of https://platform.acedata.cloud/api/v1/. For the complete interface index, see Get AceDataCloud Platform Documentation List.

Interface Overview

Item Content
Method POST
URL https://platform.acedata.cloud/api/v1/orders/{order_id}/pay/
Authentication ✅ Requires account token
Body application/json (most payment methods can be empty {})

Authentication Instructions (How to Obtain Account Token)

Request Header:

Authorization: Bearer platform-v1-92eb****629c

For ways to obtain the account token, see Manage AceDataCloud Platform Account Token.

Path Parameters

Parameter Type Required Description
order_id UUID Order ID

Request Body

Different payment methods require different fields:

AliPay / WeChat / Stripe / Paypal

Usually no Body is needed, directly POST {}.

X402 / Crypto

Field Type Required Description
signature string Wallet signature of the authorization information (EIP-712 or Solana signature)
from_address string Payer's wallet address
chain_id string No Chain ID (default is the platform's main chain)
token_address string No Token contract address (default is USDC)

Request Example

cURL — AliPay

curl -X POST 'https://platform.acedata.cloud/api/v1/orders/fa927d12-3b04-4f51-bf2e-ec3a5a7d9b2c/pay/' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer platform-v1-92eb****629c' \
  -H 'content-type: application/json' \
  -d '{}'

Python

import requests

PLATFORM_TOKEN = "platform-v1-92eb****629c"
order_id = "fa927d12-3b04-4f51-bf2e-ec3a5a7d9b2c"

resp = requests.post(
    f"https://platform.acedata.cloud/api/v1/orders/{order_id}/pay/",
    headers={
        "authorization": f"Bearer {PLATFORM_TOKEN}",
        "content-type": "application/json",
    },
    json={},
    timeout=10,
)
data = resp.json()
print(f"Payment link: {data.get('payment_url') or data.get('qr_code_url')}")

Node.js

const orderId = 'fa927d12-3b04-4f51-bf2e-ec3a5a7d9b2c'
const r = await fetch(`https://platform.acedata.cloud/api/v1/orders/${orderId}/pay/`, {
  method: 'POST',
  headers: {
    authorization: 'Bearer platform-v1-92eb****629c',
    'content-type': 'application/json',
  },
  body: '{}',
})
const data = await r.json()
window.location.href = data.payment_url || data.qr_code_url

Response Example (HTTP 200)

AliPay / WeChat

{
  "order_id": "fa927d12-3b04-4f51-bf2e-ec3a5a7d9b2c",
  "payment_method": "AliPay",
  "payment_url": "https://qr.alipay.com/bax03455azqgxxxxxxxxx",
  "qr_code_url": "https://qr.alipay.com/bax03455azqgxxxxxxxxx",
  "expires_in": 900
}

Stripe / Paypal

{
  "order_id": "fa927d12-3b04-4f51-bf2e-ec3a5a7d9b2c",
  "payment_method": "Stripe",
  "payment_url": "https://checkout.stripe.com/c/pay/cs_test_xxxxx",
  "expires_in": 86400
}

X402 / Crypto

On-chain payment successfully settled directly — the return value indicates confirmation on-chain:

{
  "order_id": "fa927d12-3b04-4f51-bf2e-ec3a5a7d9b2c",
  "payment_method": "X402",
  "state": "Paid",
  "tx_hash": "0x123abc..."
}

Error Handling

HTTP Code Meaning
400 invalid_state The order status is not Pending (already paid / canceled / expired)
400 invalid_signature X402 / Crypto signature verification failed
400 invalid Other parameter errors
401 not_authenticated Missing account token
403 permission_denied The order does not belong to you
404 not_found The order does not exist

Practical Tips

  • Payment links have a time limit: AliPay/WeChat generally expire after 15 minutes, and calling this interface again after expiration will automatically regenerate a new link.
  • Payment automatically credited after completion: The server will listen for payment callbacks (asynchronous), and usually within a few seconds the state will change to Paid and increase the Application balance.
  • No manual confirmation needed: The payment status of third-party payments is entirely received by the server Webhook, and the client only needs to poll Order Details or Refresh Order Status to perceive.
  • X402 takes effect immediately: On-chain payments are not an asynchronous process — the state is already Paid when this interface returns.
  • Duplicate payment protection: Calling this interface for the same order with state="Paid" will return 400 invalid_state, and no duplicate deduction will occur.