Application

Events categorised under application/sales channel level will be triggered when any action performed for sales channel. e.g. If new Coupon is created for sales channel.

Coupon

This event will be generated where there is any action done on coupon

Events
application/coupon/create/v1
# this event is triggered when coupon is created
application/coupon/update/v1
# this event is triggered when coupon is updated
application/coupon/redeem/v1
# this event is triggered when coupon is redeemed

Coupon/coupon/create/v1

this event is triggered when coupon is created

Payload
Hide
This event is triggered when coupon is created.
application_id
array|string
Required
Application/sales channel ID for which this event is triggered
company_id
integer
Required
company ID for which this event is triggered
contains
array of string
Required
This array will have all the keys present at root level of 'payload' object
event
object
Required
This contains event data like name and type of event.
Show
payload
object
Required
The payload data of event.
Show
Payload Schema JSON
1{
2 "type": "object",
3 "description": "This event is triggered when coupon is created.",
4 "required": [
5 "company_id",
6 "contains",
7 "event",
8 "payload",
9 "application_id"
10 ],
11 "properties": {
12 "application_id": {
13 "type": [
14 "array",
15 "string"
16 ],
17 "description": "Application/sales channel ID for which this event is triggered"
18 },
19 "company_id": {
20 "type": "integer",
21 "description": "company ID for which this event is triggered"
22 },
23 "contains": {
24 "type": "array",
25 "description": "This array will have all the keys present at root level of 'payload' object",
26 "items": {
27 "type": "string"
28 }
29 },
30 "event": {
31 "type": "object",
32 "description": "This contains event data like name and type of event.",
33 "required": [
34 "category",
35 "created_timestamp",
36 "id",
37 "name",
38 "trace_id",
39 "type",
40 "version"
41 ],
42 "properties": {
43 "category": {
44 "type": "string",
45 "description": "category of the event. If it is at sales channel level or company level"
46 },
47 "created_timestamp": {
48 "type": "integer",
49 "description": "event generation timestamp in epoch milliseconds"
50 },
51 "id": {
52 "type": "string",
53 "description": "Unique ID for an event. This id can be used to verifiy if event is already processed by receiver"
54 },
55 "name": {
56 "type": "string",
57 "description": "Name of the event"
58 },
59 "trace_id": {
60 "type": "array",
61 "description": "internal trace_id for Fynd Platform services",
62 "items": {
63 "type": "string"
64 }
65 },
66 "type": {
67 "type": "string",
68 "description": "Type/Action of the event. e.g. create/update/delete"
69 },
70 "version": {
71 "type": "string",
72 "description": "Version of the event."
73 }
74 }
75 },
76 "payload": {
77 "type": "object",
78 "description": "The payload data of event.",
79 "required": [
80 "coupon"
81 ],
82 "properties": {
83 "coupon": {
84 "type": "object",
85 "description": "Coupon date consisting data like code and coupon fields.",
86 "required": [
87 "author",
88 "code",
89 "date_meta",
90 "display_meta",
91 "identifiers",
92 "ownership",
93 "restrictions",
94 "rule",
95 "rule_definition",
96 "state",
97 "tags",
98 "type_slug",
99 "validation",
100 "validity",
101 "_schedule"
102 ],
103 "properties": {
104 "action": {
105 "type": "object",
106 "required": [
107 "action_date",
108 "txn_mode"
109 ],
110 "properties": {
111 "action_date": {
112 "type": [
113 "null",
114 "string"
115 ],
116 "description": "action date to start coupon actions required in case of txn_mode is not coupon"
117 },
118 "txn_mode": {
119 "type": "string",
120 "description": "txn mode of the coupon like coupon"
121 }
122 },
123 "description": "action details of coupon"
124 },
125 "author": {
126 "type": "object",
127 "additionalProperties": true,
128 "required": [
129 "modified_by",
130 "created_by"
131 ],
132 "properties": {
133 "created_by": {
134 "type": "string",
135 "description": "user id by whom the coupon created",
136 "nullable": true
137 },
138 "modified_by": {
139 "type": "string",
140 "description": "user id by whom the coupon modified",
141 "nullable": true
142 },
143 "rejected_by": {
144 "type": [
145 "string",
146 "null"
147 ],
148 "description": "The user id of user, who has rejected the coupon",
149 "nullable": true
150 },
151 "approved_by": {
152 "type": [
153 "string",
154 "null"
155 ],
156 "description": "The user id of user, who has approved the coupon",
157 "nullable": true
158 },
159 "reviewed_by": {
160 "type": [
161 "string",
162 "null"
163 ],
164 "description": "The user id of user who has reviewed the coupon.",
165 "nullable": true
166 }
167 },
168 "description": "author details of the coupon"
169 },
170 "code": {
171 "type": "string",
172 "description": "Coupon unique code"
173 },
174 "date_meta": {
175 "type": "object",
176 "additionalProperties": true,
177 "properties": {
178 "created_on": {
179 "type": [
180 "string",
181 "null"
182 ],
183 "description": "Timestamp on which the coupon was created"
184 },
185 "modified_on": {
186 "type": [
187 "string",
188 "null"
189 ],
190 "description": "Timestamp on which the coupon was modified"
191 }
192 },
193 "description": "date details of coupon"
194 },
195 "display_meta": {
196 "type": "object",
197 "required": [],
198 "properties": {
199 "apply": {
200 "type": "object",
201 "required": [
202 "title",
203 "subtitle"
204 ],
205 "properties": {
206 "subtitle": {
207 "type": "string",
208 "description": "apply message subtitle of the coupon"
209 },
210 "title": {
211 "type": "string",
212 "description": "title message of the coupon"
213 }
214 },
215 "description": "apply message details of the coupon"
216 },
217 "auto": {
218 "type": "object",
219 "required": [
220 "title",
221 "subtitle"
222 ],
223 "properties": {
224 "subtitle": {
225 "type": "string",
226 "description": "auto apply subtitle of the coupon"
227 },
228 "title": {
229 "type": "string",
230 "description": "auto apply title of the coupon"
231 }
232 },
233 "description": "auto apply details of the coupon"
234 },
235 "description": {
236 "type": "string",
237 "description": "Description of the coupon"
238 },
239 "remove": {
240 "type": "object",
241 "required": [
242 "title",
243 "subtitle"
244 ],
245 "properties": {
246 "subtitle": {
247 "type": "string",
248 "description": "remove subtitle of the coupon"
249 },
250 "title": {
251 "type": "string",
252 "description": "remove title of the coupon"
253 }
254 },
255 "description": "Remove details of the coupon"
256 },
257 "subtitle": {
258 "type": "string",
259 "description": "subtitle of the coupon"
260 },
261 "title": {
262 "type": "string",
263 "description": "title of the coupon"
264 }
265 },
266 "description": "display details of the coupon"
267 },
268 "identifiers": {
269 "type": "object",
270 "required": [],
271 "properties": {
272 "exclude_brand_id": {
273 "type": "array",
274 "description": "This brand ids will be excluded while applying coupon.",
275 "items": {
276 "type": "integer"
277 }
278 },
279 "brand_id": {
280 "type": "array",
281 "description": "The brand ids on which coupon will be applied.",
282 "items": {
283 "type": "integer"
284 }
285 },
286 "item_id": {
287 "type": "array",
288 "description": "The item ids on which coupon will be applied.",
289 "items": {
290 "type": "integer"
291 }
292 },
293 "company_id": {
294 "type": "array",
295 "description": "The company ids on which coupon will be applied.",
296 "items": {
297 "type": "integer"
298 }
299 },
300 "article_id": {
301 "type": "array",
302 "description": "The article ids on which coupon will be applied.",
303 "items": {
304 "type": "integer"
305 }
306 },
307 "store_id": {
308 "type": "array",
309 "description": "The store ids on which coupon will be applied.",
310 "items": {
311 "type": "integer"
312 }
313 },
314 "collection_id": {
315 "type": "array",
316 "description": "Coupon will be applied on mentioned collection ids products.",
317 "items": {
318 "type": "string"
319 }
320 },
321 "category_id": {
322 "type": "array",
323 "description": "The category ids on which coupon will be applied.",
324 "items": {
325 "type": "integer"
326 }
327 },
328 "user_id": {
329 "type": "array",
330 "description": "The user ids for which this coupon will be usable.",
331 "items": {
332 "type": "string"
333 }
334 }
335 },
336 "description": "condition fields of the coupon"
337 },
338 "ownership": {
339 "type": "object",
340 "required": [
341 "payable_by",
342 "payable_category"
343 ],
344 "properties": {
345 "payable_by": {
346 "type": "string",
347 "description": "user id for who will pay the amount discounted by coupon"
348 },
349 "payable_category": {
350 "type": "string",
351 "description": "user category for who will pay the amount discounted by coupon"
352 }
353 },
354 "description": "Ownership details of the coupon"
355 },
356 "restrictions": {
357 "type": "object",
358 "required": [
359 "platforms",
360 "post_order",
361 "uses"
362 ],
363 "properties": {
364 "user_type": {
365 "type": "string",
366 "description": "Type of the users allowed to use coupon ex. all_users, registered, guests etc."
367 },
368 "user_groups": {
369 "type": "array",
370 "items": {
371 "type": "integer"
372 },
373 "description": "List of user groups for whom coupon should be applicable"
374 },
375 "exclude_user_groups": {
376 "type": "array",
377 "items": {
378 "type": "integer"
379 },
380 "description": "List of user groups for whom coupon should not be applicable"
381 },
382 "bulk_bundle": {
383 "type": "object",
384 "properties": {
385 "multi_store_allowed": {
386 "type": "boolean",
387 "description": "Multiple store allowed in bulk bundle coupon or not"
388 }
389 }
390 },
391 "coupon_allowed": {
392 "type": "boolean",
393 "description": "Whether normal coupons can be applied if bulk coupon is used."
394 },
395 "ordering_stores": {
396 "type": "array",
397 "items": {
398 "type": "integer"
399 },
400 "description": "Ordering stores for which coupon is restricted."
401 },
402 "platforms": {
403 "type": "array",
404 "items": {
405 "type": "string"
406 },
407 "description": "platforms on which coupon is applicable like web, android, ios"
408 },
409 "post_order": {
410 "type": "object",
411 "required": [
412 "cancellation_allowed",
413 "return_allowed"
414 ],
415 "properties": {
416 "return_allowed": {
417 "type": "boolean",
418 "description": "return is allowed or not on order on which the coupon is applied"
419 },
420 "cancellation_allowed": {
421 "type": "boolean",
422 "description": "cancellation is allowed or not on order on which the coupon is applied"
423 }
424 },
425 "description": "restrictions after the order is placed"
426 },
427 "price_range": {
428 "type": "object",
429 "required": [
430 "max",
431 "min"
432 ],
433 "properties": {
434 "max": {
435 "type": "number",
436 "description": "max price range of cart."
437 },
438 "min": {
439 "type": "number",
440 "description": "min price range of cart."
441 }
442 },
443 "description": "price range for the coupon"
444 },
445 "uses": {
446 "type": "object",
447 "description": "Maximum and remaining usage count for coupon used by user",
448 "required": [
449 "maximum",
450 "remaining"
451 ],
452 "properties": {
453 "maximum": {
454 "type": "object",
455 "properties": {
456 "app": {
457 "type": "number",
458 "default": -1,
459 "description": "Total number of times the coupon can be used in the app."
460 },
461 "total": {
462 "type": "number",
463 "default": -1,
464 "description": "Total number of times per user the coupon can be applied"
465 },
466 "user": {
467 "type": "number",
468 "default": -1,
469 "description": "Maximum number of times per user the coupon can be applied"
470 }
471 }
472 },
473 "remaining": {
474 "type": "object",
475 "properties": {
476 "app": {
477 "type": "number",
478 "default": -1,
479 "description": "Remaining number of times the coupon can be used in the app."
480 },
481 "total": {
482 "type": "number",
483 "default": -1,
484 "description": "total number of times the coupon applied and order placed"
485 },
486 "user": {
487 "type": "number",
488 "default": -1,
489 "description": "Uses done by the customer for the coupon"
490 }
491 },
492 "description": "Remaining coupon usage counts."
493 }
494 }
495 }
496 },
497 "description": "Restrictions for coupon usage."
498 },
499 "rule": {
500 "type": "array",
501 "items": [
502 {
503 "type": "object",
504 "required": [
505 "max",
506 "min",
507 "value"
508 ],
509 "properties": {
510 "key": {
511 "type": "number",
512 "description": "number of products bought by the customer"
513 },
514 "max": {
515 "type": "number",
516 "description": "maximum price of products bought by the customer"
517 },
518 "min": {
519 "type": "number",
520 "description": "minimum price of products bought by the customer"
521 },
522 "value": {
523 "type": "number",
524 "description": ""
525 }
526 }
527 }
528 ],
529 "description": "Rules to be applied on coupon code i.e payment restriction, cart value, etc."
530 },
531 "rule_definition": {
532 "type": "object",
533 "required": [
534 "value_type",
535 "type",
536 "scope",
537 "is_exact",
538 "currency_code",
539 "calculate_on",
540 "auto_apply",
541 "applicable_on"
542 ],
543 "properties": {
544 "applicable_on": {
545 "type": "string",
546 "description": "On which the coupon is applicable like quantity, amount etc."
547 },
548 "auto_apply": {
549 "type": "boolean",
550 "description": "If coupon can be auto applied or not."
551 },
552 "calculate_on": {
553 "type": "string",
554 "description": "product field on which the coupon calculation happens like esp or mrp"
555 },
556 "currency_code": {
557 "type": "string",
558 "description": "currency code"
559 },
560 "is_exact": {
561 "type": "boolean",
562 "description": ""
563 },
564 "scope": {
565 "type": "array",
566 "items": {
567 "type": "string"
568 },
569 "description": ""
570 },
571 "type": {
572 "type": "string",
573 "description": "Display type of the coupon"
574 },
575 "value_type": {
576 "type": "string",
577 "description": "Exact type of the coupon"
578 }
579 },
580 "description": "rule defination of the coupon"
581 },
582 "state": {
583 "type": "object",
584 "required": [
585 "is_archived",
586 "is_display",
587 "is_public"
588 ],
589 "properties": {
590 "is_archived": {
591 "type": "boolean",
592 "description": "Defines coupon is active or not"
593 },
594 "is_display": {
595 "type": "boolean",
596 "description": "Defines coupon to be displayed in coupon list"
597 },
598 "is_public": {
599 "type": "boolean",
600 "description": "Defines if the coupon is public or not"
601 }
602 },
603 "description": "current state of the coupon"
604 },
605 "tags": {
606 "type": "array",
607 "items": [
608 {
609 "type": "string"
610 }
611 ],
612 "description": "Identify a coupon through tags"
613 },
614 "filter_tags": {
615 "type": "array",
616 "default": [],
617 "description": "Tags used to filter coupons in list APIs",
618 "items": {
619 "type": "string"
620 }
621 },
622 "type_slug": {
623 "type": "string",
624 "description": "coupon type"
625 },
626 "validation": {
627 "type": "object",
628 "required": [
629 "app_id",
630 "user_registered_after"
631 ],
632 "properties": {
633 "anonymous": {
634 "type": "boolean",
635 "description": "coupon applicable to anonymous user or not"
636 },
637 "app_id": {
638 "type": "array",
639 "items": [
640 {
641 "type": "string"
642 }
643 ],
644 "description": "application/sales channel for which the coupon is created"
645 },
646 "user_registered_after": {
647 "type": [
648 "null",
649 "string"
650 ],
651 "description": "If coupon is for registered user then after which date user is registered on that coupon will apply"
652 }
653 },
654 "description": "Coupon validations"
655 },
656 "validity": {
657 "type": "object",
658 "required": [
659 "priority"
660 ],
661 "properties": {
662 "priority": {
663 "type": "number",
664 "description": "priority of the coupon"
665 }
666 },
667 "description": "validity of the coupon"
668 },
669 "_schedule": {
670 "type": "object",
671 "properties": {
672 "cron": {
673 "type": [
674 "null",
675 "string"
676 ],
677 "description": "cron string of the coupon, if coupon is created periodically"
678 },
679 "duration": {
680 "type": [
681 "null",
682 "number"
683 ],
684 "description": "For how much time coupon can be active"
685 },
686 "end": {
687 "type": [
688 "null",
689 "string"
690 ],
691 "description": "When should coupon should stop applying to user"
692 },
693 "next_schedule": {
694 "type": "array",
695 "items": {
696 "type": "object",
697 "required": [
698 "start",
699 "end"
700 ],
701 "properties": {
702 "start": {
703 "type": [
704 "null",
705 "string"
706 ],
707 "description": "start time of the coupon to be live"
708 },
709 "end": {
710 "type": [
711 "null",
712 "string"
713 ],
714 "description": "end time of the coupon to be live"
715 }
716 },
717 "description": "next schedule of the coupon"
718 }
719 },
720 "status": {
721 "type": "string",
722 "enum": [
723 "draft",
724 "review",
725 "rejected",
726 "approved"
727 ],
728 "description": "Status of the coupon."
729 },
730 "start": {
731 "type": [
732 "null",
733 "string"
734 ]
735 }
736 },
737 "description": "schedule of the coupon"
738 },
739 "coupon_type": {
740 "type": "string",
741 "description": "Type of the coupon.",
742 "enum": [
743 "bulk",
744 "single"
745 ]
746 },
747 "is_exclusive_coupon": {
748 "type": "boolean",
749 "description": "If this coupon is exclusive, no other promotions can be applied."
750 },
751 "coupon_prefix": {
752 "type": "string",
753 "description": "Prefix added at the start of every bulk generated coupon code."
754 },
755 "coupon_counts": {
756 "type": "integer",
757 "description": "Number of coupon codes to generate for bulk coupon creation defaults to 1 for single coupons."
758 }
759 }
760 }
761 }
762 }
763 }
764}
Payload Example
1{
2 "application_id": "65f834e526be5a568ecdb3df",
3 "company_id": 7084,
4 "contains": [
5 "coupon"
6 ],
7 "event": {
8 "category": "application",
9 "created_timestamp": 1711106635525,
10 "id": "sjOC45ZdeB5xNnfbb++qBE/MmFFxJ8HrT28p9bUyZlw=",
11 "name": "coupon",
12 "trace_id": [
13 "megatron.23901d1a-62bb-4156-b333-d4c1f455ef43"
14 ],
15 "type": "create",
16 "version": "1"
17 },
18 "payload": {
19 "coupon": {
20 "_schedule": {
21 "cron": null,
22 "duration": null,
23 "end": null,
24 "next_schedule": [
25 {
26 "end": null,
27 "start": "2024-03-22T11:23:51.854000+00:00"
28 }
29 ],
30 "start": "2024-03-22T11:23:51.854000+00:00"
31 },
32 "action": {
33 "action_date": null,
34 "txn_mode": "coupon"
35 },
36 "author": {
37 "created_by": "00b72455245370605c35ee80",
38 "modified_by": "00b72455245370605c35ee80"
39 },
40 "code": "wde",
41 "date_meta": {
42 "created_on": "2024-03-22T11:23:55.506888+00:00",
43 "modified_on": "2024-03-22T11:23:55.506888+00:00"
44 },
45 "display_meta": {
46 "apply": {
47 "subtitle": "",
48 "title": "Coupon applied successfully"
49 },
50 "auto": {
51 "subtitle": "",
52 "title": ""
53 },
54 "description": "",
55 "remove": {
56 "subtitle": "",
57 "title": ""
58 },
59 "subtitle": "wdsa",
60 "title": "23"
61 },
62 "identifiers": {
63 "brand_id": [
64 5989
65 ],
66 "user_id": []
67 },
68 "ownership": {
69 "payable_by": "",
70 "payable_category": "seller"
71 },
72 "restrictions": {
73 "ordering_stores": [],
74 "platforms": [
75 "web",
76 "android",
77 "ios"
78 ],
79 "post_order": {
80 "cancellation_allowed": true,
81 "return_allowed": true
82 },
83 "price_range": {
84 "max": -1,
85 "min": -1
86 },
87 "uses": {
88 "maximum": {
89 "app": -1,
90 "total": -1,
91 "user": -1
92 },
93 "remaining": {
94 "app": -1,
95 "total": -1,
96 "user": -1
97 }
98 }
99 },
100 "rule": [
101 {
102 "key": 1,
103 "max": 3,
104 "min": 2,
105 "value": 3
106 }
107 ],
108 "rule_definition": {
109 "applicable_on": "quantity",
110 "auto_apply": false,
111 "calculate_on": "esp",
112 "currency_code": "INR",
113 "is_exact": true,
114 "scope": [
115 "brand_id"
116 ],
117 "type": "bundle",
118 "value_type": "percentage"
119 },
120 "state": {
121 "is_archived": false,
122 "is_display": true,
123 "is_public": true
124 },
125 "tags": [
126 "platform"
127 ],
128 "type_slug": "bundle_quantity_percentage",
129 "validation": {
130 "anonymous": true,
131 "app_id": [
132 "65f834e526be5a568ecdb3df"
133 ],
134 "user_registered_after": null
135 },
136 "validity": {
137 "priority": 0
138 }
139 }
140 }
141}

