Orders (orders)
Returns purchase records, including dedicated APP credentials. Paginated. Sales/admin only.
API info
| Item | Value |
|---|
| Endpoint | POST /api.php |
| action | orders |
| Authentication | Global APP ID / APP KEY |
| Role restriction | Sales / admin only |
Request parameters
| Parameter | Type | Required | Description |
|---|
page | int | No | Page number, default 1 |
limit | int | No | Items per page, default 20, max 50 |
Request example
{
"action": "orders",
"app_id": "68B0FA47FEC9E7EBC4BF80F8",
"app_key": "2b901515a427b6c0b68f866eece70e0d2ecf687146022412",
"page": 1,
"limit": 20
}
PHP
<?php
$app_id = '68B0FA47FEC9E7EBC4BF80F8';
$app_key = '2b901515a427b6c0b68f866eece70e0d2ecf687146022412';
$url = 'https://yunsapi.com/api.php';
$params = [
'action' => 'orders',
'app_id' => $app_id,
'app_key' => $app_key,
'page' => 1,
'limit' => 20,
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($ch);
curl_close($ch);
echo $resp;
Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ApiDemo {
static final String URL = "https://yunsapi.com/api.php";
static final String APP_ID = "68B0FA47FEC9E7EBC4BF80F8";
static final String APP_KEY = "2b901515a427b6c0b68f866eece70e0d2ecf687146022412";
public static void main(String[] args) throws Exception {
String body = "{\"action\":\"orders\",\"app_id\":\"" + APP_ID + "\",\"app_key\":\"" + APP_KEY + "\",\"page\":1,\"limit\":20}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create(URL))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> resp = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(resp.body());
}
}
Response example
{
"code": 0,
"msg": "success",
"data": {
"total": 5,
"page": 1,
"limit": 20,
"list": [
{
"id": "20",
"api_name": "ID Card 2-Factor",
"api_code": "idcard2check",
"amount": 1.0000,
"calls": "40",
"used": "26",
"remain": 14,
"expire_time": "2026-09-12 03:22:50",
"order_app_id": "8660A87AE320F5D9E7AAF92C",
"order_app_key": "a740e240f22d641bd950388138503d6c2f878db74a72e495"
}
]
}
}
Response parameters
| Parameter | Type | Description |
|---|
data.total | int | Total records |
data.page | int | Current page |
data.limit | int | Items per page |
data.list[].id | string | Order ID |
data.list[].api_name | string | API name |
data.list[].api_code | string | API code |
data.list[].amount | float | Amount paid |
data.list[].calls | string | Total calls (null for buyout) |
data.list[].used | string | Calls used |
data.list[].remain | int | Calls remaining |
data.list[].expire_time | string | Expiry time |
data.list[].order_app_id | string | Dedicated APP ID |
data.list[].order_app_key | string | Dedicated APP KEY |