Skip to content

Commit 4164a54

Browse files
authored
feat: promos for client (#279)
Closes #DEV-3408
1 parent 0cb9f53 commit 4164a54

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
## Promotions for a client
2+
3+
> Headers
4+
5+
```
6+
Content-type: application/json
7+
```
8+
9+
> Body example
10+
11+
```json
12+
{
13+
"shop_id": "...",
14+
"did": "...",
15+
"seance": "...",
16+
"email": "...",
17+
"phone": "...",
18+
"external_id": "...",
19+
"stream": "...",
20+
"promo_codes": ["..."],
21+
"location_id": "...",
22+
"charge_bonuses": true,
23+
"cart_items": [
24+
{"product_id": "...", "price": 1000, "quantity": 4},
25+
{"product_id": "...", "price": 2000, "quantity": 1}
26+
]
27+
}
28+
```
29+
30+
> Request example
31+
32+
```shell
33+
curl --header "Content-Type: application/json" \
34+
--request POST \
35+
--data-binary "@data.json" \
36+
https://<%= config[:api_endpoint] %>/loyalty/promos/for-client
37+
```
38+
39+
```javascript
40+
// Not implemented yet
41+
```
42+
```swift
43+
// Not implemented yet
44+
```
45+
```java
46+
// Not implemented yet
47+
```
48+
```kotlin
49+
// Not implemented yet
50+
```
51+
```jsx
52+
// Not implemented yet
53+
```
54+
55+
> The above command returns JSON structured like this:
56+
57+
```json
58+
{
59+
"success": true,
60+
"payload": [
61+
{"id": 1, "name": "...", "description": "...", "badge_label": "...", "badge_color": "..." },
62+
{"id": 2, "name": "...", "description": "...", "badge_label": "...", "badge_color": "..." }
63+
]
64+
}
65+
```
66+
67+
### HTTP Request
68+
69+
`POST https://<%= config[:api_endpoint] %>/loyalty/promos/for-client`
70+
71+
Returns list of all active promotions for the current user.
72+
73+
| Parameter | Type | Required | Description |
74+
|-------------|----------|----------|------------------------------------------------------------------------------|
75+
| shop_id | String | true | Your API key |
76+
| stream | String | false | Stream to filter promos for different devices. Omit if you don't use streams |
77+
| location_id | String | false | Location ID |
78+
| did* | string | false | Device ID |
79+
| external_id | string | false | External ID |
80+
| email | string | false | Email |
81+
| phone | string | false | Phone |
82+
| loyalty_id | string | false | Loyalty ID |
83+
| telegram_id | string | false | Telegram ID |
84+
| cart_items | Array | false | Current shopping cart |

source/index.html.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ includes:
5151
- loyalty.checkout.orders-history.md.erb
5252
- loyalty.promos.md.erb
5353
- loyalty.promos.index.md.erb
54+
- loyalty.promos.for-client.md.erb
5455
- loyalty.promos.cart.md.erb
5556
- loyalty.referral.md.erb
5657
- loyalty.referral.join.md.erb

0 commit comments

Comments
 (0)