云尚API

查询订单(orders)

返回购买记录,含专属 APP 凭据。支持分页。仅限销售/管理员角色调用。

接口信息

项目说明
接口地址POST /api.php
actionorders
认证方式全局应用 APP ID / APP KEY
角色限制仅销售/管理员

请求参数

参数类型必填说明
pageint页码,默认 1
limitint每页条数,默认 20,最大 50

请求示例

{
    "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());
    }
}

响应示例

{
    "code": 0,
    "msg": "success",
    "data": {
        "total": 5,
        "page": 1,
        "limit": 20,
        "list": [
            {
                "id": "20",
                "api_name": "身份证二要素核验",
                "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"
            }
        ]
    }
}

响应参数

参数类型说明
data.totalint总记录数
data.pageint当前页码
data.limitint每页条数
data.list[].idstring订单 ID
data.list[].api_namestringAPI 名称
data.list[].api_codestringAPI 代码
data.list[].amountfloat支付金额
data.list[].callsstring总调用次数(买断为 null)
data.list[].usedstring已使用次数
data.list[].remainint剩余次数
data.list[].expire_timestring到期时间
data.list[].order_app_idstring专属 APP ID
data.list[].order_app_keystring专属 APP KEY