Coupon/coupon/update/v1

this event is triggered when coupon is updated

Payload
Hide
This event is triggered when coupon is updated.
application_id
array|string
Required
Application/sales channel ID for which this event is triggered
company_id
integer
Required
company ID for which this event is triggered
contains
array of string
Required
This array will have all the keys present at root level of 'payload' object
event
object
Required
This contains event data like name and type of event.
Show
payload
object
Required
The payload data of event.
Show
Payload Schema JSON
1{
2 "type": "object",
3 "description": "This event is triggered when coupon is updated.",
4 "required": [
5 "company_id",
6 "contains",
7 "event",
8 "payload",
9 "application_id"
10 ],
11 "properties": {
12 "application_id": {
13 "type": [
14 "array",
15 "string"
16 ],
17 "description": "Application/sales channel ID for which this event is triggered"
18 },
19 "company_id": {
20 "type": "integer",
21 "description": "company ID for which this event is triggered"
22 },
23 "contains": {
24 "type": "array",
25 "description": "This array will have all the keys present at root level of 'payload' object",
26 "items": {
27 "type": "string"
28 }
29 },
30 "event": {
31 "type": "object",
32 "description": "This contains event data like name and type of event.",
33 "required": [
34 "category",
35 "created_timestamp",
36 "id",
37 "name",
38 "trace_id",
39 "type",
40 "version"
41 ],
42 "properties": {
43 "category": {
44 "type": "string",
45 "description": "category of the event. If it is at sales channel level or company level"
46 },
47 "created_timestamp": {
48 "type": "integer",
49 "description": "event generation timestamp in epoch milliseconds"
50 },
51 "id": {
52 "type": "string",
53 "description": "Unique ID for an event. This id can be used to verifiy if event is already processed by receiver"
54 },
55 "name": {
56 "type": "string",
57 "description": "Name of the event"
58 },
59 "trace_id": {
60 "type": "array",
61 "description": "internal trace_id for Fynd Platform services",
62 "items": {
63 "type": "string"
64 }
65 },
66 "type": {
67 "type": "string",
68 "description": "Type/Action of the event. e.g. create/update/delete"
69 },
70 "version": {
71 "type": "string",
72 "description": "Version of the event."
73 }
74 }
75 },
76 "payload": {
77 "type": "object",
78 "description": "The payload data of event.",
79 "required": [
80 "coupon"
81 ],
82 "properties": {
83 "coupon": {
84 "type": "object",
85 "required": [
86 "author",
87 "code",
88 "date_meta",
89 "display_meta",
90 "identifiers",
91 "ownership",
92 "restrictions",
93 "rule",
94 "rule_definition",
95 "state",
96 "tags",
97 "type_slug",
98 "validation",
99 "validity",
100 "_schedule"
101 ],
102 "properties": {
103 "action": {
104 "type": "object",
105 "required": [
106 "action_date",
107 "txn_mode"
108 ],
109 "properties": {
110 "action_date": {
111 "type": [
112 "null",
113 "string"
114 ],
115 "description": "action date to start coupon actions required in case of txn_mode is not coupon"
116 },
117 "txn_mode": {
118 "type": "string",
119 "description": "txn mode of the coupon like coupon"
120 }
121 },
122 "description": "action details of coupon"
123 },
124 "author": {
125 "type": "object",
126 "additionalProperties": true,
127 "required": [
128 "modified_by",
129 "created_by"
130 ],
131 "properties": {
132 "created_by": {
133 "type": "string",
134 "description": "user id by whom the coupon created"
135 },
136 "modified_by": {
137 "type": "string",
138 "description": "user id by whom the coupon modified"
139 },
140 "rejected_by": {
141 "type": [
142 "string",
143 "null"
144 ],
145 "description": "The user id of user, who has rejected the coupon",
146 "nullable": true
147 },
148 "approved_by": {
149 "type": [
150 "string",
151 "null"
152 ],
153 "description": "The user id of user, who has approved the coupon",
154 "nullable": true
155 },
156 "reviewed_by": {
157 "type": [
158 "string",
159 "null"
160 ],
161 "description": "The user id of user who has reviewed the coupon.",
162 "nullable": true
163 }
164 },
165 "description": "author details of the coupon"
166 },
167 "code": {
168 "type": "string",
169 "description": "Coupon unique code"
170 },
171 "date_meta": {
172 "type": "object",
173 "additionalProperties": true,
174 "properties": {
175 "created_on": {
176 "type": [
177 "string",
178 "null"
179 ],
180 "description": "Timestamp on which the coupon was created"
181 },
182 "modified_on": {
183 "type": [
184 "string",
185 "null"
186 ],
187 "description": "Timestamp on which the coupon was modified"
188 }
189 },
190 "description": "date details of coupon"
191 },
192 "display_meta": {
193 "type": "object",
194 "required": [],
195 "properties": {
196 "apply": {
197 "type": "object",
198 "required": [
199 "title",
200 "subtitle"
201 ],
202 "properties": {
203 "subtitle": {
204 "type": "string",
205 "description": "apply message subtitle of the coupon"
206 },
207 "title": {
208 "type": "string",
209 "description": "title message of the coupon"
210 }
211 },
212 "description": "apply message details of the coupon"
213 },
214 "auto": {
215 "type": "object",
216 "required": [
217 "title",
218 "subtitle"
219 ],
220 "properties": {
221 "subtitle": {
222 "type": "string",
223 "description": "auto apply subtitle of the coupon"
224 },
225 "title": {
226 "type": "string",
227 "description": "auto apply title of the coupon"
228 }
229 },
230 "description": "auto apply details of the coupon"
231 },
232 "description": {
233 "type": "string",
234 "description": "Description of the coupon"
235 },
236 "remove": {
237 "type": "object",
238 "required": [
239 "title",
240 "subtitle"
241 ],
242 "properties": {
243 "subtitle": {
244 "type": "string",
245 "description": "remove subtitle of the coupon"
246 },
247 "title": {
248 "type": "string",
249 "description": "remove title of the coupon"
250 }
251 },
252 "description": "Remove details of the coupon"
253 },
254 "subtitle": {
255 "type": "string",
256 "description": "subtitle of the coupon"
257 },
258 "title": {
259 "type": "string",
260 "description": "title of the coupon"
261 }
262 },
263 "description": "display details of the coupon"
264 },
265 "identifiers": {
266 "type": "object",
267 "required": [],
268 "properties": {
269 "exclude_brand_id": {
270 "type": "array",
271 "description": "This brand ids will be excluded while applying coupon.",
272 "items": {
273 "type": "integer"
274 }
275 },
276 "brand_id": {
277 "type": "array",
278 "description": "The brand ids on which coupon will be applied.",
279 "items": {
280 "type": "integer"
281 }
282 },
283 "item_id": {
284 "type": "array",
285 "description": "The item ids on which coupon will be applied.",
286 "items": {
287 "type": "integer"
288 }
289 },
290 "company_id": {
291 "type": "array",
292 "description": "The company ids on which coupon will be applied.",
293 "items": {
294 "type": "integer"
295 }
296 },
297 "article_id": {
298 "type": "array",
299 "description": "The article ids on which coupon will be applied.",
300 "items": {
301 "type": "integer"
302 }
303 },
304 "store_id": {
305 "type": "array",
306 "description": "The store ids on which coupon will be applied.",
307 "items": {
308 "type": "integer"
309 }
310 },
311 "collection_id": {
312 "type": "array",
313 "description": "Coupon will be applied on mentioned collection ids products.",
314 "items": {
315 "type": "string"
316 }
317 },
318 "category_id": {
319 "type": "array",
320 "description": "The category ids on which coupon will be applied.",
321 "items": {
322 "type": "integer"
323 }
324 },
325 "user_id": {
326 "type": "array",
327 "description": "The user ids for which this coupon will be usable.",
328 "items": {
329 "type": "string"
330 }
331 }
332 },
333 "description": "condition fields of the coupon"
334 },
335 "ownership": {
336 "type": "object",
337 "required": [
338 "payable_by",
339 "payable_category"
340 ],
341 "properties": {
342 "payable_by": {
343 "type": "string",
344 "description": "user id for who will pay the amount discounted by coupon"
345 },
346 "payable_category": {
347 "type": "string",
348 "description": "user category for who will pay the amount discounted by coupon"
349 }
350 },
351 "description": "Ownership details of the coupon"
352 },
353 "restrictions": {
354 "type": "object",
355 "required": [
356 "platforms",
357 "post_order",
358 "uses"
359 ],
360 "properties": {
361 "user_type": {
362 "type": "string",
363 "description": "Type of the users allowed to use coupon ex. all_users, registered, guests etc."
364 },
365 "user_groups": {
366 "type": "array",
367 "items": {
368 "type": "integer"
369 },
370 "description": "List of user groups for whom coupon should be applicable"
371 },
372 "exclude_user_groups": {
373 "type": "array",
374 "items": {
375 "type": "integer"
376 },
377 "description": "List of user groups for whom coupon should not be applicable"
378 },
379 "ordering_stores": {
380 "type": "array",
381 "items": {
382 "type": "integer"
383 },
384 "description": "Ordering stores for which coupon is restricted."
385 },
386 "platforms": {
387 "type": "array",
388 "items": {
389 "type": "string"
390 },
391 "description": "platforms on which coupon is applicable like web, android, ios"
392 },
393 "post_order": {
394 "type": "object",
395 "required": [
396 "cancellation_allowed",
397 "return_allowed"
398 ],
399 "properties": {
400 "return_allowed": {
401 "type": "boolean",
402 "description": "return is allowed or not on order on which the coupon is applied"
403 },
404 "cancellation_allowed": {
405 "type": "boolean",
406 "description": "cancellation is allowed or not on order on which the coupon is applied"
407 }
408 },
409 "description": "restrictions after the order is placed"
410 },
411 "price_range": {
412 "type": "object",
413 "required": [
414 "max",
415 "min"
416 ],
417 "properties": {
418 "max": {
419 "type": "number",
420 "description": "max price range of cart."
421 },
422 "min": {
423 "type": "number",
424 "description": "min price range of cart."
425 }
426 },
427 "description": "price range for the coupon"
428 },
429 "uses": {
430 "type": "object",
431 "description": "Maximum and remaining Usage count for coupon used by user.",
432 "required": [
433 "maximum",
434 "remaining"
435 ],
436 "properties": {
437 "maximum": {
438 "type": "object",
439 "properties": {
440 "app": {
441 "type": "number",
442 "default": -1,
443 "description": "Total number of count for coupon usages in app"
444 },
445 "total": {
446 "type": "number",
447 "default": -1,
448 "description": "Total number of times per user the coupon can be applied"
449 },
450 "user": {
451 "type": "number",
452 "default": -1,
453 "description": "Maximum number of times per user the coupon can be applied"
454 }
455 }
456 },
457 "remaining": {
458 "type": "object",
459 "properties": {
460 "app": {
461 "type": "number",
462 "default": -1,
463 "description": "Remained number of count for coupon usages in app"
464 },
465 "total": {
466 "type": "number",
467 "default": -1,
468 "description": "total number of times the coupon applied and order placed"
469 },
470 "user": {
471 "type": "number",
472 "default": -1,
473 "description": "Uses done by the customer for the coupon"
474 }
475 }
476 }
477 }
478 }
479 },
480 "description": "Restrictions for coupon usage"
481 },
482 "rule": {
483 "type": "array",
484 "items": [
485 {
486 "type": "object",
487 "required": [
488 "max",
489 "min"
490 ],
491 "properties": {
492 "key": {
493 "type": "number",
494 "description": "number of products bought by the customer"
495 },
496 "max": {
497 "type": "number",
498 "description": "maximum price of products bought by the customer"
499 },
500 "min": {
501 "type": "number",
502 "description": "minimum price of products bought by the customer"
503 },
504 "value": {
505 "type": "number",
506 "description": ""
507 }
508 }
509 }
510 ],
511 "description": "Rules to be applied on coupon code i.e payment restriction, cart value, etc."
512 },
513 "rule_definition": {
514 "type": "object",
515 "required": [
516 "value_type",
517 "type",
518 "scope",
519 "is_exact",
520 "currency_code",
521 "calculate_on",
522 "auto_apply",
523 "applicable_on"
524 ],
525 "properties": {
526 "applicable_on": {
527 "type": "string",
528 "description": "On which the coupon is applicable like quantity, amount etc."
529 },
530 "auto_apply": {
531 "type": "boolean",
532 "description": "If coupon can be auto applied or not."
533 },
534 "calculate_on": {
535 "type": "string",
536 "description": "product field on which the coupon calculation happens like esp or mrp"
537 },
538 "currency_code": {
539 "type": "string",
540 "description": "currency code"
541 },
542 "is_exact": {
543 "type": "boolean",
544 "description": ""
545 },
546 "scope": {
547 "type": "array",
548 "items": {
549 "type": "string"
550 },
551 "description": ""
552 },
553 "type": {
554 "type": "string",
555 "description": "Display type of the coupon"
556 },
557 "value_type": {
558 "type": "string",
559 "description": "Exact type of the coupon"
560 }
561 },
562 "description": "rule defination of the coupon"
563 },
564 "state": {
565 "type": "object",
566 "required": [
567 "is_archived",
568 "is_display",
569 "is_public"
570 ],
571 "properties": {
572 "is_archived": {
573 "type": "boolean",
574 "description": "Defines coupon is active or not"
575 },
576 "is_display": {
577 "type": "boolean",
578 "description": "Defines coupon to be displayed in coupon list"
579 },
580 "is_public": {
581 "type": "boolean",
582 "description": "Defines if the coupon is public or not"
583 }
584 },
585 "description": "current state of the coupon"
586 },
587 "tags": {
588 "type": "array",
589 "items": [
590 {
591 "type": "string"
592 }
593 ],
594 "description": "Identify a coupon through tags"
595 },
596 "filter_tags": {
597 "type": "array",
598 "default": [],
599 "description": "Tags used to filter coupons in list APIs",
600 "items": {
601 "type": "string"
602 }
603 },
604 "type_slug": {
605 "type": "string",
606 "description": "coupon type"
607 },
608 "validation": {
609 "type": "object",
610 "required": [
611 "app_id",
612 "user_registered_after"
613 ],
614 "properties": {
615 "anonymous": {
616 "type": "boolean",
617 "description": "coupon applicable to anonymous user or not"
618 },
619 "app_id": {
620 "type": "array",
621 "items": [
622 {
623 "type": "string"
624 }
625 ],
626 "description": "application/sales channel for which the coupon is created"
627 },
628 "user_registered_after": {
629 "type": [
630 "null",
631 "string"
632 ],
633 "description": "If coupon is for registered user then after which date user is registered on that coupon will apply"
634 }
635 },
636 "description": "Coupon validations"
637 },
638 "validity": {
639 "type": "object",
640 "required": [
641 "priority"
642 ],
643 "properties": {
644 "priority": {
645 "type": "number",
646 "description": "priority of the coupon"
647 }
648 },
649 "description": "validity of the coupon"
650 },
651 "_schedule": {
652 "type": "object",
653 "properties": {
654 "cron": {
655 "type": [
656 "null",
657 "string"
658 ],
659 "description": "cron string of the coupon, if coupon is created periodically"
660 },
661 "duration": {
662 "type": [
663 "null",
664 "number"
665 ],
666 "description": "For how much time coupon can be active"
667 },
668 "end": {
669 "type": [
670 "null",
671 "string"
672 ],
673 "description": "When should coupon should stop applying to user"
674 },
675 "next_schedule": {
676 "type": "array",
677 "items": {
678 "type": "object",
679 "required": [
680 "start",
681 "end"
682 ],
683 "properties": {
684 "start": {
685 "type": [
686 "null",
687 "string"
688 ],
689 "description": "start time of the coupon to be live"
690 },
691 "end": {
692 "type": [
693 "null",
694 "string"
695 ],
696 "description": "end time of the coupon to be live"
697 }
698 },
699 "description": "next schedule of the coupon"
700 }
701 },
702 "status": {
703 "type": "string",
704 "enum": [
705 "draft",
706 "review",
707 "rejected",
708 "approved"
709 ],
710 "description": "Status of the coupon."
711 },
712 "start": {
713 "type": [
714 "null",
715 "string"
716 ]
717 }
718 },
719 "description": "schedule of the coupon"
720 }
721 }
722 }
723 }
724 }
725 }
726}
Payload Example
1{
2 "event": {
3 "trace_id": [
4 "megatron.046425af-2190-4026-aa80-3f589ca416e2"
5 ],
6 "name": "coupon",
7 "type": "update",
8 "version": "1",
9 "created_timestamp": 1711614375492,
10 "id": "UDu6EWAkiYjeUbl5KHLYXgdoBBVHKV69QnRpZWXpuIg=",
11 "category": "application"
12 },
13 "company_id": 327,
14 "application_id": "60744d605bdf7f6a00a86ff9",
15 "contains": [
16 "coupon"
17 ],
18 "payload": {
19 "coupon": {
20 "state": {
21 "is_archived": false,
22 "is_public": true,
23 "is_display": false
24 },
25 "action": {
26 "action_date": null,
27 "txn_mode": "coupon"
28 },
29 "rule": [
30 {
31 "min": 0,
32 "key": 1,
33 "value": 3000,
34 "max": 0
35 }
36 ],
37 "type_slug": "absolute_quantity_absolute",
38 "display_meta": {
39 "remove": {
40 "title": "",
41 "subtitle": ""
42 },
43 "subtitle": "ICC",
44 "description": "",
45 "auto": {
46 "title": "",
47 "subtitle": ""
48 },
49 "apply": {
50 "title": "Coupon applied successfully",
51 "subtitle": ""
52 },
53 "title": "ICC"
54 },
55 "ownership": {
56 "payable_by": "",
57 "payable_category": "seller"
58 },
59 "date_meta": {
60 "modified_on": "2024-03-28T08:26:15.474938+00:00",
61 "created_on": "2024-03-28T08:21:17.516000+00:00"
62 },
63 "rule_definition": {
64 "value_type": "absolute",
65 "scope": [
66 "brand_id"
67 ],
68 "auto_apply": false,
69 "type": "absolute",
70 "applicable_on": "quantity",
71 "currency_code": "INR",
72 "calculate_on": "esp",
73 "is_exact": false
74 },
75 "tags": [
76 "platform"
77 ],
78 "author": {
79 "modified_by": "be93d7a0639c8de35f2367b3",
80 "created_by": "be93d7a0639c8de35f2367b3"
81 },
82 "_schedule": {
83 "duration": null,
84 "cron": null,
85 "next_schedule": [
86 {
87 "start": "2024-03-28T08:21:06.072000+00:00",
88 "end": null
89 }
90 ],
91 "start": "2024-03-28T08:21:06.072000+00:00",
92 "end": null
93 },
94 "validation": {
95 "user_registered_after": null,
96 "app_id": [
97 "60744d605bdf7f6a00a86ff9"
98 ],
99 "anonymous": false
100 },
101 "identifiers": {
102 "brand_id": [
103 509,
104 4445
105 ],
106 "user_id": []
107 },
108 "code": "urnishac1",
109 "restrictions": {
110 "post_order": {
111 "cancellation_allowed": true,
112 "return_allowed": false
113 },
114 "ordering_stores": [],
115 "uses": {
116 "remaining": {
117 "app": -1,
118 "user": -1,
119 "total": 1
120 },
121 "maximum": {
122 "app": -1,
123 "user": -1,
124 "total": 1
125 }
126 },
127 "platforms": [
128 "web",
129 "android",
130 "ios"
131 ],
132 "price_range": {
133 "max": -1,
134 "min": -1
135 }
136 },
137 "validity": {
138 "priority": 0
139 }
140 }
141 }
142}

