-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathassignments-oas-v1-public.yaml
More file actions
1099 lines (1090 loc) · 44.2 KB
/
assignments-oas-v1-public.yaml
File metadata and controls
1099 lines (1090 loc) · 44.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: Assignments
version: v1
description: "# API Overview\n\nUse the Assignments API to search for promotions associated with campaigns.\n\nFor more information, see [Campaigns and Promotions](https://documentation.b2c.commercecloud.salesforce.com/DOC1/topic/com.demandware.dochelp/Promotions/CampaignsandPromotions.html) in the Salesforce B2C Commerce Infocenter.\n\n## Authentication & Authorization\n\nThe client requesting the promotion information must have access to the Promotion resource. For resource access, you must use a client ID and client secret from Account Manager to request an access token. The access token is used as a bearer token and added to the Authorization header of your API request. The client must first authenticate against Account Manager to log in.\n\nYou must include the relevant scope(s) in the client ID used to generate the token. For details, see [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html)\n\nFor detailed setup instructions, see [Authorization for Admin APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html).\n\n## Use Cases\n\n### Find All Associated Promotions\n\nUse the Assignments API to find all associated promotions for a given campaign. "
servers:
- url: https://{shortCode}.api.commercecloud.salesforce.com/pricing/assignments/v1
variables:
shortCode:
default: shortCode
paths:
/organizations/{organizationId}/assignments:
post:
summary: Search for promotion campaign assignments.
description: "The promotion campaign assignment search document contains a search object that allows filtering on various attributes.\n\nThe query attribute specifies a complex query that can be used to narrow down the search. Attributes are grouped into different buckets.\n\nThe following is a list of searchable attributes with their corresponding buckets:\n \n main:\n \n | Attribute | Type |\n |-----------|--------|\n | rank| Integer |\n | startDate | Date |\n | endDate | Date |\n \n campaign:\n \n | Attribute | Type |\n |-----------|--------|\n | campaign| String |\n \n promotion:\n \n | Attribute | Type |\n |-----------|--------|\n | promotionId| String |\n | description | String |\n | enabled | Boolean |\n \n special handling:\n \n | Attribute | Type |\n |-----------|--------|\n | couponId| String |\n\nOnly fields in the same bucket can be joined using a disjunction (or). For instance, when joining campaignId and rank, only a conjunction (and) is allowed, while promotionId and description can be joined using a disjunction because they are in the same bucket. Special handling fields must always use conjunctions. If the field is used in a disjunction that violates this rule, an exception is thrown.\n\n\nNote that only searchable attributes can be used in sorting.\n"
operationId: assignmentsSearch
parameters:
- $ref: '#/components/parameters/organizationId'
- $ref: '#/components/parameters/siteId'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SearchRequest'
responses:
'200':
description: Promotion campaign information successfully returned.
content:
application/json:
schema:
$ref: '#/components/schemas/PromotionCampaignAssignmentSearchResult'
security:
- AmOAuth2:
- sfcc.promotions
- sfcc.promotions.rw
components:
securitySchemes:
AmOAuth2:
type: oauth2
description: AccountManager OAuth 2.0 bearer token Authentication.
flows:
clientCredentials:
tokenUrl: https://account.demandware.com/dwsso/oauth2/access_token
scopes:
sfcc.promotions: promotions READONLY
sfcc.promotions.rw: promotions read/write
authorizationCode:
authorizationUrl: https://account.demandware.com/dwsso/oauth2/authorize
tokenUrl: https://account.demandware.com/dwsso/oauth2/access_token
scopes:
sfcc.promotions: promotions READONLY
sfcc.promotions.rw: promotions read/write
schemas:
OrganizationId:
description: An identifier for the organization the request is being made by
example: f_ecom_zzxy_prd
type: string
minLength: 1
maxLength: 32
SiteId:
minLength: 1
maxLength: 32
description: The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites
example: RefArch
type: string
Limit:
default: 10
minimum: 1
format: int32
description: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
type: integer
example: 10
Query:
minProperties: 1
maxProperties: 1
description: |-
A set of objects that define criteria used to select records. A query can contain one of the following:
* `MatchAllQuery`
- Matches all documents.
* `TermQuery`
- Matches one or more documents against one or more document fields.
* `TextQuery`
- Matches text against one or more fields.
* `BoolQuery`
- Allows construction of a logical expression of multiple queries.
* `FilteredQuery`
- Allows a filter to be applied to a query.
* `NestedQuery`
- Allows you to query on nested documents.
- _Only supported by some Commerce APIs. For more details, see the endpoint descriptions in the API documentation._
example:
filteredQuery:
query:
textQuery:
fields:
- couponId
searchPhrase: disabled
filter:
termFilter:
field: enabled
operator: is
values:
- false
type: object
properties:
boolQuery:
$ref: '#/components/schemas/BoolQuery'
filteredQuery:
$ref: '#/components/schemas/FilteredQuery'
matchAllQuery:
$ref: '#/components/schemas/MatchAllQuery'
nestedQuery:
$ref: '#/components/schemas/NestedQuery'
termQuery:
$ref: '#/components/schemas/TermQuery'
textQuery:
$ref: '#/components/schemas/TextQuery'
additionalProperties: false
BoolQuery:
description: "A boolean query allows construction of full logical expression trees that are composed of other queries (usually term queries and text queries). A boolean query has three sets of clauses:\n \n - `must`, which combines as an `AND` operator.\n - `should`, which combines as an `OR` operator.\n - `must_not`, which combines as a `NOT` operator.\n \nIf `must`, `mustNot`, or `should` appear in the same boolean query, they are combined logically using the `AND` operator. For example:\n\n (must-1 AND must-1 AND ...)\n AND (should-1 OR should-2 OR ...)\n AND NOT (must_not-1 OR must_not-2 OR ...)\n"
type: object
example:
value:
must:
- textQuery:
fields:
- couponId
searchPhrase: DEAL
- textQuery:
fields:
- description
searchPhrase: Big bargain deal
mustNot:
- termQuery:
fields:
- enabled
operator: is
values:
- false
properties:
must:
description: List of queries to be evaluated as an `AND` operator.
type: array
items:
$ref: '#/components/schemas/Query'
mustNot:
description: List of queries to be evaluated as a `NOT` operator.
type: array
items:
$ref: '#/components/schemas/Query'
should:
description: List of queries to be evaluated as an `OR` operator.
type: array
items:
$ref: '#/components/schemas/Query'
additionalProperties: false
Filter:
minProperties: 1
maxProperties: 1
description: |-
Contains a set of objects that define criteria used to select records. A filter can contain one of the following:
* `TermFilter`
- Matches records where a field (or fields) exactly matches some simple value (including `null`).
* `RangeFilter`
- Matches records where a field value lies within a specified range.
* `Range2Filter`
- Matches records in a specified range across fields.
* `QueryFilter`
- Matches records based on a query.
* `BoolFilter`
- Provides filtering of records using a set of filters combined using a logical operator.
example: null
type: object
properties:
boolFilter:
$ref: '#/components/schemas/BoolFilter'
queryFilter:
$ref: '#/components/schemas/QueryFilter'
range2Filter:
$ref: '#/components/schemas/Range2Filter'
rangeFilter:
$ref: '#/components/schemas/RangeFilter'
termFilter:
$ref: '#/components/schemas/TermFilter'
additionalProperties: false
BoolFilter:
description: Allows you to combine other filters into (possibly recursive) logical expression trees. A boolean filter is composed of a logical operator (`AND`, `OR`, `NOT`) and a list of filters that the operator relates to. Multiple filters can be negated with a single `NOT` operator, even when the filters are combined with the `AND` operator.
example:
value:
operator: and
filters:
- termFilter:
field: id
operator: is
values:
- myId
- termFilter:
field: couponId
operator: is
values:
- couponOne
type: object
properties:
filters:
description: A list of filters that are logically combined by an operator.
type: array
items:
$ref: '#/components/schemas/Filter'
operator:
description: The logical operator that is used to combine the filters.
enum:
- and
- or
- not
type: string
example: and
required:
- operator
additionalProperties: false
QueryFilter:
description: Wraps any query and allows it to be used as a filter.
type: object
properties:
query:
$ref: '#/components/schemas/Query'
required:
- query
Field:
description: Name of the field. Might be a custom field name prefixed with c_.
maxLength: 260
type: string
example: couponId
Range2Filter:
description: |-
Allows you to restrict a search result to hits where a range defined by specified attributes has a certain relationship to a specified range.
The first range (R1) is defined by a pair of attributes (`fromField` and `toField`) that specify the extent of a range, such as attributes `validFrom` and `validTo`.
The second range (R2) is defined by `fromValue` and `toValue`.
The filter mode specifies the method used to compare the two ranges:
* `overlap`: R1 overlaps fully or partially with R2.
* `containing`: R1 contains R2.
* `contained`: R1 is contained in R2.
The range filter supports several value types, and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended, but only at one end of the range. You can configure whether the lower bounds and upper bounds are inclusive or exclusive.
A range 2 filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.
example:
fromField: validFrom
toField: validTo
filterMode: overlap
fromValue: '2007-01-01T00:00:00.000Z'
toValue: '2017-01-01T00:00:00.000Z'
type: object
properties:
filterMode:
default: overlap
example: overlap
description: 'Compare mode: overlap, containing, or contained.'
enum:
- overlap
- containing
- contained
type: string
fromField:
description: The field name of the field that starts the first range.
example: validFrom
allOf:
- $ref: '#/components/schemas/Field'
fromInclusive:
default: true
example: true
description: A flag indicating if the lower bound of the second range is inclusive. To make the lower bound exclusive, set to `false`.
type: boolean
fromValue:
description: The lower bound of the second range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended.
example: '2007-01-01T00:00:00.000Z'
toField:
description: The field name of the field that ends the first range.
example: validTo
allOf:
- $ref: '#/components/schemas/Field'
toInclusive:
default: true
example: true
description: A flag indicating if the upper bound of the second range is inclusive. To make the lower bound exclusive, set to `false`.
type: boolean
toValue:
description: The upper bound of the second range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended.
example: '2017-01-01T00:00:00.000Z'
required:
- fromField
- toField
additionalProperties: false
RangeFilter:
description: |-
Allows you to restrict a search result to hits that have values for a given attribute that fall within a given value range. The range filter supports several value types and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended, but only at one end of the range. You can configure whether the lower bounds and upper bounds are inclusive or exclusive.
A range filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.
type: object
properties:
field:
example: validFrom
description: The search field.
allOf:
- $ref: '#/components/schemas/Field'
from:
oneOf:
- type: string
format: date-time
example: '2007-01-01T00:00:00.000Z'
- type: integer
example: 1
- type: number
example: 1
description: The lower bound of the filter range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended.
fromInclusive:
default: true
example: true
description: A flag indicating if the lower bound of the range is inclusive. To make the lower bound exclusive, set to `false`.
type: boolean
to:
oneOf:
- type: string
format: date-time
example: '2007-01-02T00:00:00.000Z'
- type: integer
example: 2
- type: number
example: 2
description: The upper bound of the filter range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended.
toInclusive:
default: true
example: true
description: A flag indicating if the upper bound of the range is inclusive. To make the upper bound exclusive, set to `false`.
type: boolean
required:
- field
TermFilter:
description: Allows you to restrict a search result to hits that match exactly one of the values configured for the filter. A term filter is useful for general restrictions that can be shared between searches. Use term filters whenever the criteria you filter on is a shared property of multiple searches (for example, like filtering by an order status). Use term filters for fields that have a discrete and small set of values only.
example:
field: id
operator: is
values:
- myId
type: object
properties:
field:
description: The filter field.
allOf:
- $ref: '#/components/schemas/Field'
operator:
description: The operator used to compare the field's values with the given values.
example: is
enum:
- is
- one_of
- is_null
- is_not_null
- less
- greater
- not_in
- neq
type: string
values:
description: The filter values.
type: array
items:
type: string
example: myId
required:
- field
- operator
additionalProperties: false
FilteredQuery:
description: Allows to filter the result of a possibly complex query using a possibly complex filter.
example:
query:
textQuery:
fields:
- couponId
searchPhrase: disabled
filter:
termFilter:
field: enabled
operator: is
values:
- false
type: object
properties:
filter:
$ref: '#/components/schemas/Filter'
query:
$ref: '#/components/schemas/Query'
required:
- filter
- query
additionalProperties: false
MatchAllQuery:
description: Matches all documents (namespace and document type). This query comes in handy if you just want to filter a search result or really do not have any constraints.
type: object
NestedQuery:
description: "Allows you to query nested documents that are part of a larger document. Say, for example, that you have a main product with variations in one big document, and you want to constrain a search to main products that have variations that match multiple constraints. \n\nA `NestedQuery` is only supported by some Commerce APIs. For more details, see the endpoint descriptions in the API documentation.\n"
example:
path: order.shippingAddresses
query:
boolQuery:
must:
- boolQuery:
must:
- termQuery:
fields:
- order.shippingAddresses.firstName
operator: is
values:
- John
- boolQuery:
must:
- termQuery:
fields:
- order.shippingAddresses.lastName
operator: is
values:
- Doe
scoreMode: avg
type: object
properties:
path:
description: The path to the nested document.
type: string
example: order.shippingAddresses
maxLength: 2048
query:
$ref: '#/components/schemas/Query'
scoreMode:
description: Indicates how scores for matching child objects affect the root parent document’s relevance score.
enum:
- avg
- total
- max
- none
type: string
example: avg
required:
- path
- query
additionalProperties: false
TermQuery:
description: |-
A term query matches one or more values against one or more document fields. A document is considered a hit if one of the values matches exactly with at least one of the given fields. The operator `is` can only take one value, while `one_of` can take multiple values. If multiple fields are specified, they are combined using a logical `OR` operator.
**Limitations:**
* The `greater` and `less` operators are not supported under certain conditions. Both operators are permitted unless the API documentation states otherwise.
* A subset of Commerce APIs handle queries with multiple fields differently. If the query has multiple fields, the query is internally handled as a logical `OR` of `DisjointMaxQueries` (with the dismax matching a value against all fields). The dismax makes sure that a document carrying a single term in multiple fields does not get higher scores than a document matching multiple terms in multiple fields.
type: object
properties:
fields:
minItems: 1
description: The document fields that the values are matched against, combined with the operator.
type: array
items:
$ref: '#/components/schemas/Field'
operator:
description: Returns the operator to use for the term query.
enum:
- is
- one_of
- is_null
- is_not_null
- less
- greater
- not_in
- neq
type: string
example: is
values:
description: The values that the fields are compared against, combined with the operator.
type: array
items:
oneOf:
- type: string
example: myCouponId
- type: number
example: 1
- type: boolean
example: true
- type: integer
example: 1
example: myCouponId
required:
- fields
- operator
TextQuery:
description: A text query is used to match some text (for example, a search phrase possibly consisting of multiple terms) against one or more fields. When multiple fields are provided, the phrase conceptually forms a logical `OR` over the fields. In this case, the terms of the phrase basically have to match within the text, that would result in concatenating all given fields.
example:
fields:
- couponId
searchPhrase: limit
type: object
properties:
fields:
minItems: 1
description: The document fields that the search phrase matches against.
type: array
items:
$ref: '#/components/schemas/Field'
searchPhrase:
description: A search phrase, which can include multiple terms separated by spaces.
type: string
example: campaign summer
required:
- fields
- searchPhrase
additionalProperties: false
String256:
type: string
maxLength: 256
description: "The String256 schema is a foundational schema designed for fields or attributes that are stored in a database field with a maximum capacity of 256 bytes. \nThis schema accommodates various character sets, with the following considerations:\n - ASCII Characters: Each ASCII character occupies 1 byte, allowing up to 256 characters.\n - Latin Characters: Many Latin characters require 2 bytes each, allowing up to 128 characters.\n - Asian Characters: Many Asian characters require 3 bytes each, allowing approximately 85 characters."
example: Max Mustermann
Sort:
description: Document representing a sort request. Each API has a different default sort configuration that can be modified in the request.
example:
field: couponId
sortOrder: desc
type: object
properties:
field:
description: The name of the field to sort on.
allOf:
- $ref: '#/components/schemas/String256'
sortOrder:
default: asc
description: The sort order to be applied when sorting. When omitted, the default sort order (asc) is used.
example: asc
enum:
- asc
- desc
type: string
required:
- field
additionalProperties: false
Offset:
default: 0
minimum: 0
format: int64
description: The zero-based index of the first hit/data to include in the result.
type: integer
example: 0
SearchRequest:
description: Document representing a search request for retrieving items within the Data API. The query is a potentially complex set of expressions. The fields and expands that each query supports are defined within the search resource.
type: object
properties:
limit:
description: Maximum records to retrieve per request, not to exceed 200.
example: 10
maximum: 200
allOf:
- $ref: '#/components/schemas/Limit'
query:
$ref: '#/components/schemas/Query'
sorts:
description: The list of sort clauses configured for the search request. Sort clauses are optional. See the description of the search endpoint for details on the default sorting behavior that is used when explicit sorts are not passed.
type: array
items:
$ref: '#/components/schemas/Sort'
offset:
$ref: '#/components/schemas/Offset'
required:
- query
Total:
default: 0
minimum: 0
format: int64
description: The total number of hits that match the search's criteria. This can be greater than the number of results returned as search results are pagenated.
type: integer
example: 10
ResultBase:
description: "Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. \nAdditionally it needs to be defined what data is returned."
type: object
required:
- limit
- total
properties:
limit:
maximum: 200
allOf:
- $ref: '#/components/schemas/Limit'
total:
$ref: '#/components/schemas/Total'
PaginatedResultBase:
description: "Schema defining generic pageable result. Each response schema of a resource requiring pagination should extend this schema. \nIf you use this extend this schema directly, it needs to be defined what data is returned. Allowed names for the data field is `data`."
type: object
allOf:
- $ref: '#/components/schemas/ResultBase'
properties:
offset:
$ref: '#/components/schemas/Offset'
required:
- limit
- offset
- total
PaginatedSearchResult:
description: Document representing a generic search result. Each search resource should extend this to define what is returned in the `hits`.
properties:
query:
$ref: '#/components/schemas/Query'
sorts:
description: The sorting that was applied to the result.
type: array
items:
$ref: '#/components/schemas/Sort'
hits:
description: The sorted array of search hits. Can be empty.
type: array
items:
type: object
allOf:
- $ref: '#/components/schemas/PaginatedResultBase'
type: object
required:
- query
example:
limit: 1
hits:
- couponId: coupon1
creationDate: '2019-10-20T12:00:00Z'
description: This coupon is used to give 10% off stuff.
enabled: false
exportedCodeCount: 0
lastModified: '2019-10-30T04:23:59Z'
redemptionCount: 3
redemptionLimits:
limitPerCode: 1
limitPerCustomer: 1
limitPerTimeFrame:
limit: 2
redemptionTimeFrame: 24
singleCode: MyCode
systemCodesConfig:
codePrefix: SG
numberOfCodes: 500000
totalCodesCount: 50
type: single_code
query:
textQuery:
fields:
- id
- description
searchPhrase: stuff
sorts:
- field: couponId
sortOrder: desc
offset: 2
total: 8
additionalProperties: false
CampaignId:
minLength: 1
maxLength: 256
description: The ID of the campaign.
type: string
example: NewYearCampaign
Campaign:
description: Document representing a campaign.
additionalProperties:
title: Additional Property Support
description: |-
This type supports additional properties passed along with the defined properties of this API.
To indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.
The type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix.
example: c_trackingId
properties:
campaignId:
$ref: '#/components/schemas/CampaignId'
coupons:
description: The array of assigned coupon IDs, not sorted.
type: array
items:
type: string
example:
- 20%offOrder
- 10%offWelcomeNewUser
creationDate:
description: Returns the value of attribute 'creationDate'.
type: string
format: date-time
example: '2019-10-03T19:36:56.000Z'
customerGroups:
description: The array of assigned customer groups, not sorted.
type: array
items:
type: string
example:
- BigShoppers
- NorthAmericanShoppers
description:
maxLength: 4000
description: The description of the campaign.
type: string
enabled:
description: The enabled flag for campaign.
type: boolean
example: true
endDate:
description: The date the scenario ends.
type: string
format: date-time
lastModified:
description: Returns the value of attribute 'lastModified'.
type: string
format: date-time
example: '2019-10-03T19:36:56.000Z'
sourceCodeGroups:
description: The array of assigned source code groups, not sorted.
type: array
items:
type: string
example:
- affiliate-email
- gaming-email
startDate:
description: The date the scenario begins.
type: string
format: date-time
example: '2019-10-03T19:36:56.000Z'
type: object
required:
- campaignId
TimeOfDay:
type: object
required:
- timeFrom
- timeTo
description: Document representing a time schedule within a single day.
additionalProperties: false
properties:
timeFrom:
description: |-
The time to start from. Time format: HH:mm:ss. Seconds
are ignored and set to 0.
type: string
timeTo:
description: |-
The time to end on. Time format: HH:mm:ss. Seconds
are ignored and set to 0.
type: string
Recurrence:
description: Document representing a schedule recurrence.
type: object
required:
- dayOfWeek
- timeOfDay
additionalProperties: false
properties:
dayOfWeek:
description: The days of week for recurrence.
type: array
items:
enum:
- monday
- tuesday
- wednesday
- thursday
- friday
- saturday
- sunday
type: string
timeOfDay:
description: The time of the day for recurrence.
allOf:
- $ref: '#/components/schemas/TimeOfDay'
type: object
Schedule:
description: Document representing a time schedule for slots.
additionalProperties: false
type: object
required:
- endDate
- recurrence
- startDate
properties:
endDate:
description: 'The date to end of validity. ISO8601 date time format: yyyy-MM-dd''T''HH:mm:ssZ.'
type: string
format: date-time
recurrence:
description: The recurrence of the schedule by day of week and time of day. Not all schedules support a recurrence.
allOf:
- $ref: '#/components/schemas/Recurrence'
startDate:
description: 'The date to start validity. ISO8601 date time format: yyyy-MM-dd''T''HH:mm:ssZ.'
type: string
format: date-time
PromotionAbtestGroupAssignment:
additionalProperties: false
properties:
abtestDescription:
type: string
abtestId:
type: string
enabled:
type: boolean
schedule:
$ref: '#/components/schemas/Schedule'
segmentDescription:
type: string
segmentId:
type: string
type: object
required:
- abtestDescription
- abtestId
- enabled
- schedule
- segmentDescription
- segmentId
PromotionCampaignAssignment:
description: Document representing a promotion campaign assignment.
additionalProperties: false
properties:
campaign:
description: The campaign.
allOf:
- $ref: '#/components/schemas/Campaign'
campaignId:
minLength: 1
maxLength: 256
description: The ID of the campaign.
type: string
coupons:
description: The sorted array of assigned coupon IDs.
type: array
items:
type: string
customerGroups:
description: The sorted array of assigned customer groups.
type: array
items:
type: string
description:
maxLength: 4000
description: The description of the promotion campaign assignment.
type: string
enabled:
description: True if the assignment resource is enabled.
type: boolean
promotion:
description: The promotion.
allOf:
- $ref: '#/components/schemas/Promotion'
promotionId:
minLength: 1
maxLength: 256
description: The ID of the promotion.
type: string
rank:
format: int32
description: The rank of promotion campaign assignment.
type: integer
schedule:
description: The schedule of the assignment resource.
allOf:
- $ref: '#/components/schemas/Schedule'
sourceCodeGroups:
description: The sorted array of assigned source code groups.
type: array
items:
$ref: '#/components/schemas/SourceCodeGroupId'
type: object
required:
- campaign
- campaignId
- coupons
- customerGroups
- description
- enabled
- promotion
- promotionId
- rank
- schedule
- sourceCodeGroups
PromotionAssignmentInformation:
additionalProperties: false
properties:
abtestId:
description: |-
If there is only one assignment, and that assignment is an A/B test segment, the ID of the A/B test the segment
belongs to. Otherwise, empty.
type: string
abtestSegmentId:
description: |-
If there is only one assignment, and that assignment is an A/B test segment, the ID of the A/B test segment.
Otherwise, empty.
type: string
active:
description: True if the individual assignment or the multiple assignments are currently active.
type: boolean
activeAbtestAssignments:
description: A list of currently active A/B tests this is assigned to.
type: array
items:
$ref: '#/components/schemas/PromotionAbtestGroupAssignment'
activeCampaignAssignments:
description: A list of currently active campaigns this is assigned to.
type: array
items:
$ref: '#/components/schemas/PromotionCampaignAssignment'
campaignId:
description: If there is only one assignment, and that assignment is a campaign, the ID of the campaign. Otherwise, empty.
type: string
enabled:
type: boolean
endDate:
description: |-
The end date of the container of the assignment (a Campaign or ABTest). If scheduleType is
scheduleType : "multiple" or scheduleType : "none", then then result is null. Also, a null
date returns null.
type: string
format: date-time
schedule:
description: |-
The schedule of the assignment (a Campaign or ABTest). If scheduleType is
scheduleType : "multiple" or scheduleType : "none", then then result is null.
allOf:
- $ref: '#/components/schemas/Schedule'
scheduleType:
description: |-
If there is only one active assignment, or no active assignments and one upcoming assignment, this is that type
of assignment (scheduleType : "campaign" or scheduleType : "abtest"). If there are no
assignments, it is scheduleType : "none", otherwise, scheduleType : "multiple".
enum:
- none
- campaign
- abtest
- multiple
type: string
startDate:
description: |-
The start date of the container of the assignment (a Campaign or ABTest). If scheduleType is
scheduleType : "multiple" or scheduleType : "none", then then result is null. Also, a null
date returns null.
type: string
format: date-time
upcomingAbtestAssignments:
description: A list of upcoming A/B tests this is assigned to.
type: array
items:
$ref: '#/components/schemas/PromotionAbtestGroupAssignment'
upcomingCampaignAssignments:
description: A list of upcoming campaigns this is assigned to.
type: array
items:
$ref: '#/components/schemas/PromotionCampaignAssignment'
type: object
required:
- abtestId
- abtestSegmentId
- active
- activeAbtestAssignments
- activeCampaignAssignments
- campaignId
- enabled
- endDate
- schedule
- scheduleType
- startDate
- upcomingAbtestAssignments
- upcomingCampaignAssignments
Tag:
description: Document representing a tag
additionalProperties: false
properties:
tagId:
description: The ID of the tag.
type: string
type: object
required:
- tagId
Promotion:
description: |-
Document representing a promotion. Unless otherwise stated, attributes of this document are not supported when using
the Open Commerce API to update multiple promotions at once.
additionalProperties:
title: Additional Property Support
description: |-
This type supports additional properties passed along with the defined properties of this API.
To indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.
The type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix.
example: c_trackingId
properties:
archived:
description: |-
Determines if this promotion is archived. This attribute is allowed to be updated when using the Open
Commerce API to update multiple promotions at once.
type: boolean
assignmentInformation:
description: Information about the assignments and assignment schedules of this promotion.
allOf: