remp/crm-coupon-module
Composer 安装命令:
composer require remp/crm-coupon-module
包简介
CRM Coupon Module
README 文档
README
API documentation
All examples use http://crm.press as a base domain. Please change the host to the one you use
before executing the examples.
All examples use XXX as a default value for authorization token, please replace it with the
real tokens:
- API tokens. Standard API keys for server-server communication. It identifies the calling application as a whole.
They can be generated in CRM Admin (
/api/api-tokens-admin/) and each API key has to be whitelisted to access specific API endpoints. By default the API key has access to no endpoint. - User tokens. Generated for each user during the login process, token identify single user when communicating between
different parts of the system. The token can be read:
- From
n_tokencookie if the user was logged in via CRM. - From the response of
/api/v1/users/loginendpoint - you're free to store the response into your own cookie/local storage/session.
- From
API responses can contain following HTTP codes:
| Value | Description |
|---|---|
| 200 OK | Successful response, default value |
| 400 Bad Request | Invalid request (missing required parameters) |
| 403 Forbidden | The authorization failed (provided token was not valid) |
| 404 Not found | Referenced resource wasn't found |
If possible, the response includes application/json encoded payload with message explaining
the error further.
POST /api/v1/coupon/activate
Activate coupon specified by code for authenticated user.
Headers:
| Name | Value | Required | Description |
|---|---|---|---|
| Authorization | Bearer String | yes | User token. |
Params:
| Name | Value | Required | Description |
|---|---|---|---|
| code | String | yes | The code of coupon to activate. |
| notifyUser | Boolean | no | Flag indicating that user should be notified (email, push notification). |
Example:
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 }'
Response:
{ "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 }
remp/crm-coupon-module 适用场景与选型建议
remp/crm-coupon-module 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15.29k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 08 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 remp/crm-coupon-module 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 remp/crm-coupon-module 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 15.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-31