Coupon/coupon/redeem/v1

this event is triggered when coupon is redeemed

Payload
Hide
This event is triggered when coupon is redeemed.
application_id
array|string
Required
Application/sales channel ID for which this event is triggered
company_id
integer
Required
company ID for which this event is triggered
contains
array of string
Required
This array will have all the keys present at root level of 'payload' object
event
object
Required
This contains event data like name and type of event.
Show
payload
object
Required
The payload data of event.
Show
Payload Schema JSON
1{
2 "type": "object",
3 "description": "This event is triggered when coupon is redeemed.",
4 "required": [
5 "company_id",
6 "contains",
7 "event",
8 "payload",
9 "application_id"
10 ],
11 "properties": {
12 "application_id": {
13 "type": [
14 "array",
15 "string"
16 ],
17 "description": "Application/sales channel ID for which this event is triggered"
18 },
19 "company_id": {
20 "type": "integer",
21 "description": "company ID for which this event is triggered"
22 },
23 "contains": {
24 "type": "array",
25 "description": "This array will have all the keys present at root level of 'payload' object",
26 "items": {
27 "type": "string"
28 }
29 },
30 "event": {
31 "type": "object",
32 "description": "This contains event data like name and type of event.",
33 "required": [
34 "category",
35 "created_timestamp",
36 "id",
37 "name",
38 "trace_id",
39 "type",
40 "version"
41 ],
42 "properties": {
43 "category": {
44 "type": "string",
45 "description": "category of the event. If it is at sales channel level or company level"
46 },
47 "created_timestamp": {
48 "type": "integer",
49 "description": "event generation timestamp in epoch milliseconds"
50 },
51 "id": {
52 "type": "string",
53 "description": "Unique ID for an event. This id can be used to verifiy if event is already processed by receiver"
54 },
55 "name": {
56 "type": "string",
57 "description": "Name of the event"
58 },
59 "trace_id": {
60 "type": "array",
61 "description": "internal trace_id for Fynd Platform services",
62 "items": {
63 "type": "string"
64 }
65 },
66 "type": {
67 "type": "string",
68 "description": "Type/Action of the event. e.g. create/update/delete"
69 },
70 "version": {
71 "type": "string",
72 "description": "Version of the event."
73 }
74 }
75 },
76 "payload": {
77 "type": "object",
78 "description": "The payload data of event.",
79 "required": [
80 "coupon"
81 ],
82 "properties": {
83 "coupon": {
84 "type": "object",
85 "description": "Coupon key contains coupon data and coupon value.",
86 "required": [
87 "cart_id",
88 "coupon_value",
89 "coupon"
90 ],
91 "properties": {
92 "coupon": {
93 "type": "object",
94 "description": "Coupon date consisting data like code and coupon fields.",
95 "required": [
96 "code",
97 "_id",
98 "_schedule",
99 "type_slug",
100 "rule_definition",
101 "date_meta",
102 "state",
103 "validation",
104 "action",
105 "restrictions",
106 "validity",
107 "display_meta",
108 "ownership",
109 "identifiers",
110 "author",
111 "rule"
112 ],
113 "properties": {
114 "_id": {
115 "type": "string",
116 "description": "Unique identification for the coupon"
117 },
118 "code": {
119 "type": "string",
120 "description": "Coupon unique code"
121 },
122 "rule": {
123 "type": "array",
124 "items": {
125 "type": "object"
126 },
127 "description": "Rules to be applied on coupon code i.e payment restriction, cart value, etc."
128 },
129 "tags": {
130 "type": "array",
131 "items": {
132 "type": "string"
133 },
134 "description": "Identify a coupon through tags"
135 },
136 "filter_tags": {
137 "type": "array",
138 "default": [],
139 "description": "Tags used to filter coupons in list APIs",
140 "items": {
141 "type": "string"
142 }
143 },
144 "state": {
145 "type": "object",
146 "description": "current state of the coupon"
147 },
148 "action": {
149 "type": "object",
150 "description": "action details of coupon"
151 },
152 "author": {
153 "type": "object",
154 "additionalProperties": true,
155 "required": [
156 "modified_by",
157 "created_by"
158 ],
159 "properties": {
160 "created_by": {
161 "type": "string",
162 "description": "user id by whom the coupon created"
163 },
164 "modified_by": {
165 "type": "string",
166 "description": "user id by whom the coupon modified"
167 },
168 "rejected_by": {
169 "type": [
170 "string",
171 "null"
172 ],
173 "description": "The user id of user, who has rejected the coupon",
174 "nullable": true
175 },
176 "approved_by": {
177 "type": [
178 "string",
179 "null"
180 ],
181 "description": "The user id of user, who has approved the coupon",
182 "nullable": true
183 },
184 "reviewed_by": {
185 "type": [
186 "string",
187 "null"
188 ],
189 "description": "The user id of user who has reviewed the coupon.",
190 "nullable": true
191 }
192 },
193 "description": "author details of the coupon"
194 },
195 "_source": {
196 "type": "object",
197 "description": "source of the coupon"
198 },
199 "validity": {
200 "type": "object",
201 "description": "validity of the coupon"
202 },
203 "_schedule": {
204 "type": "object",
205 "description": "schedule of the coupon",
206 "properties": {
207 "status": {
208 "type": "string",
209 "enum": [
210 "draft",
211 "review",
212 "rejected",
213 "approved"
214 ],
215 "description": "Status of the coupon"
216 }
217 }
218 },
219 "date_meta": {
220 "type": "object",
221 "additionalProperties": true,
222 "properties": {
223 "created_on": {
224 "type": [
225 "string",
226 "null"
227 ],
228 "description": "Timestamp on which the coupon was created"
229 },
230 "modified_on": {
231 "type": [
232 "string",
233 "null"
234 ],
235 "description": "Timestamp on which the coupon was modified"
236 },
237 "rejected_on": {
238 "type": [
239 "string",
240 "null"
241 ],
242 "description": "Timestamp on which the coupon was rejected",
243 "format": "date-time"
244 },
245 "approved_on": {
246 "type": [
247 "string",
248 "null"
249 ],
250 "description": "Timestamp on which the coupon was approved",
251 "format": "date-time"
252 },
253 "reviewed_on": {
254 "type": [
255 "string",
256 "null"
257 ],
258 "description": "Timestamp on which the coupon was reviewed",
259 "format": "date-time"
260 }
261 },
262 "description": "date details of coupon"
263 },
264 "ownership": {
265 "type": "object",
266 "required": [
267 "payable_by",
268 "payable_category"
269 ],
270 "properties": {
271 "payable_by": {
272 "type": "string",
273 "description": "user id for who will pay the amount discounted by coupon"
274 },
275 "payable_category": {
276 "type": "string",
277 "description": "user category for who will pay the amount discounted by coupon"
278 }
279 },
280 "description": "Ownership details of the coupon"
281 },
282 "type_slug": {
283 "type": "string",
284 "description": "coupon type"
285 },
286 "validation": {
287 "type": "object",
288 "required": [
289 "app_id",
290 "user_registered_after"
291 ],
292 "properties": {
293 "anonymous": {
294 "type": "boolean",
295 "description": "coupon applicable to anonymous user or not"
296 },
297 "app_id": {
298 "type": "array",
299 "items": [
300 {
301 "type": "string"
302 }
303 ],
304 "description": "application/sales channel for which the coupon is created"
305 },
306 "user_registered_after": {
307 "type": [
308 "null",
309 "string"
310 ],
311 "description": "If coupon is for registered user then after which date user is registered on that coupon will apply"
312 }
313 },
314 "description": "Coupon validations"
315 },
316 "identifiers": {
317 "type": "object",
318 "required": [],
319 "properties": {
320 "exclude_brand_id": {
321 "type": "array",
322 "description": "This brand ids will be excluded while applying coupon.",
323 "items": {
324 "type": "integer"
325 }
326 },
327 "brand_id": {
328 "type": "array",
329 "description": "The brand ids on which coupon will be applied.",
330 "items": {
331 "type": "integer"
332 }
333 },
334 "item_id": {
335 "type": "array",
336 "description": "The item ids on which coupon will be applied.",
337 "items": {
338 "type": "integer"
339 }
340 },
341 "company_id": {
342 "type": "array",
343 "description": "The company ids on which coupon will be applied.",
344 "items": {
345 "type": "integer"
346 }
347 },
348 "article_id": {
349 "type": "array",
350 "description": "The article ids on which coupon will be applied.",
351 "items": {
352 "type": "integer"
353 }
354 },
355 "store_id": {
356 "type": "array",
357 "description": "The store ids on which coupon will be applied.",
358 "items": {
359 "type": "integer"
360 }
361 },
362 "collection_id": {
363 "type": "array",
364 "description": "Coupon will be applied on mentioned collection ids products.",
365 "items": {
366 "type": "string"
367 }
368 },
369 "category_id": {
370 "type": "array",
371 "description": "The category ids on which coupon will be applied.",
372 "items": {
373 "type": "integer"
374 }
375 },
376 "user_id": {
377 "type": "array",
378 "description": "The user ids for which this coupon will be usable.",
379 "items": {
380 "type": "string"
381 }
382 }
383 },
384 "description": "condition fields of the coupon"
385 },
386 "display_meta": {
387 "type": "object",
388 "description": "display details of the coupon"
389 },
390 "restrictions": {
391 "type": "object",
392 "description": "Restrictions for coupon usage",
393 "properties": {
394 "user_type": {
395 "type": "string",
396 "description": "Type of the users allowed to use coupon ex. all_users, registered, guests etc."
397 },
398 "user_groups": {
399 "type": "array",
400 "items": {
401 "type": "integer"
402 },
403 "description": "List of user groups for whom coupon should be applicable"
404 },
405 "exclude_user_groups": {
406 "type": "array",
407 "items": {
408 "type": "integer"
409 },
410 "description": "List of user groups for whom coupon should not be applicable"
411 }
412 }
413 },
414 "rule_definition": {
415 "type": "object",
416 "required": [
417 "value_type",
418 "type",
419 "scope",
420 "is_exact",
421 "currency_code",
422 "calculate_on",
423 "auto_apply",
424 "applicable_on"
425 ],
426 "properties": {
427 "applicable_on": {
428 "type": "string",
429 "description": "On which the coupon is applicable like quantity, amount etc."
430 },
431 "auto_apply": {
432 "type": "boolean",
433 "description": "If coupon can be auto applied or not."
434 },
435 "calculate_on": {
436 "type": "string",
437 "description": "product field on which the coupon calculation happens like esp or mrp"
438 },
439 "currency_code": {
440 "type": "string",
441 "description": "currency code"
442 },
443 "is_exact": {
444 "type": "boolean",
445 "description": "When set as true then qty cap for coupon being applied will be enforced otherwise no cap for qty."
446 },
447 "scope": {
448 "type": "array",
449 "items": {
450 "type": "string"
451 },
452 "description": "Scope for coupon applicability like brand"
453 },
454 "type": {
455 "type": "string",
456 "description": "Display type of the coupon"
457 },
458 "value_type": {
459 "type": "string",
460 "description": "Exact type of the coupon"
461 }
462 },
463 "description": "rule defination of the coupon"
464 },
465 "coupon_type": {
466 "type": "string",
467 "description": "Type of the coupon",
468 "enum": [
469 "bulk",
470 "single"
471 ]
472 }
473 }
474 },
475 "cart_id": {
476 "type": "string",
477 "description": "cart id on which the coupon is redeemed"
478 },
479 "coupon_value": {
480 "type": "number",
481 "description": "coupon value applied on cart"
482 }
483 }
484 }
485 }
486 }
487 }
488}
Payload Example
1{
2 "payload": {
3 "coupon": {
4 "coupon": {
5 "ownership": {
6 "payable_by": "",
7 "payable_category": "seller"
8 },
9 "author": {
10 "modified_by": "b0057be8702ac9b07834f8b6",
11 "created_by": "da036ff02652aaa554b79d69"
12 },
13 "validation": {
14 "anonymous": false,
15 "user_registered_after": null,
16 "app_id": [
17 "000000000000000000000001"
18 ]
19 },
20 "action": {
21 "txn_mode": "coupon",
22 "action_date": null
23 },
24 "_schedule": {
25 "next_schedule": [
26 {
27 "start": "2024-01-18 12:22:03.138000",
28 "end": null
29 }
30 ],
31 "start": "2024-01-18T12:22:03.138000+00:00",
32 "end": null,
33 "cron": null,
34 "duration": null
35 },
36 "rule": [
37 {
38 "min": 10,
39 "value": 11999,
40 "max": 0,
41 "key": 1
42 }
43 ],
44 "state": {
45 "is_display": true,
46 "is_archived": false,
47 "is_public": true
48 },
49 "display_meta": {
50 "apply": {
51 "subtitle": "",
52 "title": "Coupon applied successfully"
53 },
54 "description": "",
55 "subtitle": "Testing1",
56 "remove": {
57 "subtitle": "",
58 "title": ""
59 },
60 "title": "Testing1",
61 "auto": {
62 "subtitle": "",
63 "title": ""
64 }
65 },
66 "type_slug": "absolute_quantity_absolute",
67 "rule_definition": {
68 "currency_code": "INR",
69 "value_type": "absolute",
70 "type": "absolute",
71 "auto_apply": false,
72 "is_exact": false,
73 "applicable_on": "quantity",
74 "scope": [],
75 "calculate_on": "esp"
76 },
77 "tags": [
78 "platform"
79 ],
80 "identifiers": {
81 "user_id": []
82 },
83 "_id": "65a917eb5fc8c9b0eac889af",
84 "_source": {
85 "type": "extension",
86 "id": "64b00c93c733f68edef8157b"
87 },
88 "validity": {
89 "priority": 0
90 },
91 "code": "testing1",
92 "restrictions": {
93 "ordering_stores": [],
94 "uses": {
95 "remaining": {
96 "app": -1,
97 "user": -1,
98 "total": -1
99 },
100 "maximum": {
101 "app": -1,
102 "user": -1,
103 "total": -1
104 }
105 },
106 "post_order": {
107 "return_allowed": false,
108 "cancellation_allowed": false
109 },
110 "price_range": {
111 "max": -1,
112 "min": -1
113 },
114 "payments": {
115 "wl": {
116 "networks": [],
117 "uses": {
118 "max": -1
119 },
120 "types": [],
121 "codes": []
122 },
123 "nb": {
124 "networks": [],
125 "uses": {
126 "max": -1
127 },
128 "types": [],
129 "codes": []
130 },
131 "card": {
132 "networks": [],
133 "uses": {
134 "max": -1
135 },
136 "types": [],
137 "codes": []
138 },
139 "qr": {
140 "networks": [],
141 "uses": {
142 "max": -1
143 },
144 "types": [],
145 "codes": []
146 },
147 "cod": {
148 "networks": [],
149 "uses": {
150 "max": -1
151 },
152 "types": [],
153 "codes": []
154 },
155 "pay from potlee": {
156 "networks": [],
157 "uses": {
158 "max": -1
159 },
160 "types": [],
161 "codes": []
162 },
163 "icici bank paylater": {
164 "networks": [],
165 "uses": {
166 "max": -1
167 },
168 "types": [],
169 "codes": []
170 },
171 "flexipay by hdfc bank": {
172 "networks": [],
173 "uses": {
174 "max": -1
175 },
176 "types": [],
177 "codes": []
178 },
179 "simpl": {
180 "networks": [],
181 "uses": {
182 "max": -1
183 },
184 "types": [],
185 "codes": []
186 },
187 "rupifipg": {
188 "networks": [],
189 "uses": {
190 "max": -1
191 },
192 "types": [],
193 "codes": []
194 },
195 "cardless_emi": {
196 "networks": [],
197 "uses": {
198 "max": -1
199 },
200 "types": [],
201 "codes": []
202 },
203 "cas": {
204 "networks": [],
205 "uses": {
206 "max": -1
207 },
208 "types": [],
209 "codes": []
210 },
211 "csas": {
212 "networks": [],
213 "uses": {
214 "max": -1
215 },
216 "types": [],
217 "codes": []
218 }
219 },
220 "platforms": [
221 "web",
222 "android",
223 "ios"
224 ]
225 },
226 "date_meta": {
227 "created_on": "2024-01-18T12:22:03.307000+00:00",
228 "modified_on": "2024-02-07T07:51:09.917000+00:00"
229 }
230 },
231 "coupon_value": 11999,
232 "cart_id": "985404"
233 }
234 },
235 "contains": [
236 "coupon"
237 ],
238 "event": {
239 "id": "testID",
240 "name": "coupon",
241 "type": "redeem",
242 "version": "1",
243 "category": "application",
244 "trace_id": [
245 "megatron.c1d94419-57d6-47ef-a5d5-b8829e8b4304"
246 ],
247 "created_timestamp": 1712238862735
248 },
249 "company_id": 1,
250 "application_id": "000000000000000000000001"
251}