@salesforce/b2c-tooling-sdk 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/schemas/dw.schema.json +14 -0
- package/data/tooling/index.json +5 -5
- package/dist/esm/cli/base-command.js +4 -3
- package/dist/esm/cli/base-command.js.map +1 -1
- package/dist/esm/cli/cartridge-command.js +2 -1
- package/dist/esm/cli/cartridge-command.js.map +1 -1
- package/dist/esm/cli/config.js +3 -1
- package/dist/esm/cli/config.js.map +1 -1
- package/dist/esm/cli/hooks.d.ts +13 -0
- package/dist/esm/cli/hooks.js +11 -0
- package/dist/esm/cli/hooks.js.map +1 -1
- package/dist/esm/cli/instance-command.js +2 -1
- package/dist/esm/cli/instance-command.js.map +1 -1
- package/dist/esm/clients/scapi-backend-utils.d.ts +15 -0
- package/dist/esm/clients/scapi-backend-utils.js +28 -1
- package/dist/esm/clients/scapi-backend-utils.js.map +1 -1
- package/dist/esm/clients/scapi-fallback-backend.js +2 -2
- package/dist/esm/clients/scapi-fallback-backend.js.map +1 -1
- package/dist/esm/clients/scapi-schemas.generated.d.ts +2 -2
- package/dist/esm/compat/dispatcher.js +2 -2
- package/dist/esm/compat/dispatcher.js.map +1 -1
- package/dist/esm/config/config-origins.d.ts +19 -0
- package/dist/esm/config/config-origins.js +11 -0
- package/dist/esm/config/config-origins.js.map +1 -0
- package/dist/esm/config/config-write.d.ts +86 -0
- package/dist/esm/config/config-write.js +296 -0
- package/dist/esm/config/config-write.js.map +1 -0
- package/dist/esm/config/dw-json-schema.js +4 -0
- package/dist/esm/config/dw-json-schema.js.map +1 -1
- package/dist/esm/config/dw-json.d.ts +2 -0
- package/dist/esm/config/dw-json.js +10 -6
- package/dist/esm/config/dw-json.js.map +1 -1
- package/dist/esm/config/index.d.ts +8 -3
- package/dist/esm/config/index.js +5 -2
- package/dist/esm/config/index.js.map +1 -1
- package/dist/esm/config/instance-manager.d.ts +64 -28
- package/dist/esm/config/instance-manager.js +145 -63
- package/dist/esm/config/instance-manager.js.map +1 -1
- package/dist/esm/config/mapping.js +6 -0
- package/dist/esm/config/mapping.js.map +1 -1
- package/dist/esm/config/resolver.d.ts +22 -0
- package/dist/esm/config/resolver.js +54 -29
- package/dist/esm/config/resolver.js.map +1 -1
- package/dist/esm/config/sources/dw-json-source.d.ts +9 -1
- package/dist/esm/config/sources/dw-json-source.js +34 -20
- package/dist/esm/config/sources/dw-json-source.js.map +1 -1
- package/dist/esm/config/sources/env-source.d.ts +30 -3
- package/dist/esm/config/sources/env-source.js +126 -1
- package/dist/esm/config/sources/env-source.js.map +1 -1
- package/dist/esm/config/types.d.ts +46 -0
- package/dist/esm/operations/jobs/run-system-job.js +2 -2
- package/dist/esm/operations/jobs/run-system-job.js.map +1 -1
- package/dist/esm/plugins/discovery.js +2 -1
- package/dist/esm/plugins/discovery.js.map +1 -1
- package/dist/esm/scapi/index.d.ts +5 -2
- package/dist/esm/scapi/index.js +3 -2
- package/dist/esm/scapi/index.js.map +1 -1
- package/dist/esm/scapi/live.d.ts +12 -1
- package/dist/esm/scapi/live.js +30 -2
- package/dist/esm/scapi/live.js.map +1 -1
- package/dist/esm/scapi/local.d.ts +17 -0
- package/dist/esm/scapi/local.js +68 -16
- package/dist/esm/scapi/local.js.map +1 -1
- package/dist/esm/scapi/request.d.ts +2 -2
- package/dist/esm/scapi/request.js +2 -1
- package/dist/esm/scapi/request.js.map +1 -1
- package/dist/esm/scapi/runtime.d.ts +5 -0
- package/dist/esm/scapi/runtime.js.map +1 -1
- package/dist/esm/scapi/schema-source.d.ts +90 -0
- package/dist/esm/scapi/schema-source.js +146 -0
- package/dist/esm/scapi/schema-source.js.map +1 -0
- package/dist/esm/scapi/worker-source.js +30 -6
- package/dist/esm/scapi/worker-source.js.map +1 -1
- package/dist/esm/test-utils/config-isolation.js +9 -2
- package/dist/esm/test-utils/config-isolation.js.map +1 -1
- package/node_modules/@salesforce/b2c-api-schemas/manifest.json +83 -42
- package/node_modules/@salesforce/b2c-api-schemas/package.json +1 -1
- package/node_modules/@salesforce/b2c-api-schemas/scapi/cdn/zones/v1.json +6798 -238
- package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/orders/v1.json +2296 -205
- package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-baskets/v1.json +5571 -666
- package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-baskets/v2.json +6062 -371
- package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-orders/v1.json +3426 -360
- package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-payments/v1.json +351 -99
- package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/cors/v1.json +172 -12
- package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/preferences/v1.json +1497 -111
- package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/shopper-configurations/v1.json +202 -36
- package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/timeouts/v1.json +79 -10
- package/node_modules/@salesforce/b2c-api-schemas/scapi/custom-object/custom-objects/v1.json +785 -49
- package/node_modules/@salesforce/b2c-api-schemas/scapi/custom-object/shopper-custom-objects/v1.json +191 -40
- package/node_modules/@salesforce/b2c-api-schemas/scapi/customer/customers/v1.json +1483 -107
- package/node_modules/@salesforce/b2c-api-schemas/scapi/customer/shopper-customers/v1.json +4854 -787
- package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/custom-apis/v1.json +119 -15
- package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/object-definitions/v1.json +1699 -80
- package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/scapi-schemas/v1.json +252 -18
- package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/scripts/v1.json +329 -23
- package/node_modules/@salesforce/b2c-api-schemas/scapi/experience/experiences/v1.json +4208 -234
- package/node_modules/@salesforce/b2c-api-schemas/scapi/experience/shopper-experience/v1.json +1591 -247
- package/node_modules/@salesforce/b2c-api-schemas/scapi/intelligence/analytics/v1.json +396 -8
- package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/availability/v1.json +1242 -69
- package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/impex/v1.json +2354 -248
- package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/reservation/v1.json +1550 -45
- package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/segmentation/v1.json +6615 -0
- package/node_modules/@salesforce/b2c-api-schemas/scapi/merchant/roles/v1.json +1520 -59
- package/node_modules/@salesforce/b2c-api-schemas/scapi/merchant/users/v1.json +397 -17
- package/node_modules/@salesforce/b2c-api-schemas/scapi/observability/metrics/v1.json +1241 -27
- package/node_modules/@salesforce/b2c-api-schemas/scapi/operation/jobs/v1.json +1069 -68
- package/node_modules/@salesforce/b2c-api-schemas/scapi/operation/replications/v1.json +410 -23
- package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/assignments/v1.json +502 -102
- package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/campaigns/v1.json +1112 -94
- package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/coupons/v1.json +820 -93
- package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/gift-certificates/v1.json +845 -92
- package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/promotions/v1.json +2716 -674
- package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/shopper-gift-certificates/v1.json +130 -47
- package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/shopper-promotions/v1.json +233 -63
- package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/source-code-groups/v1.json +630 -70
- package/node_modules/@salesforce/b2c-api-schemas/scapi/product/catalogs/v1.json +2886 -348
- package/node_modules/@salesforce/b2c-api-schemas/scapi/product/inventory-lists/v1.json +520 -19
- package/node_modules/@salesforce/b2c-api-schemas/scapi/product/price-books/v1.json +3115 -293
- package/node_modules/@salesforce/b2c-api-schemas/scapi/product/products/v1.json +3313 -138
- package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-availability/v1.json +266 -52
- package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-delivery-estimates/v1.json +256 -48
- package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-products/v1.json +1744 -306
- package/node_modules/@salesforce/b2c-api-schemas/scapi/search/shopper-search/v1.json +1661 -120
- package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/auth/v1.json +2174 -118
- package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/auth-admin/v1.json +1373 -24
- package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/consents/v1.json +531 -20
- package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-agents/v1.json +154 -6
- package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-consents/v1.json +596 -79
- package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-context/v1.json +456 -42
- package/node_modules/@salesforce/b2c-api-schemas/scapi/site/seo/v1.json +101 -23
- package/node_modules/@salesforce/b2c-api-schemas/scapi/site/shopper-seo/v1.json +184 -41
- package/node_modules/@salesforce/b2c-api-schemas/scapi/site/sites/v1.json +995 -47
- package/node_modules/@salesforce/b2c-api-schemas/scapi/store/shopper-stores/v1.json +370 -67
- package/node_modules/@salesforce/b2c-api-schemas/scapi/store/store-redirect-mappings/v1.json +319 -11
- package/node_modules/@salesforce/b2c-api-schemas/scapi/store/stores/v1.json +1109 -64
- package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/deployments/v1.json +1442 -0
- package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/environments/v1.json +4293 -0
- package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/storefronts/v1.json +1371 -0
- package/package.json +2 -2
- package/specs/scapi-schemas-v1.yaml +4 -1
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"openapi": "3.0.3",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Coupons",
|
|
5
|
-
"
|
|
5
|
+
"description": "[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/coupons/coupons-oas-v1-public.yaml)\n\n# API Overview\n\nUse the Coupons API to create, modify, retrieve, and delete coupons for a given channel. You can also use it to create and retrieve coupon codes using a couponID.\n\nCoupons _must_ be added as a qualifier to a campaign before they can be used.\n\nFor more information, see [Using Coupons as Qualifiers](https://help.salesforce.com/s/articleView?id=cc.b2c_coupons.htm&type=5) in the B2C Commerce documentation.\n\n## Authentication & Authorization\n\nThe client requesting the coupon's information must have access to the Coupon 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## Response Details\n\n### Timeouts\n\nAdmin API requests must respond within 60 seconds. If a response exceeds this threshold, an HTTP 504 status code is returned. For details, see [Timeouts and Limits.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/timeouts-limits.html)\n\n### Error Handling\n\nError responses follow the [RFC 7807](https://datatracker.ietf.org/doc/html/rfc7807) problem detail format. To trace errors, include a `correlation-id` header in your request — the response returns it as `x-correlation-id`. For details, see [HTTP Status Codes and Errors.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/error-response-codes.html)\n\n## Use Cases\n\n### Single-Use Coupon\n\nSingle-use coupons are your standard coupons, which you can only use once per customer.\n\nFor example, use the Coupons API to create a coupon with a single coupon code that can be applied only once per order per customer.\n\n### Multiple-Use Coupon\n\nA multiple-use coupon can be used any number of times by any number of customers.\n\nFor example, use the Coupons API to create a coupon that can be applied once per order and has system-generated codes.\n\n### Search Coupon\n\nUse the Coupons API to search for coupons using simple or complex querying.\n\n### Search Coupon Redemptions\n\nUse the Coupons API to search for coupon redemptions using simple or complex querying.\n\nFor more detail, see [Coupon Redemption](https://help.salesforce.com/s/articleView?id=cc.b2c_coupons.htm&type=5) in the B2C Commerce documentation.\n\n## Related APIs\n\n- [Campaigns](https://developer.salesforce.com/docs/commerce/commerce-api/references/campaigns?meta=Summary) — Manage campaigns that use coupons as qualifiers.",
|
|
6
|
+
"version": "1.0.44",
|
|
6
7
|
"x-api-type": "Admin",
|
|
7
8
|
"x-api-family": "Pricing"
|
|
8
9
|
},
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
"url": "https://{shortCode}.api.commercecloud.salesforce.com/pricing/coupons/v1",
|
|
12
13
|
"variables": {
|
|
13
14
|
"shortCode": {
|
|
15
|
+
"description": "An eight-character string assigned to a realm for routing purposes. See [Base URL and Request Formation.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html)",
|
|
14
16
|
"default": "shortCode"
|
|
15
17
|
}
|
|
16
18
|
}
|
|
@@ -19,26 +21,36 @@
|
|
|
19
21
|
"paths": {
|
|
20
22
|
"/organizations/{organizationId}/coupons": {
|
|
21
23
|
"post": {
|
|
24
|
+
"summary": "Search for coupons.",
|
|
25
|
+
"description": "The Coupon Search document contains a search object that allows filtering on various attributes.\n\nThe following searchable query attributes can be used to narrow the search:\n\n| Attribute | Type |\n|-----------|--------|\n| couponId| String |\n| description | String |\n| type | one of {\"single_code\", \"multiple_codes\", \"system_codes\"} |\n| enabled | Boolean |\n\n Note that only searchable attributes can be used in sorting.",
|
|
22
26
|
"operationId": "couponsSearch",
|
|
23
27
|
"parameters": [
|
|
24
28
|
{
|
|
25
29
|
"name": "organizationId",
|
|
26
30
|
"in": "path",
|
|
31
|
+
"description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
|
|
27
32
|
"required": true,
|
|
28
33
|
"style": "simple",
|
|
29
34
|
"explode": false,
|
|
30
35
|
"schema": {
|
|
31
36
|
"$ref": "#/components/schemas/OrganizationId"
|
|
32
|
-
}
|
|
37
|
+
},
|
|
38
|
+
"example": "f_ecom_zzxy_prd"
|
|
33
39
|
},
|
|
34
40
|
{
|
|
35
41
|
"name": "siteId",
|
|
36
42
|
"in": "query",
|
|
43
|
+
"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.",
|
|
37
44
|
"required": true,
|
|
38
45
|
"style": "form",
|
|
39
46
|
"explode": true,
|
|
40
47
|
"schema": {
|
|
41
48
|
"$ref": "#/components/schemas/SiteId"
|
|
49
|
+
},
|
|
50
|
+
"examples": {
|
|
51
|
+
"SiteId": {
|
|
52
|
+
"value": "RefArch"
|
|
53
|
+
}
|
|
42
54
|
}
|
|
43
55
|
}
|
|
44
56
|
],
|
|
@@ -63,7 +75,7 @@
|
|
|
63
75
|
}
|
|
64
76
|
},
|
|
65
77
|
"400": {
|
|
66
|
-
"description": "
|
|
78
|
+
"description": "Returned when the query is ill-formed."
|
|
67
79
|
}
|
|
68
80
|
},
|
|
69
81
|
"security": [
|
|
@@ -78,26 +90,36 @@
|
|
|
78
90
|
},
|
|
79
91
|
"/organizations/{organizationId}/coupons/redemptions": {
|
|
80
92
|
"post": {
|
|
93
|
+
"summary": "Search for coupon redemptions.",
|
|
94
|
+
"description": "The Coupon Redemption Search document contains a search object that allows filtering on various attributes.\n\n\nThe following searchable query attributes can be used to narrow down the search:\n\n | Attribute | Type |\n |-----------|--------|\n | code| String |\n | couponId | String |\n | customerEmail | String |\n | orderNo | String |\n\nNote that only searchable attributes can be used in sorting.\n\nIf the user role does not have the `View_Coupon_Codes` permission, then the returned coupon codes are masked.",
|
|
81
95
|
"operationId": "couponRedemptionsSearch",
|
|
82
96
|
"parameters": [
|
|
83
97
|
{
|
|
84
98
|
"name": "organizationId",
|
|
85
99
|
"in": "path",
|
|
100
|
+
"description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
|
|
86
101
|
"required": true,
|
|
87
102
|
"style": "simple",
|
|
88
103
|
"explode": false,
|
|
89
104
|
"schema": {
|
|
90
105
|
"$ref": "#/components/schemas/OrganizationId"
|
|
91
|
-
}
|
|
106
|
+
},
|
|
107
|
+
"example": "f_ecom_zzxy_prd"
|
|
92
108
|
},
|
|
93
109
|
{
|
|
94
110
|
"name": "siteId",
|
|
95
111
|
"in": "query",
|
|
112
|
+
"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.",
|
|
96
113
|
"required": true,
|
|
97
114
|
"style": "form",
|
|
98
115
|
"explode": true,
|
|
99
116
|
"schema": {
|
|
100
117
|
"$ref": "#/components/schemas/SiteId"
|
|
118
|
+
},
|
|
119
|
+
"examples": {
|
|
120
|
+
"SiteId": {
|
|
121
|
+
"value": "RefArch"
|
|
122
|
+
}
|
|
101
123
|
}
|
|
102
124
|
}
|
|
103
125
|
],
|
|
@@ -122,7 +144,7 @@
|
|
|
122
144
|
}
|
|
123
145
|
},
|
|
124
146
|
"400": {
|
|
125
|
-
"description": "
|
|
147
|
+
"description": "Returned when the query is ill-formed."
|
|
126
148
|
}
|
|
127
149
|
},
|
|
128
150
|
"security": [
|
|
@@ -137,26 +159,36 @@
|
|
|
137
159
|
},
|
|
138
160
|
"/organizations/{organizationId}/coupons/actions/redeem": {
|
|
139
161
|
"post": {
|
|
162
|
+
"summary": "Redeem a coupon code for an existing coupon for the specified site.",
|
|
163
|
+
"description": "The coupon code must be redeemable.\n---\n***Note: Coupon redemptions are evaluated during checkout. A large number of coupon redemptions negatively impacts order creation performance and scale.***\n1. Avoid importing unnecessary coupon redemptions.\n2. Clean up coupon codes and related redemptions when they are no longer required.\n---",
|
|
140
164
|
"operationId": "redeemCoupon",
|
|
141
165
|
"parameters": [
|
|
142
166
|
{
|
|
143
167
|
"name": "organizationId",
|
|
144
168
|
"in": "path",
|
|
169
|
+
"description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
|
|
145
170
|
"required": true,
|
|
146
171
|
"style": "simple",
|
|
147
172
|
"explode": false,
|
|
148
173
|
"schema": {
|
|
149
174
|
"$ref": "#/components/schemas/OrganizationId"
|
|
150
|
-
}
|
|
175
|
+
},
|
|
176
|
+
"example": "f_ecom_zzxy_prd"
|
|
151
177
|
},
|
|
152
178
|
{
|
|
153
179
|
"name": "siteId",
|
|
154
180
|
"in": "query",
|
|
181
|
+
"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.",
|
|
155
182
|
"required": true,
|
|
156
183
|
"style": "form",
|
|
157
184
|
"explode": true,
|
|
158
185
|
"schema": {
|
|
159
186
|
"$ref": "#/components/schemas/SiteId"
|
|
187
|
+
},
|
|
188
|
+
"examples": {
|
|
189
|
+
"SiteId": {
|
|
190
|
+
"value": "RefArch"
|
|
191
|
+
}
|
|
160
192
|
}
|
|
161
193
|
}
|
|
162
194
|
],
|
|
@@ -165,6 +197,11 @@
|
|
|
165
197
|
"application/json": {
|
|
166
198
|
"schema": {
|
|
167
199
|
"$ref": "#/components/schemas/CouponCodeRedemptionRequest"
|
|
200
|
+
},
|
|
201
|
+
"examples": {
|
|
202
|
+
"PostRedeemCoupon": {
|
|
203
|
+
"$ref": "#/components/examples/PostRedeemCoupon"
|
|
204
|
+
}
|
|
168
205
|
}
|
|
169
206
|
}
|
|
170
207
|
}
|
|
@@ -174,21 +211,31 @@
|
|
|
174
211
|
"description": "Coupon was successfully redeemed and a redemption record created.\n"
|
|
175
212
|
},
|
|
176
213
|
"400": {
|
|
177
|
-
"description": "
|
|
214
|
+
"description": "Returned when the coupon code can not be redeemed, for example, if it is disabled,\nalready redeemed, if the redemption limit (maximum number or timeframe) is\nexceeded or if it has no assigned active promotion.\n",
|
|
178
215
|
"content": {
|
|
179
216
|
"application/json": {
|
|
180
217
|
"schema": {
|
|
181
218
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
219
|
+
},
|
|
220
|
+
"examples": {
|
|
221
|
+
"IdConflict400": {
|
|
222
|
+
"$ref": "#/components/examples/CouponCodeNotRedeemable400"
|
|
223
|
+
}
|
|
182
224
|
}
|
|
183
225
|
}
|
|
184
226
|
}
|
|
185
227
|
},
|
|
186
228
|
"404": {
|
|
187
|
-
"description": "
|
|
229
|
+
"description": "Returned when the site does not contain a coupon, which\ndefines whether the coupon code requested can be redeemed.\n",
|
|
188
230
|
"content": {
|
|
189
231
|
"application/json": {
|
|
190
232
|
"schema": {
|
|
191
233
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
234
|
+
},
|
|
235
|
+
"examples": {
|
|
236
|
+
"IdConflict400": {
|
|
237
|
+
"$ref": "#/components/examples/CouponCodeNotFound404"
|
|
238
|
+
}
|
|
192
239
|
}
|
|
193
240
|
}
|
|
194
241
|
}
|
|
@@ -205,11 +252,14 @@
|
|
|
205
252
|
},
|
|
206
253
|
"/organizations/{organizationId}/coupons/{couponId}": {
|
|
207
254
|
"get": {
|
|
255
|
+
"summary": "Return coupon information for the specified coupon ID.",
|
|
256
|
+
"description": "If the user role does not have the View_Coupon_Codes permission, then the returned coupon codes are masked.",
|
|
208
257
|
"operationId": "getCoupon",
|
|
209
258
|
"parameters": [
|
|
210
259
|
{
|
|
211
260
|
"name": "couponId",
|
|
212
261
|
"in": "path",
|
|
262
|
+
"description": "The ID of the coupon to create.",
|
|
213
263
|
"required": true,
|
|
214
264
|
"style": "simple",
|
|
215
265
|
"explode": false,
|
|
@@ -221,21 +271,29 @@
|
|
|
221
271
|
{
|
|
222
272
|
"name": "organizationId",
|
|
223
273
|
"in": "path",
|
|
274
|
+
"description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
|
|
224
275
|
"required": true,
|
|
225
276
|
"style": "simple",
|
|
226
277
|
"explode": false,
|
|
227
278
|
"schema": {
|
|
228
279
|
"$ref": "#/components/schemas/OrganizationId"
|
|
229
|
-
}
|
|
280
|
+
},
|
|
281
|
+
"example": "f_ecom_zzxy_prd"
|
|
230
282
|
},
|
|
231
283
|
{
|
|
232
284
|
"name": "siteId",
|
|
233
285
|
"in": "query",
|
|
286
|
+
"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.",
|
|
234
287
|
"required": true,
|
|
235
288
|
"style": "form",
|
|
236
289
|
"explode": true,
|
|
237
290
|
"schema": {
|
|
238
291
|
"$ref": "#/components/schemas/SiteId"
|
|
292
|
+
},
|
|
293
|
+
"examples": {
|
|
294
|
+
"SiteId": {
|
|
295
|
+
"value": "RefArch"
|
|
296
|
+
}
|
|
239
297
|
}
|
|
240
298
|
}
|
|
241
299
|
],
|
|
@@ -246,16 +304,26 @@
|
|
|
246
304
|
"application/json": {
|
|
247
305
|
"schema": {
|
|
248
306
|
"$ref": "#/components/schemas/Coupon"
|
|
307
|
+
},
|
|
308
|
+
"examples": {
|
|
309
|
+
"GetCoupon": {
|
|
310
|
+
"$ref": "#/components/examples/Coupon"
|
|
311
|
+
}
|
|
249
312
|
}
|
|
250
313
|
}
|
|
251
314
|
}
|
|
252
315
|
},
|
|
253
316
|
"404": {
|
|
254
|
-
"description": "
|
|
317
|
+
"description": "Returned when the coupon does not exist matching the given ID.\n",
|
|
255
318
|
"content": {
|
|
256
319
|
"application/json": {
|
|
257
320
|
"schema": {
|
|
258
321
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
322
|
+
},
|
|
323
|
+
"examples": {
|
|
324
|
+
"getCoupon404": {
|
|
325
|
+
"$ref": "#/components/examples/CouponNotFound404"
|
|
326
|
+
}
|
|
259
327
|
}
|
|
260
328
|
}
|
|
261
329
|
}
|
|
@@ -271,11 +339,13 @@
|
|
|
271
339
|
]
|
|
272
340
|
},
|
|
273
341
|
"put": {
|
|
342
|
+
"summary": "Create a coupon using the information provided. If a coupon with the specified identifier already exists,\n the existing coupon is replaced.",
|
|
274
343
|
"operationId": "createCoupon",
|
|
275
344
|
"parameters": [
|
|
276
345
|
{
|
|
277
346
|
"name": "couponId",
|
|
278
347
|
"in": "path",
|
|
348
|
+
"description": "The ID of the coupon to create.",
|
|
279
349
|
"required": true,
|
|
280
350
|
"style": "simple",
|
|
281
351
|
"explode": false,
|
|
@@ -287,21 +357,29 @@
|
|
|
287
357
|
{
|
|
288
358
|
"name": "organizationId",
|
|
289
359
|
"in": "path",
|
|
360
|
+
"description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
|
|
290
361
|
"required": true,
|
|
291
362
|
"style": "simple",
|
|
292
363
|
"explode": false,
|
|
293
364
|
"schema": {
|
|
294
365
|
"$ref": "#/components/schemas/OrganizationId"
|
|
295
|
-
}
|
|
366
|
+
},
|
|
367
|
+
"example": "f_ecom_zzxy_prd"
|
|
296
368
|
},
|
|
297
369
|
{
|
|
298
370
|
"name": "siteId",
|
|
299
371
|
"in": "query",
|
|
372
|
+
"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.",
|
|
300
373
|
"required": true,
|
|
301
374
|
"style": "form",
|
|
302
375
|
"explode": true,
|
|
303
376
|
"schema": {
|
|
304
377
|
"$ref": "#/components/schemas/SiteId"
|
|
378
|
+
},
|
|
379
|
+
"examples": {
|
|
380
|
+
"SiteId": {
|
|
381
|
+
"value": "RefArch"
|
|
382
|
+
}
|
|
305
383
|
}
|
|
306
384
|
}
|
|
307
385
|
],
|
|
@@ -321,26 +399,41 @@
|
|
|
321
399
|
"application/json": {
|
|
322
400
|
"schema": {
|
|
323
401
|
"$ref": "#/components/schemas/Coupon"
|
|
402
|
+
},
|
|
403
|
+
"examples": {
|
|
404
|
+
"CreateCoupon": {
|
|
405
|
+
"$ref": "#/components/examples/Coupon"
|
|
406
|
+
}
|
|
324
407
|
}
|
|
325
408
|
}
|
|
326
409
|
}
|
|
327
410
|
},
|
|
328
411
|
"400": {
|
|
329
|
-
"description": "
|
|
412
|
+
"description": "Returned when the coupon passed is not valid (the argument indicates\n which field is invalid).\nPossible reasons:\n- The code provided is in use by another coupon.\n- A single code coupon set the coupon code improperly.\n- The ID in the request does not match the ID in the document.\n- A quota for system-generated coupons is violated.",
|
|
330
413
|
"content": {
|
|
331
414
|
"application/json": {
|
|
332
415
|
"schema": {
|
|
333
416
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
417
|
+
},
|
|
418
|
+
"examples": {
|
|
419
|
+
"CouponCodeDuplicate400": {
|
|
420
|
+
"$ref": "#/components/examples/CouponCodeDuplicate400"
|
|
421
|
+
}
|
|
334
422
|
}
|
|
335
423
|
}
|
|
336
424
|
}
|
|
337
425
|
},
|
|
338
426
|
"403": {
|
|
339
|
-
"description": "
|
|
427
|
+
"description": "Returned when the resource requires global context instead of site-specific context.",
|
|
340
428
|
"content": {
|
|
341
429
|
"application/json": {
|
|
342
430
|
"schema": {
|
|
343
431
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
432
|
+
},
|
|
433
|
+
"examples": {
|
|
434
|
+
"createCoupon403": {
|
|
435
|
+
"$ref": "#/components/examples/SiteAccessForbidden403"
|
|
436
|
+
}
|
|
344
437
|
}
|
|
345
438
|
}
|
|
346
439
|
}
|
|
@@ -355,11 +448,13 @@
|
|
|
355
448
|
]
|
|
356
449
|
},
|
|
357
450
|
"delete": {
|
|
451
|
+
"summary": "Delete a coupon with a specified ID.",
|
|
358
452
|
"operationId": "deleteCoupon",
|
|
359
453
|
"parameters": [
|
|
360
454
|
{
|
|
361
455
|
"name": "couponId",
|
|
362
456
|
"in": "path",
|
|
457
|
+
"description": "The ID of the coupon to create.",
|
|
363
458
|
"required": true,
|
|
364
459
|
"style": "simple",
|
|
365
460
|
"explode": false,
|
|
@@ -371,21 +466,29 @@
|
|
|
371
466
|
{
|
|
372
467
|
"name": "organizationId",
|
|
373
468
|
"in": "path",
|
|
469
|
+
"description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
|
|
374
470
|
"required": true,
|
|
375
471
|
"style": "simple",
|
|
376
472
|
"explode": false,
|
|
377
473
|
"schema": {
|
|
378
474
|
"$ref": "#/components/schemas/OrganizationId"
|
|
379
|
-
}
|
|
475
|
+
},
|
|
476
|
+
"example": "f_ecom_zzxy_prd"
|
|
380
477
|
},
|
|
381
478
|
{
|
|
382
479
|
"name": "siteId",
|
|
383
480
|
"in": "query",
|
|
481
|
+
"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.",
|
|
384
482
|
"required": true,
|
|
385
483
|
"style": "form",
|
|
386
484
|
"explode": true,
|
|
387
485
|
"schema": {
|
|
388
486
|
"$ref": "#/components/schemas/SiteId"
|
|
487
|
+
},
|
|
488
|
+
"examples": {
|
|
489
|
+
"SiteId": {
|
|
490
|
+
"value": "RefArch"
|
|
491
|
+
}
|
|
389
492
|
}
|
|
390
493
|
}
|
|
391
494
|
],
|
|
@@ -403,11 +506,13 @@
|
|
|
403
506
|
]
|
|
404
507
|
},
|
|
405
508
|
"patch": {
|
|
509
|
+
"summary": "Update a coupon with the specified information.",
|
|
406
510
|
"operationId": "updateCoupon",
|
|
407
511
|
"parameters": [
|
|
408
512
|
{
|
|
409
513
|
"name": "couponId",
|
|
410
514
|
"in": "path",
|
|
515
|
+
"description": "The ID of the coupon to create.",
|
|
411
516
|
"required": true,
|
|
412
517
|
"style": "simple",
|
|
413
518
|
"explode": false,
|
|
@@ -419,21 +524,29 @@
|
|
|
419
524
|
{
|
|
420
525
|
"name": "organizationId",
|
|
421
526
|
"in": "path",
|
|
527
|
+
"description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
|
|
422
528
|
"required": true,
|
|
423
529
|
"style": "simple",
|
|
424
530
|
"explode": false,
|
|
425
531
|
"schema": {
|
|
426
532
|
"$ref": "#/components/schemas/OrganizationId"
|
|
427
|
-
}
|
|
533
|
+
},
|
|
534
|
+
"example": "f_ecom_zzxy_prd"
|
|
428
535
|
},
|
|
429
536
|
{
|
|
430
537
|
"name": "siteId",
|
|
431
538
|
"in": "query",
|
|
539
|
+
"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.",
|
|
432
540
|
"required": true,
|
|
433
541
|
"style": "form",
|
|
434
542
|
"explode": true,
|
|
435
543
|
"schema": {
|
|
436
544
|
"$ref": "#/components/schemas/SiteId"
|
|
545
|
+
},
|
|
546
|
+
"examples": {
|
|
547
|
+
"SiteId": {
|
|
548
|
+
"value": "RefArch"
|
|
549
|
+
}
|
|
437
550
|
}
|
|
438
551
|
}
|
|
439
552
|
],
|
|
@@ -453,6 +566,11 @@
|
|
|
453
566
|
"application/json": {
|
|
454
567
|
"schema": {
|
|
455
568
|
"$ref": "#/components/schemas/Coupon"
|
|
569
|
+
},
|
|
570
|
+
"examples": {
|
|
571
|
+
"UpdateCoupon": {
|
|
572
|
+
"$ref": "#/components/examples/UpdateCoupon"
|
|
573
|
+
}
|
|
456
574
|
}
|
|
457
575
|
}
|
|
458
576
|
}
|
|
@@ -463,16 +581,26 @@
|
|
|
463
581
|
"application/json": {
|
|
464
582
|
"schema": {
|
|
465
583
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
584
|
+
},
|
|
585
|
+
"examples": {
|
|
586
|
+
"updateCoupon400": {
|
|
587
|
+
"$ref": "#/components/examples/CouponCodeDuplicate400"
|
|
588
|
+
}
|
|
466
589
|
}
|
|
467
590
|
}
|
|
468
591
|
}
|
|
469
592
|
},
|
|
470
593
|
"403": {
|
|
471
|
-
"description": "
|
|
594
|
+
"description": "Returned when trying to update a broken coupon that should be deleted and re-created, or when trying to update a legacy coupon.",
|
|
472
595
|
"content": {
|
|
473
596
|
"application/json": {
|
|
474
597
|
"schema": {
|
|
475
598
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
599
|
+
},
|
|
600
|
+
"examples": {
|
|
601
|
+
"updateCoupon403": {
|
|
602
|
+
"$ref": "#/components/examples/LegacyCouponCoupon403"
|
|
603
|
+
}
|
|
476
604
|
}
|
|
477
605
|
}
|
|
478
606
|
}
|
|
@@ -489,11 +617,13 @@
|
|
|
489
617
|
},
|
|
490
618
|
"/organizations/{organizationId}/coupons/{couponId}/codes": {
|
|
491
619
|
"get": {
|
|
620
|
+
"summary": "Get the coupon codes for the given coupon.\n\n If the user role does not have the View_Coupon_Codes permission, then the coupon codes returned are masked.",
|
|
492
621
|
"operationId": "getCouponCodes",
|
|
493
622
|
"parameters": [
|
|
494
623
|
{
|
|
495
624
|
"name": "couponId",
|
|
496
625
|
"in": "path",
|
|
626
|
+
"description": "The ID of the coupon to create.",
|
|
497
627
|
"required": true,
|
|
498
628
|
"style": "simple",
|
|
499
629
|
"explode": false,
|
|
@@ -505,26 +635,35 @@
|
|
|
505
635
|
{
|
|
506
636
|
"name": "organizationId",
|
|
507
637
|
"in": "path",
|
|
638
|
+
"description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
|
|
508
639
|
"required": true,
|
|
509
640
|
"style": "simple",
|
|
510
641
|
"explode": false,
|
|
511
642
|
"schema": {
|
|
512
643
|
"$ref": "#/components/schemas/OrganizationId"
|
|
513
|
-
}
|
|
644
|
+
},
|
|
645
|
+
"example": "f_ecom_zzxy_prd"
|
|
514
646
|
},
|
|
515
647
|
{
|
|
516
648
|
"name": "siteId",
|
|
517
649
|
"in": "query",
|
|
650
|
+
"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.",
|
|
518
651
|
"required": true,
|
|
519
652
|
"style": "form",
|
|
520
653
|
"explode": true,
|
|
521
654
|
"schema": {
|
|
522
655
|
"$ref": "#/components/schemas/SiteId"
|
|
656
|
+
},
|
|
657
|
+
"examples": {
|
|
658
|
+
"SiteId": {
|
|
659
|
+
"value": "RefArch"
|
|
660
|
+
}
|
|
523
661
|
}
|
|
524
662
|
},
|
|
525
663
|
{
|
|
526
664
|
"name": "limit",
|
|
527
665
|
"in": "query",
|
|
666
|
+
"description": "Number of records to retrieve per request. Must be between 1 (minimum) and 200 (maximum). Defaults to 25.",
|
|
528
667
|
"required": false,
|
|
529
668
|
"style": "form",
|
|
530
669
|
"explode": true,
|
|
@@ -532,12 +671,14 @@
|
|
|
532
671
|
"type": "integer",
|
|
533
672
|
"format": "int32",
|
|
534
673
|
"default": 25,
|
|
535
|
-
"maximum": 200
|
|
674
|
+
"maximum": 200,
|
|
675
|
+
"minimum": 1
|
|
536
676
|
}
|
|
537
677
|
},
|
|
538
678
|
{
|
|
539
679
|
"name": "offset",
|
|
540
680
|
"in": "query",
|
|
681
|
+
"description": "Used to retrieve the results based on a particular resource offset.",
|
|
541
682
|
"required": false,
|
|
542
683
|
"style": "form",
|
|
543
684
|
"explode": true,
|
|
@@ -556,16 +697,26 @@
|
|
|
556
697
|
"application/json": {
|
|
557
698
|
"schema": {
|
|
558
699
|
"$ref": "#/components/schemas/CouponCodes"
|
|
700
|
+
},
|
|
701
|
+
"examples": {
|
|
702
|
+
"GetCouponCodes": {
|
|
703
|
+
"$ref": "#/components/examples/GetCouponCodes"
|
|
704
|
+
}
|
|
559
705
|
}
|
|
560
706
|
}
|
|
561
707
|
}
|
|
562
708
|
},
|
|
563
709
|
"404": {
|
|
564
|
-
"description": "
|
|
710
|
+
"description": "Returned when the coupon does not exist matching the given ID.\n",
|
|
565
711
|
"content": {
|
|
566
712
|
"application/json": {
|
|
567
713
|
"schema": {
|
|
568
714
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
715
|
+
},
|
|
716
|
+
"examples": {
|
|
717
|
+
"CouponNotFound": {
|
|
718
|
+
"$ref": "#/components/examples/CouponNotFound404"
|
|
719
|
+
}
|
|
569
720
|
}
|
|
570
721
|
}
|
|
571
722
|
}
|
|
@@ -581,11 +732,13 @@
|
|
|
581
732
|
]
|
|
582
733
|
},
|
|
583
734
|
"post": {
|
|
735
|
+
"summary": "Add or delete (modify) multiple codes to and from the supplied coupon.",
|
|
584
736
|
"operationId": "updateCouponCodes",
|
|
585
737
|
"parameters": [
|
|
586
738
|
{
|
|
587
739
|
"name": "couponId",
|
|
588
740
|
"in": "path",
|
|
741
|
+
"description": "The ID of the coupon to create.",
|
|
589
742
|
"required": true,
|
|
590
743
|
"style": "simple",
|
|
591
744
|
"explode": false,
|
|
@@ -597,16 +750,19 @@
|
|
|
597
750
|
{
|
|
598
751
|
"name": "organizationId",
|
|
599
752
|
"in": "path",
|
|
753
|
+
"description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
|
|
600
754
|
"required": true,
|
|
601
755
|
"style": "simple",
|
|
602
756
|
"explode": false,
|
|
603
757
|
"schema": {
|
|
604
758
|
"$ref": "#/components/schemas/OrganizationId"
|
|
605
|
-
}
|
|
759
|
+
},
|
|
760
|
+
"example": "f_ecom_zzxy_prd"
|
|
606
761
|
},
|
|
607
762
|
{
|
|
608
763
|
"name": "delete",
|
|
609
764
|
"in": "query",
|
|
765
|
+
"description": "Pass as true to delete the passed codes.",
|
|
610
766
|
"required": false,
|
|
611
767
|
"style": "form",
|
|
612
768
|
"explode": true,
|
|
@@ -618,11 +774,17 @@
|
|
|
618
774
|
{
|
|
619
775
|
"name": "siteId",
|
|
620
776
|
"in": "query",
|
|
777
|
+
"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.",
|
|
621
778
|
"required": true,
|
|
622
779
|
"style": "form",
|
|
623
780
|
"explode": true,
|
|
624
781
|
"schema": {
|
|
625
782
|
"$ref": "#/components/schemas/SiteId"
|
|
783
|
+
},
|
|
784
|
+
"examples": {
|
|
785
|
+
"SiteId": {
|
|
786
|
+
"value": "RefArch"
|
|
787
|
+
}
|
|
626
788
|
}
|
|
627
789
|
}
|
|
628
790
|
],
|
|
@@ -640,21 +802,31 @@
|
|
|
640
802
|
"description": "Coupon codes successfully updated - this is also returned if we try to add an already existing code or to delete a non-existing code."
|
|
641
803
|
},
|
|
642
804
|
"400": {
|
|
643
|
-
"description": "
|
|
805
|
+
"description": "Returned when the coupon code could not be created.",
|
|
644
806
|
"content": {
|
|
645
807
|
"application/json": {
|
|
646
808
|
"schema": {
|
|
647
809
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
810
|
+
},
|
|
811
|
+
"examples": {
|
|
812
|
+
"updateCoupon400": {
|
|
813
|
+
"$ref": "#/components/examples/CouponCodeCreate400"
|
|
814
|
+
}
|
|
648
815
|
}
|
|
649
816
|
}
|
|
650
817
|
}
|
|
651
818
|
},
|
|
652
819
|
"404": {
|
|
653
|
-
"description": "
|
|
820
|
+
"description": "Returned if the coupon does not exist matching the given ID.\n",
|
|
654
821
|
"content": {
|
|
655
822
|
"application/json": {
|
|
656
823
|
"schema": {
|
|
657
824
|
"$ref": "#/components/schemas/ErrorResponse"
|
|
825
|
+
},
|
|
826
|
+
"examples": {
|
|
827
|
+
"CouponNotFound404": {
|
|
828
|
+
"$ref": "#/components/examples/CouponNotFound404"
|
|
829
|
+
}
|
|
658
830
|
}
|
|
659
831
|
}
|
|
660
832
|
}
|
|
@@ -674,17 +846,42 @@
|
|
|
674
846
|
"schemas": {
|
|
675
847
|
"OrganizationId": {
|
|
676
848
|
"type": "string",
|
|
677
|
-
"
|
|
678
|
-
"
|
|
849
|
+
"description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
|
|
850
|
+
"example": "f_ecom_zzxy_prd",
|
|
851
|
+
"pattern": "^f_ecom_[a-z]{4}_(prd|stg|dev|s[0-9]{2}|[0-9]{3})$"
|
|
679
852
|
},
|
|
680
853
|
"SiteId": {
|
|
681
854
|
"type": "string",
|
|
855
|
+
"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",
|
|
856
|
+
"example": "RefArch",
|
|
682
857
|
"maxLength": 32,
|
|
683
858
|
"minLength": 1
|
|
684
859
|
},
|
|
685
860
|
"Query": {
|
|
686
861
|
"type": "object",
|
|
687
862
|
"additionalProperties": false,
|
|
863
|
+
"description": "A set of objects that define criteria used to select records. A query can contain one of the following:\n* `MatchAllQuery`\n - Matches all documents.\n* `TermQuery`\n - Matches one or more documents against one or more document fields.\n* `TextQuery`\n - Matches text against one or more fields.\n* `BoolQuery`\n - Allows construction of a logical expression of multiple queries.\n* `FilteredQuery`\n - Allows a filter to be applied to a query.\n* `NestedQuery`\n - Allows you to query on nested documents.\n - _Only supported by some Commerce APIs. For more details, see the endpoint descriptions in the API documentation._",
|
|
864
|
+
"example": {
|
|
865
|
+
"filteredQuery": {
|
|
866
|
+
"query": {
|
|
867
|
+
"textQuery": {
|
|
868
|
+
"fields": [
|
|
869
|
+
"couponId"
|
|
870
|
+
],
|
|
871
|
+
"searchPhrase": "disabled"
|
|
872
|
+
}
|
|
873
|
+
},
|
|
874
|
+
"filter": {
|
|
875
|
+
"termFilter": {
|
|
876
|
+
"field": "enabled",
|
|
877
|
+
"operator": "is",
|
|
878
|
+
"values": [
|
|
879
|
+
false
|
|
880
|
+
]
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
},
|
|
688
885
|
"maxProperties": 1,
|
|
689
886
|
"minProperties": 1,
|
|
690
887
|
"properties": {
|
|
@@ -711,21 +908,58 @@
|
|
|
711
908
|
"BoolQuery": {
|
|
712
909
|
"type": "object",
|
|
713
910
|
"additionalProperties": false,
|
|
911
|
+
"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",
|
|
912
|
+
"example": {
|
|
913
|
+
"must": [
|
|
914
|
+
{
|
|
915
|
+
"textQuery": {
|
|
916
|
+
"fields": [
|
|
917
|
+
"couponId"
|
|
918
|
+
],
|
|
919
|
+
"searchPhrase": "DEAL"
|
|
920
|
+
}
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"textQuery": {
|
|
924
|
+
"fields": [
|
|
925
|
+
"description"
|
|
926
|
+
],
|
|
927
|
+
"searchPhrase": "Big bargain deal"
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
],
|
|
931
|
+
"mustNot": [
|
|
932
|
+
{
|
|
933
|
+
"termQuery": {
|
|
934
|
+
"fields": [
|
|
935
|
+
"enabled"
|
|
936
|
+
],
|
|
937
|
+
"operator": "is",
|
|
938
|
+
"values": [
|
|
939
|
+
false
|
|
940
|
+
]
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
]
|
|
944
|
+
},
|
|
714
945
|
"properties": {
|
|
715
946
|
"must": {
|
|
716
947
|
"type": "array",
|
|
948
|
+
"description": "List of queries to be evaluated as an `AND` operator.",
|
|
717
949
|
"items": {
|
|
718
950
|
"$ref": "#/components/schemas/Query"
|
|
719
951
|
}
|
|
720
952
|
},
|
|
721
953
|
"mustNot": {
|
|
722
954
|
"type": "array",
|
|
955
|
+
"description": "List of queries to be evaluated as a `NOT` operator.",
|
|
723
956
|
"items": {
|
|
724
957
|
"$ref": "#/components/schemas/Query"
|
|
725
958
|
}
|
|
726
959
|
},
|
|
727
960
|
"should": {
|
|
728
961
|
"type": "array",
|
|
962
|
+
"description": "List of queries to be evaluated as an `OR` operator.",
|
|
729
963
|
"items": {
|
|
730
964
|
"$ref": "#/components/schemas/Query"
|
|
731
965
|
}
|
|
@@ -735,6 +969,7 @@
|
|
|
735
969
|
"Filter": {
|
|
736
970
|
"type": "object",
|
|
737
971
|
"additionalProperties": false,
|
|
972
|
+
"description": "Contains a set of objects that define criteria used to select records. A filter can contain one of the following:\n * `TermFilter`\n - Matches records where a field (or fields) exactly matches some simple value (including `null`).\n * `RangeFilter`\n - Matches records where a field value lies within a specified range.\n * `Range2Filter`\n - Matches records in a specified range across fields.\n * `QueryFilter`\n - Matches records based on a query.\n * `BoolFilter`\n - Provides filtering of records using a set of filters combined using a logical operator.",
|
|
738
973
|
"maxProperties": 1,
|
|
739
974
|
"minProperties": 1,
|
|
740
975
|
"properties": {
|
|
@@ -758,20 +993,47 @@
|
|
|
758
993
|
"BoolFilter": {
|
|
759
994
|
"type": "object",
|
|
760
995
|
"additionalProperties": false,
|
|
996
|
+
"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.",
|
|
997
|
+
"example": {
|
|
998
|
+
"operator": "and",
|
|
999
|
+
"filters": [
|
|
1000
|
+
{
|
|
1001
|
+
"termFilter": {
|
|
1002
|
+
"field": "id",
|
|
1003
|
+
"operator": "is",
|
|
1004
|
+
"values": [
|
|
1005
|
+
"myId"
|
|
1006
|
+
]
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
"termFilter": {
|
|
1011
|
+
"field": "couponId",
|
|
1012
|
+
"operator": "is",
|
|
1013
|
+
"values": [
|
|
1014
|
+
"couponOne"
|
|
1015
|
+
]
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
]
|
|
1019
|
+
},
|
|
761
1020
|
"properties": {
|
|
762
1021
|
"filters": {
|
|
763
1022
|
"type": "array",
|
|
1023
|
+
"description": "A list of filters that are logically combined by an operator.",
|
|
764
1024
|
"items": {
|
|
765
1025
|
"$ref": "#/components/schemas/Filter"
|
|
766
1026
|
}
|
|
767
1027
|
},
|
|
768
1028
|
"operator": {
|
|
769
1029
|
"type": "string",
|
|
1030
|
+
"description": "The logical operator that is used to combine the filters.",
|
|
770
1031
|
"enum": [
|
|
771
1032
|
"and",
|
|
772
1033
|
"or",
|
|
773
1034
|
"not"
|
|
774
|
-
]
|
|
1035
|
+
],
|
|
1036
|
+
"example": "and"
|
|
775
1037
|
}
|
|
776
1038
|
},
|
|
777
1039
|
"required": [
|
|
@@ -780,6 +1042,7 @@
|
|
|
780
1042
|
},
|
|
781
1043
|
"QueryFilter": {
|
|
782
1044
|
"type": "object",
|
|
1045
|
+
"description": "Wraps any query and allows it to be used as a filter.",
|
|
783
1046
|
"properties": {
|
|
784
1047
|
"query": {
|
|
785
1048
|
"$ref": "#/components/schemas/Query"
|
|
@@ -791,45 +1054,71 @@
|
|
|
791
1054
|
},
|
|
792
1055
|
"Field": {
|
|
793
1056
|
"type": "string",
|
|
1057
|
+
"description": "Name of the field. Might be a custom field name prefixed with c_.",
|
|
1058
|
+
"example": "couponId",
|
|
794
1059
|
"maxLength": 260
|
|
795
1060
|
},
|
|
796
1061
|
"Range2Filter": {
|
|
797
1062
|
"type": "object",
|
|
798
1063
|
"additionalProperties": false,
|
|
1064
|
+
"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.\n\nThe 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`.\n\nThe second range (R2) is defined by `fromValue` and `toValue`.\n\nThe filter mode specifies the method used to compare the two ranges:\n\n* `overlap`: R1 overlaps fully or partially with R2.\n* `containing`: R1 contains R2.\n* `contained`: R1 is contained in R2.\n\nThe 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.\n\nA 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.",
|
|
1065
|
+
"example": {
|
|
1066
|
+
"fromField": "validFrom",
|
|
1067
|
+
"toField": "validTo",
|
|
1068
|
+
"filterMode": "overlap",
|
|
1069
|
+
"fromValue": "2007-01-01T00:00:00.000Z",
|
|
1070
|
+
"toValue": "2017-01-01T00:00:00.000Z"
|
|
1071
|
+
},
|
|
799
1072
|
"properties": {
|
|
800
1073
|
"filterMode": {
|
|
801
1074
|
"type": "string",
|
|
802
1075
|
"default": "overlap",
|
|
1076
|
+
"description": "Compare mode: overlap, containing, or contained.",
|
|
803
1077
|
"enum": [
|
|
804
1078
|
"overlap",
|
|
805
1079
|
"containing",
|
|
806
1080
|
"contained"
|
|
807
|
-
]
|
|
1081
|
+
],
|
|
1082
|
+
"example": "overlap"
|
|
808
1083
|
},
|
|
809
1084
|
"fromField": {
|
|
810
1085
|
"allOf": [
|
|
811
1086
|
{
|
|
812
1087
|
"$ref": "#/components/schemas/Field"
|
|
813
1088
|
}
|
|
814
|
-
]
|
|
1089
|
+
],
|
|
1090
|
+
"description": "The field name of the field that starts the first range.",
|
|
1091
|
+
"example": "validFrom"
|
|
815
1092
|
},
|
|
816
1093
|
"fromInclusive": {
|
|
817
1094
|
"type": "boolean",
|
|
818
|
-
"default": true
|
|
1095
|
+
"default": true,
|
|
1096
|
+
"description": "A flag indicating if the lower bound of the second range is inclusive. To make the lower bound exclusive, set to `false`.",
|
|
1097
|
+
"example": true
|
|
1098
|
+
},
|
|
1099
|
+
"fromValue": {
|
|
1100
|
+
"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.",
|
|
1101
|
+
"example": "2007-01-01T00:00:00.000Z"
|
|
819
1102
|
},
|
|
820
|
-
"fromValue": {},
|
|
821
1103
|
"toField": {
|
|
822
1104
|
"allOf": [
|
|
823
1105
|
{
|
|
824
1106
|
"$ref": "#/components/schemas/Field"
|
|
825
1107
|
}
|
|
826
|
-
]
|
|
1108
|
+
],
|
|
1109
|
+
"description": "The field name of the field that ends the first range.",
|
|
1110
|
+
"example": "validTo"
|
|
827
1111
|
},
|
|
828
1112
|
"toInclusive": {
|
|
829
1113
|
"type": "boolean",
|
|
830
|
-
"default": true
|
|
1114
|
+
"default": true,
|
|
1115
|
+
"description": "A flag indicating if the upper bound of the second range is inclusive. To make the lower bound exclusive, set to `false`.",
|
|
1116
|
+
"example": true
|
|
831
1117
|
},
|
|
832
|
-
"toValue": {
|
|
1118
|
+
"toValue": {
|
|
1119
|
+
"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.",
|
|
1120
|
+
"example": "2017-01-01T00:00:00.000Z"
|
|
1121
|
+
}
|
|
833
1122
|
},
|
|
834
1123
|
"required": [
|
|
835
1124
|
"fromField",
|
|
@@ -838,49 +1127,64 @@
|
|
|
838
1127
|
},
|
|
839
1128
|
"RangeFilter": {
|
|
840
1129
|
"type": "object",
|
|
1130
|
+
"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.\n\nA 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.",
|
|
841
1131
|
"properties": {
|
|
842
1132
|
"field": {
|
|
843
1133
|
"allOf": [
|
|
844
1134
|
{
|
|
845
1135
|
"$ref": "#/components/schemas/Field"
|
|
846
1136
|
}
|
|
847
|
-
]
|
|
1137
|
+
],
|
|
1138
|
+
"description": "The search field.",
|
|
1139
|
+
"example": "validFrom"
|
|
848
1140
|
},
|
|
849
1141
|
"from": {
|
|
1142
|
+
"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.",
|
|
850
1143
|
"oneOf": [
|
|
851
1144
|
{
|
|
852
1145
|
"type": "string",
|
|
853
|
-
"format": "date-time"
|
|
1146
|
+
"format": "date-time",
|
|
1147
|
+
"example": "2007-01-01T00:00:00Z"
|
|
854
1148
|
},
|
|
855
1149
|
{
|
|
856
|
-
"type": "integer"
|
|
1150
|
+
"type": "integer",
|
|
1151
|
+
"example": 1
|
|
857
1152
|
},
|
|
858
1153
|
{
|
|
859
|
-
"type": "number"
|
|
1154
|
+
"type": "number",
|
|
1155
|
+
"example": 1
|
|
860
1156
|
}
|
|
861
1157
|
]
|
|
862
1158
|
},
|
|
863
1159
|
"fromInclusive": {
|
|
864
1160
|
"type": "boolean",
|
|
865
|
-
"default": true
|
|
1161
|
+
"default": true,
|
|
1162
|
+
"description": "A flag indicating if the lower bound of the range is inclusive. To make the lower bound exclusive, set to `false`.",
|
|
1163
|
+
"example": true
|
|
866
1164
|
},
|
|
867
1165
|
"to": {
|
|
1166
|
+
"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.",
|
|
868
1167
|
"oneOf": [
|
|
869
1168
|
{
|
|
870
1169
|
"type": "string",
|
|
871
|
-
"format": "date-time"
|
|
1170
|
+
"format": "date-time",
|
|
1171
|
+
"example": "2007-01-02T00:00:00Z"
|
|
872
1172
|
},
|
|
873
1173
|
{
|
|
874
|
-
"type": "integer"
|
|
1174
|
+
"type": "integer",
|
|
1175
|
+
"example": 2
|
|
875
1176
|
},
|
|
876
1177
|
{
|
|
877
|
-
"type": "number"
|
|
1178
|
+
"type": "number",
|
|
1179
|
+
"example": 2
|
|
878
1180
|
}
|
|
879
1181
|
]
|
|
880
1182
|
},
|
|
881
1183
|
"toInclusive": {
|
|
882
1184
|
"type": "boolean",
|
|
883
|
-
"default": true
|
|
1185
|
+
"default": true,
|
|
1186
|
+
"description": "A flag indicating if the upper bound of the range is inclusive. To make the upper bound exclusive, set to `false`.",
|
|
1187
|
+
"example": true
|
|
884
1188
|
}
|
|
885
1189
|
},
|
|
886
1190
|
"required": [
|
|
@@ -890,16 +1194,26 @@
|
|
|
890
1194
|
"TermFilter": {
|
|
891
1195
|
"type": "object",
|
|
892
1196
|
"additionalProperties": false,
|
|
1197
|
+
"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.",
|
|
1198
|
+
"example": {
|
|
1199
|
+
"field": "id",
|
|
1200
|
+
"operator": "is",
|
|
1201
|
+
"values": [
|
|
1202
|
+
"myId"
|
|
1203
|
+
]
|
|
1204
|
+
},
|
|
893
1205
|
"properties": {
|
|
894
1206
|
"field": {
|
|
895
1207
|
"allOf": [
|
|
896
1208
|
{
|
|
897
1209
|
"$ref": "#/components/schemas/Field"
|
|
898
1210
|
}
|
|
899
|
-
]
|
|
1211
|
+
],
|
|
1212
|
+
"description": "The filter field."
|
|
900
1213
|
},
|
|
901
1214
|
"operator": {
|
|
902
1215
|
"type": "string",
|
|
1216
|
+
"description": "The operator used to compare the field's values with the given values.",
|
|
903
1217
|
"enum": [
|
|
904
1218
|
"is",
|
|
905
1219
|
"one_of",
|
|
@@ -909,12 +1223,15 @@
|
|
|
909
1223
|
"greater",
|
|
910
1224
|
"not_in",
|
|
911
1225
|
"neq"
|
|
912
|
-
]
|
|
1226
|
+
],
|
|
1227
|
+
"example": "is"
|
|
913
1228
|
},
|
|
914
1229
|
"values": {
|
|
915
1230
|
"type": "array",
|
|
1231
|
+
"description": "The filter values.",
|
|
916
1232
|
"items": {
|
|
917
|
-
"type": "string"
|
|
1233
|
+
"type": "string",
|
|
1234
|
+
"example": "myId"
|
|
918
1235
|
}
|
|
919
1236
|
}
|
|
920
1237
|
},
|
|
@@ -926,6 +1243,26 @@
|
|
|
926
1243
|
"FilteredQuery": {
|
|
927
1244
|
"type": "object",
|
|
928
1245
|
"additionalProperties": false,
|
|
1246
|
+
"description": "Allows to filter the result of a possibly complex query using a possibly complex filter.",
|
|
1247
|
+
"example": {
|
|
1248
|
+
"query": {
|
|
1249
|
+
"textQuery": {
|
|
1250
|
+
"fields": [
|
|
1251
|
+
"couponId"
|
|
1252
|
+
],
|
|
1253
|
+
"searchPhrase": "disabled"
|
|
1254
|
+
}
|
|
1255
|
+
},
|
|
1256
|
+
"filter": {
|
|
1257
|
+
"termFilter": {
|
|
1258
|
+
"field": "enabled",
|
|
1259
|
+
"operator": "is",
|
|
1260
|
+
"values": [
|
|
1261
|
+
false
|
|
1262
|
+
]
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
929
1266
|
"properties": {
|
|
930
1267
|
"filter": {
|
|
931
1268
|
"$ref": "#/components/schemas/Filter"
|
|
@@ -940,14 +1277,62 @@
|
|
|
940
1277
|
]
|
|
941
1278
|
},
|
|
942
1279
|
"MatchAllQuery": {
|
|
943
|
-
"type": "object"
|
|
1280
|
+
"type": "object",
|
|
1281
|
+
"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."
|
|
944
1282
|
},
|
|
945
1283
|
"NestedQuery": {
|
|
946
1284
|
"type": "object",
|
|
947
1285
|
"additionalProperties": false,
|
|
1286
|
+
"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",
|
|
1287
|
+
"example": {
|
|
1288
|
+
"path": "order.shippingAddresses",
|
|
1289
|
+
"query": {
|
|
1290
|
+
"boolQuery": {
|
|
1291
|
+
"must": [
|
|
1292
|
+
{
|
|
1293
|
+
"boolQuery": {
|
|
1294
|
+
"must": [
|
|
1295
|
+
{
|
|
1296
|
+
"termQuery": {
|
|
1297
|
+
"fields": [
|
|
1298
|
+
"order.shippingAddresses.firstName"
|
|
1299
|
+
],
|
|
1300
|
+
"operator": "is",
|
|
1301
|
+
"values": [
|
|
1302
|
+
"John"
|
|
1303
|
+
]
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
]
|
|
1307
|
+
}
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
"boolQuery": {
|
|
1311
|
+
"must": [
|
|
1312
|
+
{
|
|
1313
|
+
"termQuery": {
|
|
1314
|
+
"fields": [
|
|
1315
|
+
"order.shippingAddresses.lastName"
|
|
1316
|
+
],
|
|
1317
|
+
"operator": "is",
|
|
1318
|
+
"values": [
|
|
1319
|
+
"Doe"
|
|
1320
|
+
]
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
]
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
]
|
|
1327
|
+
}
|
|
1328
|
+
},
|
|
1329
|
+
"scoreMode": "avg"
|
|
1330
|
+
},
|
|
948
1331
|
"properties": {
|
|
949
1332
|
"path": {
|
|
950
1333
|
"type": "string",
|
|
1334
|
+
"description": "The path to the nested document.",
|
|
1335
|
+
"example": "order.shippingAddresses",
|
|
951
1336
|
"maxLength": 2048
|
|
952
1337
|
},
|
|
953
1338
|
"query": {
|
|
@@ -955,12 +1340,14 @@
|
|
|
955
1340
|
},
|
|
956
1341
|
"scoreMode": {
|
|
957
1342
|
"type": "string",
|
|
1343
|
+
"description": "Indicates how scores for matching child objects affect the root parent document’s relevance score.",
|
|
958
1344
|
"enum": [
|
|
959
1345
|
"avg",
|
|
960
1346
|
"total",
|
|
961
1347
|
"max",
|
|
962
1348
|
"none"
|
|
963
|
-
]
|
|
1349
|
+
],
|
|
1350
|
+
"example": "avg"
|
|
964
1351
|
}
|
|
965
1352
|
},
|
|
966
1353
|
"required": [
|
|
@@ -970,9 +1357,11 @@
|
|
|
970
1357
|
},
|
|
971
1358
|
"TermQuery": {
|
|
972
1359
|
"type": "object",
|
|
1360
|
+
"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.\n\n**Limitations:**\n\n* The `greater` and `less` operators are not supported under certain conditions. Both operators are permitted unless the API documentation states otherwise.\n* 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.",
|
|
973
1361
|
"properties": {
|
|
974
1362
|
"fields": {
|
|
975
1363
|
"type": "array",
|
|
1364
|
+
"description": "The document fields that the values are matched against, combined with the operator.",
|
|
976
1365
|
"items": {
|
|
977
1366
|
"$ref": "#/components/schemas/Field"
|
|
978
1367
|
},
|
|
@@ -980,6 +1369,7 @@
|
|
|
980
1369
|
},
|
|
981
1370
|
"operator": {
|
|
982
1371
|
"type": "string",
|
|
1372
|
+
"description": "Returns the operator to use for the term query.",
|
|
983
1373
|
"enum": [
|
|
984
1374
|
"is",
|
|
985
1375
|
"one_of",
|
|
@@ -989,23 +1379,30 @@
|
|
|
989
1379
|
"greater",
|
|
990
1380
|
"not_in",
|
|
991
1381
|
"neq"
|
|
992
|
-
]
|
|
1382
|
+
],
|
|
1383
|
+
"example": "is"
|
|
993
1384
|
},
|
|
994
1385
|
"values": {
|
|
995
1386
|
"type": "array",
|
|
1387
|
+
"description": "The values that the fields are compared against, combined with the operator.",
|
|
996
1388
|
"items": {
|
|
1389
|
+
"example": "myCouponId",
|
|
997
1390
|
"oneOf": [
|
|
998
1391
|
{
|
|
999
|
-
"type": "string"
|
|
1392
|
+
"type": "string",
|
|
1393
|
+
"example": "myCouponId"
|
|
1000
1394
|
},
|
|
1001
1395
|
{
|
|
1002
|
-
"type": "number"
|
|
1396
|
+
"type": "number",
|
|
1397
|
+
"example": 1
|
|
1003
1398
|
},
|
|
1004
1399
|
{
|
|
1005
|
-
"type": "boolean"
|
|
1400
|
+
"type": "boolean",
|
|
1401
|
+
"example": true
|
|
1006
1402
|
},
|
|
1007
1403
|
{
|
|
1008
|
-
"type": "integer"
|
|
1404
|
+
"type": "integer",
|
|
1405
|
+
"example": 1
|
|
1009
1406
|
}
|
|
1010
1407
|
]
|
|
1011
1408
|
}
|
|
@@ -1019,16 +1416,26 @@
|
|
|
1019
1416
|
"TextQuery": {
|
|
1020
1417
|
"type": "object",
|
|
1021
1418
|
"additionalProperties": false,
|
|
1419
|
+
"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.",
|
|
1420
|
+
"example": {
|
|
1421
|
+
"fields": [
|
|
1422
|
+
"couponId"
|
|
1423
|
+
],
|
|
1424
|
+
"searchPhrase": "limit"
|
|
1425
|
+
},
|
|
1022
1426
|
"properties": {
|
|
1023
1427
|
"fields": {
|
|
1024
1428
|
"type": "array",
|
|
1429
|
+
"description": "The document fields that the search phrase matches against.",
|
|
1025
1430
|
"items": {
|
|
1026
1431
|
"$ref": "#/components/schemas/Field"
|
|
1027
1432
|
},
|
|
1028
1433
|
"minItems": 1
|
|
1029
1434
|
},
|
|
1030
1435
|
"searchPhrase": {
|
|
1031
|
-
"type": "string"
|
|
1436
|
+
"type": "string",
|
|
1437
|
+
"description": "A search phrase, which can include multiple terms separated by spaces.",
|
|
1438
|
+
"example": "campaign summer"
|
|
1032
1439
|
}
|
|
1033
1440
|
},
|
|
1034
1441
|
"required": [
|
|
@@ -1036,28 +1443,30 @@
|
|
|
1036
1443
|
"searchPhrase"
|
|
1037
1444
|
]
|
|
1038
1445
|
},
|
|
1039
|
-
"String256": {
|
|
1040
|
-
"type": "string",
|
|
1041
|
-
"maxLength": 256
|
|
1042
|
-
},
|
|
1043
1446
|
"Sort": {
|
|
1044
1447
|
"type": "object",
|
|
1045
1448
|
"additionalProperties": false,
|
|
1449
|
+
"description": "Document representing a sort request. Each API has a different default sort configuration that can be modified in the request.",
|
|
1450
|
+
"example": {
|
|
1451
|
+
"field": "couponId",
|
|
1452
|
+
"sortOrder": "desc"
|
|
1453
|
+
},
|
|
1046
1454
|
"properties": {
|
|
1047
1455
|
"field": {
|
|
1048
|
-
"
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
]
|
|
1456
|
+
"type": "string",
|
|
1457
|
+
"description": "The name of the field to sort on.",
|
|
1458
|
+
"example": "couponId",
|
|
1459
|
+
"maxLength": 256
|
|
1053
1460
|
},
|
|
1054
1461
|
"sortOrder": {
|
|
1055
1462
|
"type": "string",
|
|
1056
1463
|
"default": "asc",
|
|
1464
|
+
"description": "The sort order to be applied when sorting. When omitted, the default sort order (asc) is used.",
|
|
1057
1465
|
"enum": [
|
|
1058
1466
|
"asc",
|
|
1059
1467
|
"desc"
|
|
1060
|
-
]
|
|
1468
|
+
],
|
|
1469
|
+
"example": "asc"
|
|
1061
1470
|
}
|
|
1062
1471
|
},
|
|
1063
1472
|
"required": [
|
|
@@ -1068,14 +1477,19 @@
|
|
|
1068
1477
|
"type": "integer",
|
|
1069
1478
|
"format": "int32",
|
|
1070
1479
|
"default": 0,
|
|
1480
|
+
"description": "The zero-based index of the first hit/data to include in the result.",
|
|
1481
|
+
"example": 0,
|
|
1071
1482
|
"minimum": 0
|
|
1072
1483
|
},
|
|
1073
1484
|
"SearchRequest": {
|
|
1074
1485
|
"type": "object",
|
|
1486
|
+
"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.",
|
|
1075
1487
|
"properties": {
|
|
1076
1488
|
"limit": {
|
|
1077
1489
|
"type": "integer",
|
|
1078
1490
|
"format": "int32",
|
|
1491
|
+
"description": "Maximum records to retrieve per request, not to exceed 200.",
|
|
1492
|
+
"example": 10,
|
|
1079
1493
|
"maximum": 200,
|
|
1080
1494
|
"minimum": 1
|
|
1081
1495
|
},
|
|
@@ -1084,6 +1498,7 @@
|
|
|
1084
1498
|
},
|
|
1085
1499
|
"sorts": {
|
|
1086
1500
|
"type": "array",
|
|
1501
|
+
"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.",
|
|
1087
1502
|
"items": {
|
|
1088
1503
|
"$ref": "#/components/schemas/Sort"
|
|
1089
1504
|
}
|
|
@@ -1100,14 +1515,19 @@
|
|
|
1100
1515
|
"type": "integer",
|
|
1101
1516
|
"format": "int32",
|
|
1102
1517
|
"default": 0,
|
|
1518
|
+
"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.",
|
|
1519
|
+
"example": 10,
|
|
1103
1520
|
"minimum": 0
|
|
1104
1521
|
},
|
|
1105
1522
|
"ResultBase": {
|
|
1106
1523
|
"type": "object",
|
|
1524
|
+
"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.",
|
|
1107
1525
|
"properties": {
|
|
1108
1526
|
"limit": {
|
|
1109
1527
|
"type": "integer",
|
|
1110
|
-
"format": "int32"
|
|
1528
|
+
"format": "int32",
|
|
1529
|
+
"description": "Maximum records to retrieve per request. The limit with its constraints (minimum, maximum, default) is defined by the request parameter `limit` of the endpoint returning this schema.",
|
|
1530
|
+
"example": 10
|
|
1111
1531
|
},
|
|
1112
1532
|
"total": {
|
|
1113
1533
|
"$ref": "#/components/schemas/Total"
|
|
@@ -1124,6 +1544,7 @@
|
|
|
1124
1544
|
"$ref": "#/components/schemas/ResultBase"
|
|
1125
1545
|
}
|
|
1126
1546
|
],
|
|
1547
|
+
"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`.",
|
|
1127
1548
|
"properties": {
|
|
1128
1549
|
"offset": {
|
|
1129
1550
|
"$ref": "#/components/schemas/Offset"
|
|
@@ -1142,18 +1563,67 @@
|
|
|
1142
1563
|
"$ref": "#/components/schemas/PaginatedResultBase"
|
|
1143
1564
|
}
|
|
1144
1565
|
],
|
|
1566
|
+
"description": "Document representing a generic search result. Each search resource should extend this to define what is returned in the `hits`.",
|
|
1567
|
+
"example": {
|
|
1568
|
+
"limit": 1,
|
|
1569
|
+
"hits": [
|
|
1570
|
+
{
|
|
1571
|
+
"couponId": "coupon1",
|
|
1572
|
+
"creationDate": "2019-10-20T12:00:00Z",
|
|
1573
|
+
"description": "This coupon is used to give 10% off stuff.",
|
|
1574
|
+
"enabled": false,
|
|
1575
|
+
"exportedCodeCount": 0,
|
|
1576
|
+
"lastModified": "2019-10-30T04:23:59Z",
|
|
1577
|
+
"redemptionCount": 3,
|
|
1578
|
+
"redemptionLimits": {
|
|
1579
|
+
"limitPerCode": 1,
|
|
1580
|
+
"limitPerCustomer": 1,
|
|
1581
|
+
"limitPerTimeFrame": {
|
|
1582
|
+
"limit": 2,
|
|
1583
|
+
"redemptionTimeFrame": 24
|
|
1584
|
+
}
|
|
1585
|
+
},
|
|
1586
|
+
"singleCode": "MyCode",
|
|
1587
|
+
"systemCodesConfig": {
|
|
1588
|
+
"codePrefix": "SG",
|
|
1589
|
+
"numberOfCodes": 500000
|
|
1590
|
+
},
|
|
1591
|
+
"totalCodesCount": 50,
|
|
1592
|
+
"type": "single_code"
|
|
1593
|
+
}
|
|
1594
|
+
],
|
|
1595
|
+
"query": {
|
|
1596
|
+
"textQuery": {
|
|
1597
|
+
"fields": [
|
|
1598
|
+
"id",
|
|
1599
|
+
"description"
|
|
1600
|
+
],
|
|
1601
|
+
"searchPhrase": "stuff"
|
|
1602
|
+
}
|
|
1603
|
+
},
|
|
1604
|
+
"sorts": [
|
|
1605
|
+
{
|
|
1606
|
+
"field": "couponId",
|
|
1607
|
+
"sortOrder": "desc"
|
|
1608
|
+
}
|
|
1609
|
+
],
|
|
1610
|
+
"offset": 2,
|
|
1611
|
+
"total": 8
|
|
1612
|
+
},
|
|
1145
1613
|
"properties": {
|
|
1146
1614
|
"query": {
|
|
1147
1615
|
"$ref": "#/components/schemas/Query"
|
|
1148
1616
|
},
|
|
1149
1617
|
"sorts": {
|
|
1150
1618
|
"type": "array",
|
|
1619
|
+
"description": "The sorting that was applied to the result.",
|
|
1151
1620
|
"items": {
|
|
1152
1621
|
"$ref": "#/components/schemas/Sort"
|
|
1153
1622
|
}
|
|
1154
1623
|
},
|
|
1155
1624
|
"hits": {
|
|
1156
1625
|
"type": "array",
|
|
1626
|
+
"description": "The sorted array of search hits. Can be empty.",
|
|
1157
1627
|
"items": {
|
|
1158
1628
|
"type": "object"
|
|
1159
1629
|
}
|
|
@@ -1166,15 +1636,20 @@
|
|
|
1166
1636
|
"RedemptionLimitPerPeriod": {
|
|
1167
1637
|
"type": "object",
|
|
1168
1638
|
"additionalProperties": false,
|
|
1639
|
+
"description": "Document representing a coupon redemption limit.",
|
|
1169
1640
|
"properties": {
|
|
1170
1641
|
"limit": {
|
|
1171
1642
|
"type": "integer",
|
|
1172
1643
|
"format": "int32",
|
|
1644
|
+
"description": "The limit on the number of times a coupon can be redeemed for a specified redemption time period.",
|
|
1645
|
+
"example": 1,
|
|
1173
1646
|
"minimum": 0
|
|
1174
1647
|
},
|
|
1175
1648
|
"redemptionTimeFrame": {
|
|
1176
1649
|
"type": "integer",
|
|
1177
1650
|
"format": "int32",
|
|
1651
|
+
"description": "The redemption time period.",
|
|
1652
|
+
"example": 24,
|
|
1178
1653
|
"maximum": 999,
|
|
1179
1654
|
"minimum": 0
|
|
1180
1655
|
}
|
|
@@ -1187,15 +1662,20 @@
|
|
|
1187
1662
|
"RedemptionLimits": {
|
|
1188
1663
|
"type": "object",
|
|
1189
1664
|
"additionalProperties": false,
|
|
1665
|
+
"description": "Document representing a coupon.",
|
|
1190
1666
|
"properties": {
|
|
1191
1667
|
"limitPerCode": {
|
|
1192
1668
|
"type": "integer",
|
|
1193
1669
|
"format": "int32",
|
|
1670
|
+
"description": "The redemption limit per code.",
|
|
1671
|
+
"example": 0,
|
|
1194
1672
|
"minimum": 0
|
|
1195
1673
|
},
|
|
1196
1674
|
"limitPerCustomer": {
|
|
1197
1675
|
"type": "integer",
|
|
1198
1676
|
"format": "int32",
|
|
1677
|
+
"description": "The redemption limit per customer.",
|
|
1678
|
+
"example": 0,
|
|
1199
1679
|
"minimum": 0
|
|
1200
1680
|
},
|
|
1201
1681
|
"limitPerTimeFrame": {
|
|
@@ -1203,7 +1683,12 @@
|
|
|
1203
1683
|
{
|
|
1204
1684
|
"$ref": "#/components/schemas/RedemptionLimitPerPeriod"
|
|
1205
1685
|
}
|
|
1206
|
-
]
|
|
1686
|
+
],
|
|
1687
|
+
"description": "The redemption limit per time frame.",
|
|
1688
|
+
"example": {
|
|
1689
|
+
"redemptionTimeFrame": 24,
|
|
1690
|
+
"limit": 1
|
|
1691
|
+
}
|
|
1207
1692
|
}
|
|
1208
1693
|
},
|
|
1209
1694
|
"required": [
|
|
@@ -1217,11 +1702,15 @@
|
|
|
1217
1702
|
"additionalProperties": false,
|
|
1218
1703
|
"properties": {
|
|
1219
1704
|
"codePrefix": {
|
|
1220
|
-
"type": "string"
|
|
1705
|
+
"type": "string",
|
|
1706
|
+
"description": "The code prefix for system-generated coupon codes.",
|
|
1707
|
+
"example": "SG"
|
|
1221
1708
|
},
|
|
1222
1709
|
"numberOfCodes": {
|
|
1223
1710
|
"type": "integer",
|
|
1224
|
-
"format": "int32"
|
|
1711
|
+
"format": "int32",
|
|
1712
|
+
"description": "The number of system coupon codes that can be issued.",
|
|
1713
|
+
"example": 50000
|
|
1225
1714
|
}
|
|
1226
1715
|
},
|
|
1227
1716
|
"required": [
|
|
@@ -1232,44 +1721,70 @@
|
|
|
1232
1721
|
"Coupon": {
|
|
1233
1722
|
"type": "object",
|
|
1234
1723
|
"additionalProperties": false,
|
|
1724
|
+
"description": "Document representing a coupon.",
|
|
1235
1725
|
"properties": {
|
|
1236
1726
|
"couponId": {
|
|
1237
1727
|
"type": "string",
|
|
1728
|
+
"description": "The ID of the coupon.",
|
|
1729
|
+
"example": "MyCoupon",
|
|
1238
1730
|
"maxLength": 256,
|
|
1239
1731
|
"minLength": 1
|
|
1240
1732
|
},
|
|
1241
1733
|
"creationDate": {
|
|
1242
1734
|
"type": "string",
|
|
1243
|
-
"format": "date-time"
|
|
1735
|
+
"format": "date-time",
|
|
1736
|
+
"description": "Returns the value of attribute 'creationDate'.",
|
|
1737
|
+
"example": "2019-10-20T12:00:00Z"
|
|
1244
1738
|
},
|
|
1245
1739
|
"description": {
|
|
1246
1740
|
"type": "string",
|
|
1741
|
+
"description": "The description of the coupon.",
|
|
1742
|
+
"example": "This coupon is used to give 10% off stuff.\n",
|
|
1247
1743
|
"maxLength": 4000
|
|
1248
1744
|
},
|
|
1249
1745
|
"enabled": {
|
|
1250
|
-
"type": "boolean"
|
|
1746
|
+
"type": "boolean",
|
|
1747
|
+
"description": "A flag indicating whether the coupon is enabled.",
|
|
1748
|
+
"example": false
|
|
1251
1749
|
},
|
|
1252
1750
|
"exportedCodeCount": {
|
|
1253
1751
|
"type": "integer",
|
|
1254
|
-
"format": "int32"
|
|
1752
|
+
"format": "int32",
|
|
1753
|
+
"description": "The number of coupon codes attached to the coupon that have been issued (read only).",
|
|
1754
|
+
"example": 0
|
|
1255
1755
|
},
|
|
1256
1756
|
"lastModified": {
|
|
1257
1757
|
"type": "string",
|
|
1258
|
-
"format": "date-time"
|
|
1758
|
+
"format": "date-time",
|
|
1759
|
+
"description": "Returns the value of attribute 'lastModified'.",
|
|
1760
|
+
"example": "2019-10-30T04:23:59Z"
|
|
1259
1761
|
},
|
|
1260
1762
|
"redemptionCount": {
|
|
1261
1763
|
"type": "integer",
|
|
1262
|
-
"format": "int32"
|
|
1764
|
+
"format": "int32",
|
|
1765
|
+
"description": "The number of times the coupon has been redeemed (read only). The count is updated once per hour.",
|
|
1766
|
+
"example": 3
|
|
1263
1767
|
},
|
|
1264
1768
|
"redemptionLimits": {
|
|
1265
1769
|
"allOf": [
|
|
1266
1770
|
{
|
|
1267
1771
|
"$ref": "#/components/schemas/RedemptionLimits"
|
|
1268
1772
|
}
|
|
1269
|
-
]
|
|
1773
|
+
],
|
|
1774
|
+
"description": "The redemption limit per coupon code.",
|
|
1775
|
+
"example": {
|
|
1776
|
+
"limitPerCode": 1,
|
|
1777
|
+
"limitPerCustomer": 1,
|
|
1778
|
+
"limitPerTimeFrame": {
|
|
1779
|
+
"limit": 2,
|
|
1780
|
+
"redemptionTimeFrame": 24
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1270
1783
|
},
|
|
1271
1784
|
"singleCode": {
|
|
1272
1785
|
"type": "string",
|
|
1786
|
+
"description": "Single coupon code, only valid for Single Code type.",
|
|
1787
|
+
"example": "MyCode",
|
|
1273
1788
|
"maxLength": 256,
|
|
1274
1789
|
"minLength": 1
|
|
1275
1790
|
},
|
|
@@ -1278,19 +1793,28 @@
|
|
|
1278
1793
|
{
|
|
1279
1794
|
"$ref": "#/components/schemas/CouponSystemCodeConfig"
|
|
1280
1795
|
}
|
|
1281
|
-
]
|
|
1796
|
+
],
|
|
1797
|
+
"description": "The configuration of system coupon codes, including prefix and number of codes.",
|
|
1798
|
+
"example": {
|
|
1799
|
+
"codePrefix": "SG",
|
|
1800
|
+
"numberOfCodes": 500000
|
|
1801
|
+
}
|
|
1282
1802
|
},
|
|
1283
1803
|
"totalCodesCount": {
|
|
1284
1804
|
"type": "integer",
|
|
1285
|
-
"format": "int32"
|
|
1805
|
+
"format": "int32",
|
|
1806
|
+
"description": "The total number of coupon codes associated with this coupon (read only). The count is updated once per hour.",
|
|
1807
|
+
"example": 50
|
|
1286
1808
|
},
|
|
1287
1809
|
"type": {
|
|
1288
1810
|
"type": "string",
|
|
1811
|
+
"description": "The type of coupon code.",
|
|
1289
1812
|
"enum": [
|
|
1290
1813
|
"single_code",
|
|
1291
1814
|
"multiple_codes",
|
|
1292
1815
|
"system_codes"
|
|
1293
|
-
]
|
|
1816
|
+
],
|
|
1817
|
+
"example": "single_code"
|
|
1294
1818
|
}
|
|
1295
1819
|
},
|
|
1296
1820
|
"required": [
|
|
@@ -1305,9 +1829,11 @@
|
|
|
1305
1829
|
"$ref": "#/components/schemas/PaginatedSearchResult"
|
|
1306
1830
|
}
|
|
1307
1831
|
],
|
|
1832
|
+
"description": "Document representing a coupon search result.",
|
|
1308
1833
|
"properties": {
|
|
1309
1834
|
"hits": {
|
|
1310
1835
|
"type": "array",
|
|
1836
|
+
"description": "The sorted array of coupon search hits. Can be empty.",
|
|
1311
1837
|
"items": {
|
|
1312
1838
|
"$ref": "#/components/schemas/Coupon"
|
|
1313
1839
|
}
|
|
@@ -1320,25 +1846,32 @@
|
|
|
1320
1846
|
"CouponRedemption": {
|
|
1321
1847
|
"type": "object",
|
|
1322
1848
|
"additionalProperties": false,
|
|
1849
|
+
"description": "A redemption record returned from the coupon redemption resources.",
|
|
1323
1850
|
"properties": {
|
|
1324
1851
|
"code": {
|
|
1325
|
-
"type": "string"
|
|
1852
|
+
"type": "string",
|
|
1853
|
+
"description": "The coupon code that was redeemed."
|
|
1326
1854
|
},
|
|
1327
1855
|
"couponId": {
|
|
1328
|
-
"type": "string"
|
|
1856
|
+
"type": "string",
|
|
1857
|
+
"description": "The coupon id that was redeemed."
|
|
1329
1858
|
},
|
|
1330
1859
|
"creationDate": {
|
|
1331
1860
|
"type": "string",
|
|
1332
|
-
"format": "date-time"
|
|
1861
|
+
"format": "date-time",
|
|
1862
|
+
"description": "Date when the redemption was created."
|
|
1333
1863
|
},
|
|
1334
1864
|
"customerEmail": {
|
|
1335
|
-
"type": "string"
|
|
1865
|
+
"type": "string",
|
|
1866
|
+
"description": "The customer email that was used to redeem it."
|
|
1336
1867
|
},
|
|
1337
1868
|
"orderNo": {
|
|
1338
|
-
"type": "string"
|
|
1869
|
+
"type": "string",
|
|
1870
|
+
"description": "The order number where the redemption occurred."
|
|
1339
1871
|
},
|
|
1340
1872
|
"viewOrderUrl": {
|
|
1341
|
-
"type": "string"
|
|
1873
|
+
"type": "string",
|
|
1874
|
+
"description": "A URL able to access the order."
|
|
1342
1875
|
}
|
|
1343
1876
|
},
|
|
1344
1877
|
"required": [
|
|
@@ -1356,9 +1889,11 @@
|
|
|
1356
1889
|
"$ref": "#/components/schemas/PaginatedSearchResult"
|
|
1357
1890
|
}
|
|
1358
1891
|
],
|
|
1892
|
+
"description": "The result of the coupon redemption search.",
|
|
1359
1893
|
"properties": {
|
|
1360
1894
|
"hits": {
|
|
1361
1895
|
"type": "array",
|
|
1896
|
+
"description": "The array of coupon redemption search hits. Can be empty.",
|
|
1362
1897
|
"items": {
|
|
1363
1898
|
"$ref": "#/components/schemas/CouponRedemption"
|
|
1364
1899
|
}
|
|
@@ -1371,15 +1906,22 @@
|
|
|
1371
1906
|
"CouponCodeRedemptionRequest": {
|
|
1372
1907
|
"type": "object",
|
|
1373
1908
|
"additionalProperties": false,
|
|
1909
|
+
"description": "Document representing a request to redeem a coupon.",
|
|
1374
1910
|
"properties": {
|
|
1375
1911
|
"code": {
|
|
1376
|
-
"type": "string"
|
|
1912
|
+
"type": "string",
|
|
1913
|
+
"description": "The coupon code to redeem.",
|
|
1914
|
+
"example": "Code1"
|
|
1377
1915
|
},
|
|
1378
1916
|
"customerEmail": {
|
|
1379
|
-
"type": "string"
|
|
1917
|
+
"type": "string",
|
|
1918
|
+
"description": "The customer email to use on the redemption.",
|
|
1919
|
+
"example": "shopper@salesforce-test.com"
|
|
1380
1920
|
},
|
|
1381
1921
|
"orderNo": {
|
|
1382
|
-
"type": "string"
|
|
1922
|
+
"type": "string",
|
|
1923
|
+
"description": "The order number to use on the redemption. In case the coupon \nwas redeemed externally and no order number is associated, use \na reference id or custom string to identify the source of the \nredemption.\n",
|
|
1924
|
+
"example": "00023120@store4"
|
|
1383
1925
|
}
|
|
1384
1926
|
},
|
|
1385
1927
|
"required": [
|
|
@@ -1393,17 +1935,25 @@
|
|
|
1393
1935
|
"properties": {
|
|
1394
1936
|
"title": {
|
|
1395
1937
|
"type": "string",
|
|
1938
|
+
"description": "A short, human-readable summary of the problem\ntype. It will not change from occurrence to occurrence of the \nproblem, except for purposes of localization\n",
|
|
1939
|
+
"example": "You do not have enough credit",
|
|
1396
1940
|
"maxLength": 256
|
|
1397
1941
|
},
|
|
1398
1942
|
"type": {
|
|
1399
1943
|
"type": "string",
|
|
1944
|
+
"description": "A URI reference [RFC3986] that identifies the\nproblem type. This specification encourages that, when\ndereferenced, it provide human-readable documentation for the\nproblem type (e.g., using HTML [W3C.REC-html5-20141028]). When\nthis member is not present, its value is assumed to be\n\"about:blank\". It accepts relative URIs; this means\nthat they must be resolved relative to the document's base URI, as\nper [RFC3986], Section 5.\n",
|
|
1945
|
+
"example": "NotEnoughMoney",
|
|
1400
1946
|
"maxLength": 2048
|
|
1401
1947
|
},
|
|
1402
1948
|
"detail": {
|
|
1403
|
-
"type": "string"
|
|
1949
|
+
"type": "string",
|
|
1950
|
+
"description": "A human-readable explanation specific to this occurrence of the problem.",
|
|
1951
|
+
"example": "Your current balance is 30, but that costs 50"
|
|
1404
1952
|
},
|
|
1405
1953
|
"instance": {
|
|
1406
1954
|
"type": "string",
|
|
1955
|
+
"description": "A URI reference that identifies the specific\noccurrence of the problem. It may or may not yield further\ninformation if dereferenced. It accepts relative URIs; this means\nthat they must be resolved relative to the document's base URI, as\nper [RFC3986], Section 5.\n",
|
|
1956
|
+
"example": "/account/12345/msgs/abc",
|
|
1407
1957
|
"maxLength": 2048
|
|
1408
1958
|
}
|
|
1409
1959
|
},
|
|
@@ -1416,16 +1966,23 @@
|
|
|
1416
1966
|
"CouponCode": {
|
|
1417
1967
|
"type": "object",
|
|
1418
1968
|
"additionalProperties": false,
|
|
1969
|
+
"description": "A coupon code with accompanying stats for redemptions and issues.",
|
|
1419
1970
|
"properties": {
|
|
1420
1971
|
"code": {
|
|
1421
|
-
"type": "string"
|
|
1972
|
+
"type": "string",
|
|
1973
|
+
"description": "The code used to redeem the coupon.",
|
|
1974
|
+
"example": "MyCode"
|
|
1422
1975
|
},
|
|
1423
1976
|
"issued": {
|
|
1424
|
-
"type": "boolean"
|
|
1977
|
+
"type": "boolean",
|
|
1978
|
+
"description": "Flag indicating if the coupon code has been issued.",
|
|
1979
|
+
"example": true
|
|
1425
1980
|
},
|
|
1426
1981
|
"redemptionCount": {
|
|
1427
1982
|
"type": "integer",
|
|
1428
|
-
"format": "int32"
|
|
1983
|
+
"format": "int32",
|
|
1984
|
+
"description": "The count of the number of redemptions associated with the code.",
|
|
1985
|
+
"example": 1
|
|
1429
1986
|
}
|
|
1430
1987
|
},
|
|
1431
1988
|
"required": [
|
|
@@ -1440,9 +1997,18 @@
|
|
|
1440
1997
|
"$ref": "#/components/schemas/PaginatedResultBase"
|
|
1441
1998
|
}
|
|
1442
1999
|
],
|
|
2000
|
+
"description": "Document representing a set of coupon codes.",
|
|
1443
2001
|
"properties": {
|
|
1444
2002
|
"data": {
|
|
1445
2003
|
"type": "array",
|
|
2004
|
+
"description": "The collection of coupon codes.",
|
|
2005
|
+
"example": [
|
|
2006
|
+
{
|
|
2007
|
+
"code": "Code1",
|
|
2008
|
+
"issued": false,
|
|
2009
|
+
"redemptionCount": 0
|
|
2010
|
+
}
|
|
2011
|
+
],
|
|
1446
2012
|
"items": {
|
|
1447
2013
|
"$ref": "#/components/schemas/CouponCode"
|
|
1448
2014
|
}
|
|
@@ -1456,9 +2022,15 @@
|
|
|
1456
2022
|
"CouponMultiCodesRequest": {
|
|
1457
2023
|
"type": "object",
|
|
1458
2024
|
"additionalProperties": false,
|
|
2025
|
+
"description": "A request object to add and remove coupon codes from a document.",
|
|
1459
2026
|
"properties": {
|
|
1460
2027
|
"codes": {
|
|
1461
2028
|
"type": "array",
|
|
2029
|
+
"description": "The list of coupon codes to add or delete.",
|
|
2030
|
+
"example": [
|
|
2031
|
+
"CodeA",
|
|
2032
|
+
"CodeB"
|
|
2033
|
+
],
|
|
1462
2034
|
"items": {
|
|
1463
2035
|
"type": "string",
|
|
1464
2036
|
"maxLength": 256,
|
|
@@ -1476,26 +2048,35 @@
|
|
|
1476
2048
|
"organizationId": {
|
|
1477
2049
|
"name": "organizationId",
|
|
1478
2050
|
"in": "path",
|
|
2051
|
+
"description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
|
|
1479
2052
|
"required": true,
|
|
1480
2053
|
"style": "simple",
|
|
1481
2054
|
"explode": false,
|
|
1482
2055
|
"schema": {
|
|
1483
2056
|
"$ref": "#/components/schemas/OrganizationId"
|
|
1484
|
-
}
|
|
2057
|
+
},
|
|
2058
|
+
"example": "f_ecom_zzxy_prd"
|
|
1485
2059
|
},
|
|
1486
2060
|
"siteId": {
|
|
1487
2061
|
"name": "siteId",
|
|
1488
2062
|
"in": "query",
|
|
2063
|
+
"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.",
|
|
1489
2064
|
"required": true,
|
|
1490
2065
|
"style": "form",
|
|
1491
2066
|
"explode": true,
|
|
1492
2067
|
"schema": {
|
|
1493
2068
|
"$ref": "#/components/schemas/SiteId"
|
|
2069
|
+
},
|
|
2070
|
+
"examples": {
|
|
2071
|
+
"SiteId": {
|
|
2072
|
+
"value": "RefArch"
|
|
2073
|
+
}
|
|
1494
2074
|
}
|
|
1495
2075
|
},
|
|
1496
2076
|
"couponId": {
|
|
1497
2077
|
"name": "couponId",
|
|
1498
2078
|
"in": "path",
|
|
2079
|
+
"description": "The ID of the coupon to create.",
|
|
1499
2080
|
"required": true,
|
|
1500
2081
|
"style": "simple",
|
|
1501
2082
|
"explode": false,
|
|
@@ -1507,6 +2088,7 @@
|
|
|
1507
2088
|
"delete": {
|
|
1508
2089
|
"name": "delete",
|
|
1509
2090
|
"in": "query",
|
|
2091
|
+
"description": "Pass as true to delete the passed codes.",
|
|
1510
2092
|
"required": false,
|
|
1511
2093
|
"style": "form",
|
|
1512
2094
|
"explode": true,
|
|
@@ -1516,9 +2098,156 @@
|
|
|
1516
2098
|
}
|
|
1517
2099
|
}
|
|
1518
2100
|
},
|
|
2101
|
+
"examples": {
|
|
2102
|
+
"PostRedeemCoupon": {
|
|
2103
|
+
"value": {
|
|
2104
|
+
"code": "Code1",
|
|
2105
|
+
"customerEmail": "shopper@salesforce-test.com",
|
|
2106
|
+
"orderNo": "00023120@store4"
|
|
2107
|
+
}
|
|
2108
|
+
},
|
|
2109
|
+
"CouponCodeNotRedeemable400": {
|
|
2110
|
+
"value": {
|
|
2111
|
+
"type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/coupon-code-not-redeemable",
|
|
2112
|
+
"title": "Coupon Code Not Redeemable",
|
|
2113
|
+
"detail": "The coupon code 'CODE374' in site 'RefArch' is not redeemable because 'COUPON_DISABLED'.",
|
|
2114
|
+
"errorCode": "COUPON_DISABLED",
|
|
2115
|
+
"couponCode": "CODE374",
|
|
2116
|
+
"siteId": "RefArch"
|
|
2117
|
+
}
|
|
2118
|
+
},
|
|
2119
|
+
"CouponCodeNotFound404": {
|
|
2120
|
+
"value": {
|
|
2121
|
+
"type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/coupon-not-found",
|
|
2122
|
+
"title": "Coupon Not Found",
|
|
2123
|
+
"detail": "No coupon for the given coupon code 'CODE374' and site 'RefArch' could be found.",
|
|
2124
|
+
"couponCode": "CODE374",
|
|
2125
|
+
"siteId": "RefArch"
|
|
2126
|
+
}
|
|
2127
|
+
},
|
|
2128
|
+
"Coupon": {
|
|
2129
|
+
"value": {
|
|
2130
|
+
"couponId": "MyCoupon",
|
|
2131
|
+
"creationDate": "2019-10-20T12:00:00Z",
|
|
2132
|
+
"description": "This coupon is used to give 10% off stuff.",
|
|
2133
|
+
"enabled": false,
|
|
2134
|
+
"exportedCodeCount": 0,
|
|
2135
|
+
"lastModified": "2019-10-30T04:23:59Z",
|
|
2136
|
+
"redemptionCount": 3,
|
|
2137
|
+
"redemptionLimits": {
|
|
2138
|
+
"limitPerCode": 0,
|
|
2139
|
+
"limitPerCustomer": 0,
|
|
2140
|
+
"limitPerTimeFrame": {
|
|
2141
|
+
"redemptionTimeFrame": 24,
|
|
2142
|
+
"limit": 1
|
|
2143
|
+
}
|
|
2144
|
+
},
|
|
2145
|
+
"singleCode": "MyCode",
|
|
2146
|
+
"systemCodesConfig": {
|
|
2147
|
+
"codePrefix": "SG",
|
|
2148
|
+
"numberOfCodes": 50000
|
|
2149
|
+
},
|
|
2150
|
+
"totalCodesCount": 50,
|
|
2151
|
+
"type": "single_code"
|
|
2152
|
+
}
|
|
2153
|
+
},
|
|
2154
|
+
"CouponNotFound404": {
|
|
2155
|
+
"value": {
|
|
2156
|
+
"type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/coupon-not-found",
|
|
2157
|
+
"title": "Coupon Not Found",
|
|
2158
|
+
"detail": "No coupon with ID 'foo' for site 'RefArch' could be found.",
|
|
2159
|
+
"couponId": "foo",
|
|
2160
|
+
"siteId": "RefArch"
|
|
2161
|
+
}
|
|
2162
|
+
},
|
|
2163
|
+
"CouponCodeDuplicate400": {
|
|
2164
|
+
"value": {
|
|
2165
|
+
"type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/coupon-code-duplicate",
|
|
2166
|
+
"title": "Coupon Code Duplicate",
|
|
2167
|
+
"detail": "The coupon code 'bar' is already used in coupon 'foo'. Please make sure the code is unique.",
|
|
2168
|
+
"couponId": "foo",
|
|
2169
|
+
"couponCode": "bar"
|
|
2170
|
+
}
|
|
2171
|
+
},
|
|
2172
|
+
"SiteAccessForbidden403": {
|
|
2173
|
+
"value": {
|
|
2174
|
+
"type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/site-access-forbidden",
|
|
2175
|
+
"title": "Site Access Forbidden",
|
|
2176
|
+
"detail": "Site-specific access via '/s/RefArch/' isn't allowed. Organization-specific access is expected via '/s/-/'.",
|
|
2177
|
+
"siteId": "RefArch"
|
|
2178
|
+
}
|
|
2179
|
+
},
|
|
2180
|
+
"UpdateCoupon": {
|
|
2181
|
+
"value": {
|
|
2182
|
+
"couponId": "MyCoupon",
|
|
2183
|
+
"creationDate": "2019-10-20T12:00:00Z",
|
|
2184
|
+
"description": "This coupon is used to give 10% off stuff.",
|
|
2185
|
+
"enabled": false,
|
|
2186
|
+
"exportedCodeCount": 0,
|
|
2187
|
+
"lastModified": "2019-10-30T04:23:59Z",
|
|
2188
|
+
"redemptionCount": 3,
|
|
2189
|
+
"redemptionLimits": {
|
|
2190
|
+
"limitPerCode": 0,
|
|
2191
|
+
"limitPerCustomer": 0,
|
|
2192
|
+
"limitPerTimeFrame": {
|
|
2193
|
+
"redemptionTimeFrame": 24,
|
|
2194
|
+
"limit": 1
|
|
2195
|
+
}
|
|
2196
|
+
},
|
|
2197
|
+
"singleCode": "MyCode",
|
|
2198
|
+
"systemCodesConfig": {
|
|
2199
|
+
"codePrefix": "SG",
|
|
2200
|
+
"numberOfCodes": 50000
|
|
2201
|
+
},
|
|
2202
|
+
"totalCodesCount": 50,
|
|
2203
|
+
"type": "single_code"
|
|
2204
|
+
}
|
|
2205
|
+
},
|
|
2206
|
+
"LegacyCouponCoupon403": {
|
|
2207
|
+
"value": {
|
|
2208
|
+
"type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/coupon-legacy-update-forbidden",
|
|
2209
|
+
"title": "Coupon Legacy Update Forbidden",
|
|
2210
|
+
"detail": "The coupon 'foo' can't be modified because it was created before Release 16.7.2. Customers can still redeem this coupon code on the Storefront.",
|
|
2211
|
+
"couponId": "foo"
|
|
2212
|
+
}
|
|
2213
|
+
},
|
|
2214
|
+
"GetCouponCodes": {
|
|
2215
|
+
"value": {
|
|
2216
|
+
"limit": 3,
|
|
2217
|
+
"offset": 0,
|
|
2218
|
+
"total": 50,
|
|
2219
|
+
"data": [
|
|
2220
|
+
{
|
|
2221
|
+
"code": "CodeA",
|
|
2222
|
+
"issued": false,
|
|
2223
|
+
"redemptionCount": 0
|
|
2224
|
+
},
|
|
2225
|
+
{
|
|
2226
|
+
"code": "CodeB",
|
|
2227
|
+
"issued": false,
|
|
2228
|
+
"redemptionCount": 0
|
|
2229
|
+
},
|
|
2230
|
+
{
|
|
2231
|
+
"code": "CodeC",
|
|
2232
|
+
"issued": false,
|
|
2233
|
+
"redemptionCount": 0
|
|
2234
|
+
}
|
|
2235
|
+
]
|
|
2236
|
+
}
|
|
2237
|
+
},
|
|
2238
|
+
"CouponCodeCreate400": {
|
|
2239
|
+
"value": {
|
|
2240
|
+
"type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/coupon-code-create",
|
|
2241
|
+
"title": "Coupon Code Create",
|
|
2242
|
+
"detail": "The coupon code 'bar' couldn't be created. Please make sure the code is valid.",
|
|
2243
|
+
"couponCode": "bar"
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
},
|
|
1519
2247
|
"securitySchemes": {
|
|
1520
2248
|
"AmOAuth2": {
|
|
1521
2249
|
"type": "oauth2",
|
|
2250
|
+
"description": "AccountManager OAuth 2.0 bearer token Authentication.",
|
|
1522
2251
|
"flows": {
|
|
1523
2252
|
"clientCredentials": {
|
|
1524
2253
|
"tokenUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
|
|
@@ -1530,10 +2259,8 @@
|
|
|
1530
2259
|
"authorizationCode": {
|
|
1531
2260
|
"authorizationUrl": "https://account.demandware.com/dwsso/oauth2/authorize",
|
|
1532
2261
|
"tokenUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
|
|
1533
|
-
"
|
|
1534
|
-
|
|
1535
|
-
"sfcc.promotions.rw": "promotions read/write"
|
|
1536
|
-
}
|
|
2262
|
+
"refreshUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
|
|
2263
|
+
"scopes": {}
|
|
1537
2264
|
}
|
|
1538
2265
|
}
|
|
1539
2266
|
}
|