SMSPVAdevelopers
Rental API
SMSPVA / DOCUMENTATION

延长租赁

GET /api/rent.php?method=prolong

SMSPVA API
GEThttps://smspva.com/api/rent.php?method=prolong

发送 GET 请求后,检查 JSON 中的 status:1 成功,0 失败,即使 HTTP 为 200 也一样。失败原因见 msg。

此请求可能修改租赁订单或产生费用。响应丢失后,先查询订单及历史,再决定是否重试:更改可能已经生效。示例不会自动重试。

身份验证

apikey 为必填查询参数。

参数

名称位置类型必填示例说明
methodquerystring是"prolong"方法名称
apikeyquerystring是SMSPVA_API_KEY你的 API 密钥 可在网站右上角菜单的 Profile and APIKEY 中找到。
idqueryinteger是123订单 ID
dtypequerystring是"week"周期单位:week 或 month
dcountqueryinteger是1周期数;dtype=week 时表示周数。

使用说明

按所需周数或月数延长租赁。请先在租赁订单中查看 canprolong、canprolongmax 和 canprolonguntil,延期不能超出该订单的限制。

请求示例

运行环境及依赖. 示例会对查询参数编码,最多等待 30 秒。使用 data 前请检查 HTTP 和 JSON status。cURL 输出原始响应供你检查,Java 使用 Jackson 读取 JSON。

  • SMSPVA_RENTAL_ORDER_ID: id.
: "${SMSPVA_API_KEY:?Set SMSPVA_API_KEY}"
: "${SMSPVA_RENTAL_ORDER_ID:?Set SMSPVA_RENTAL_ORDER_ID}"
curl --get --fail-with-body --max-time 30 "https://smspva.com/api/rent.php" \
  --data-urlencode "method=prolong" \
  --data-urlencode "apikey=$SMSPVA_API_KEY" \
  --data-urlencode "id=$SMSPVA_RENTAL_ORDER_ID" \
  --data-urlencode "dtype=week" \
  --data-urlencode "dcount=1"

响应

请查看与你的请求对应的响应。数值和日期仅供示例;可选字段可能因结果或所选响应格式而不同。

HTTP 200

订单延期结果。

application/json

延期成功

{
  "status": 1
}

Incorrect order id

{
  "status": 0,
  "msg": "Incorrect order id"
}

Order not found

{
  "status": 0,
  "msg": "Order not found"
}

Incorrect duration type

{
  "status": 0,
  "msg": "Incorrect duration type. Available types: week, month"
}

Incorrect duration count

{
  "status": 0,
  "msg": "Incorrect duration count. Min 7 days. Max 90 days."
}

Insufficient funds in account

{
  "status": 0,
  "msg": "Insufficient balance"
}
名称类型说明
statusinteger响应状态:1 成功,0 失败。

相关指南

本页内容