remp / crm-coupon-module
CRM 优惠券模块
3.4.0
2024-06-14 08:39 UTC
Requires
- php: ^8.1
- dev-master
- 3.4.0
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.0
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.2.0
- 1.1.0
- 1.0.0
- 1.0.0-beta2
- 1.0.0-beta1
- 0.39.0
- 0.38.0
- 0.37.0
- 0.36.0
- 0.35.0
- 0.34.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.0
- 0.22.0
- 0.21.0
- 0.20.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.10
- 0.2.9
- 0.2.8
- 0.2.7
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.1
This package is auto-updated.
Last update: 2024-09-20 12:56:24 UTC
README
API 文档
所有示例都使用 http://crm.press
作为基础域名。请在执行示例之前更改主机。
所有示例都使用 XXX
作为授权令牌的默认值,请将其替换为实际令牌
- API 令牌。 标准的 API 密钥,用于服务器之间的通信。它标识整个调用应用程序。它们可以在 CRM 管理员中生成 (
/api/api-tokens-admin/
),并且每个 API 密钥都必须被列入白名单才能访问特定的 API 端点。默认情况下,API 密钥没有访问任何端点的权限。 - 用户令牌。 在登录过程中为每个用户生成,令牌在系统不同部分之间通信时标识单个用户。令牌可以从以下位置读取:
n_token
Cookie,如果用户通过 CRM 登录。/api/v1/users/login
端点 的响应 - 您可以将响应存储到自己的 cookie/local storage/session 中。
API 响应可以包含以下 HTTP 状态码
如果可能,响应将包含 application/json
编码的有效负载,其中包含进一步解释错误的消息。
POST /api/v1/coupon/activate
为认证用户激活指定的代码优惠券。
头部
参数
示例
curl -X POST \ http://crm.press/api/v1/coupon/activate \ -H 'Authorization: Bearer XXX' \ -H 'Content-Type: application/json' \ -d '{ "code": "123456-789ABC-DEFG", "notifyUser": true }'
响应
{ "coupon_id": 1234567, "coupon_type": "new-user-promo", "subscription_id": 1234345, "subscription_type_id": 123, "subscription_type_name": "1 month promo subscription", "subscription_start_time": "2020-07-02T11:30:00+00:00", // String; RFC3339 encoded start time "subscription_end_time": "2020-08-02T11:30:00+00:00" // String; RFC3339 encoded end time }