请求(POST 或者 GET)
https://api.ihuyi.com/f/giftcard?action=buy
| 参数名称 | 参数值描述 | 示例 | 类型 | 必填 |
| Content-Type | 内容类型,固定值 | application/x-www-form-urlencoded | string | 是 |
| 参数名称 | 参数值描述 | 示例 | 类型 | 必填 |
| username | API ID | 123456 | string | 是 |
| mobile | 手机号 | 130******* | string | 否 |
| orderid | 商家订单ID | DD20253995959 | string | 是 |
| productid | 产品ID | k111-1 | string | 是 |
| buynum | 购买数量-固定数量1 | 1 | string | 是 |
| timestamp | 时间戳格式如:yyyyMMddHHmmss 允许 10分钟统一以东 8 时间 | 20240321150546 | string | 是 |
| sign | 签名 | 81ed625f338277f1bd7f27b9339e302c | string | 是 |
| 参数名称 | 参数值描述 | 示例 | 类型 | 必返 |
| code | 返回值为1时,表示提交成功 | 1|1001 | int | |
| message | 提交结果描述 | 查询成功|API ID 为空 | string | |
| data | 结果集 | object | ||
| taskid | 任务 id,购买失败则可能没有 | 240630211247304 |
| code | msg |
| 1000 | 无此操作类型(action 为空或不存在) |
| 1001 | API ID 为空 |
| 1002 | API ID 错误 |
| 1003 | 手机号码为空 |
| 1004 | 手机号码错误 |
| 1005 | 产品 ID 不能为空 |
| 1006 | 时间戳不能为空 |
| 1007 | 不存在的产品 |
| 1008 | 签名不能为空 |
| 1009 | 签名错误 |
| 1010 | 签名过期 |
| 1011 | 账号被冻结 |
| 1012 | 余额不足 |
| 1013 | 访问 ip 与备案 ip 不相同 |
| 1014 | 订单 ID 不能为空 |
| 1015 | 订单 ID 已存在 |
| 1016 | 客户订单号格式错误 |
| 1017 | 产品未配置,联系商务 |
| 1018 | 购买数量为空 |
| 1019 | 购买数量错误 |
| 1020 | 产品资金异常 |
| 1021 | 通道故障 |
| 1024 | 扩展参数错误 |
| 2001 | 不支持的手机号码 |
| 2002 | 手机号码已加入黑名单 |
| 2003 | 不支持的地区 |
| 2005 | 请求失败 |
| 2008 | 订单 ID 不存在 |
| 3001 | 扣费失败 |
| 4001 | 系统内部故障 |
不支持
示例(成功)
{ "code":
1
, "message":
"查询成功"
, "data":
{ "taskid":
"240630211247304"
}
}
示例(失败)
{"code":1001,}
$apikey = 'xxxxxxxxxxxxxxxx'; //可登录用户中心查看
$buynum = '1';
$mobile = '130*******';
$orderid = 'DD20253995959';
$productid = 'k111-1';
$timestamp = '20240321150546';
$username = '123456';
$password=md5('apikey='.$apikey.'&buynum='.$buynum.'&mobile='.$mobile.'&orderid='.$orderid.'&productid='.$productid.'×tamp='.$timestamp.'&username='.$username);
$password=md5('apikey=xxxxxxxxxxxxxxxx&buynum=1&mobile=130*******&orderid=DD20253995959&productid=k111-1×tamp=20240321150546&username=123456');
//注意:所有字符编码统一为UTF-8
国内专业互联网团队
21年行业经验
7x24小时售后支持
丰富的行业经验
Copyright © 2004-2025 上海思锐信息技术有限公司 All rights reserved. 沪ICP备07035915号-15 电信增值业务许可证:B2-20160082
服务热线:
4008 808 898
服务热线(工作时间):
4008 808 898
业务咨询(非工作时间):
售后咨询(非工作时间):