Get Order List

The order (Order) records all purchase transactions made by users on the Ace Data Cloud platform. Through this interface, you can query the current user's order history, including order status, payment method, amount, and other information.

This interface requires authentication, for details please refer to Platform Token.

Interface Description

  • Request Method: GET
  • Request URL: https://platform.acedata.cloud/api/v1/orders/
  • Request Headers:
    • accept: application/json
    • authorization: Bearer {token}

Query Parameters

Parameter Type Required Description
state string No Order status, multiple separated by commas: Pending, Paid, Finished, Expired, Failed, Refunded
pay_way string No Payment method: WechatPay, AliPay, Stripe, X402
created_at_from string No Start of creation time (ISO 8601 format)
created_at_to string No End of creation time (ISO 8601 format)
limit integer No Number of items returned per page
offset integer No Offset

CURL Request Example

curl -X GET \
  -H "accept: application/json" \
  -H "authorization: Bearer {token}" \
  "https://platform.acedata.cloud/api/v1/orders/"

Filter for completed orders:

curl -X GET \
  -H "accept: application/json" \
  -H "authorization: Bearer {token}" \
  "https://platform.acedata.cloud/api/v1/orders/?state=Finished"

Filter by time range:

curl -X GET \
  -H "accept: application/json" \
  -H "authorization: Bearer {token}" \
  "https://platform.acedata.cloud/api/v1/orders/?created_at_from=2024-01-01T00:00:00Z&created_at_to=2024-12-31T23:59:59Z"

Return Result Example

{
  "count": 10,
  "results": [
    {
      "id": "order-uuid-1234",
      "user_id": "b87f67c1-b04f-4332-99a1-7a5e651331c6",
      "application_id": "107f8d0f-e465-4a7e-a49e-d633d26f7aa2",
      "package_id": "pkg-uuid",
      "amount": 500,
      "price": 49.99,
      "discount": 1.0,
      "pay_way": "Stripe",
      "pay_id": "pi_xxxxxx",
      "pay_url": null,
      "state": "Finished",
      "remaining_amount": 500,
      "applications": [...],
      "packages": [...],
      "tags": null,
      "metadata": null,
      "created_at": "2024-06-15T10:00:00.000000Z",
      "updated_at": "2024-06-15T10:05:00.000000Z"
    }
  ]
}

Return Field Description

Field Type Description
id string Unique order identifier (UUID)
user_id string User ID
application_id string Associated application ID
package_id string Purchased package ID
amount number Amount purchased
price number Payment amount (USD)
discount number Discount factor (1.0 means no discount)
pay_way string Payment method
pay_id string Third-party payment ID
pay_url string Payment link (valid when status is Pending)
state string Order status
remaining_amount number Remaining amount (after recharge)

Order Status Description

Status Description
Pending Awaiting payment (payment link created, waiting for user payment)
Paid Paid (payment successful, waiting for system processing)
Finished Completed (amount has been credited)
Expired Expired (timeout without payment)
Failed Failed (payment or processing failed)
Refunded Refunded

Code Example

Python:

import requests

url = "https://platform.acedata.cloud/api/v1/orders/"
headers = {
    "accept": "application/json",
    "authorization": "Bearer {token}"
}

response = requests.get(url, headers=headers)
data = response.json()

for order in data["results"]:
    print(f"Order ID: {order['id']}")
    print(f"  Amount: ${order['price']}")
    print(f"  Status: {order['state']}")
    print(f"  Payment Method: {order['pay_way']}")
    print()