Marketing campaign (1.0)
Download OpenAPI specification:Download
Allows define specific cart behaviour in set time frame.
Available customization Filter products available in cart. Define custom prices (along with price service).
Campaign is triggered by URL query parameter "mktop" while creating the cart e.g. https://my-store-url/checkout/add?mktop=my_mkt_name_example&product=ef974b53-4aa1-4378-9798-97b9168bf884
listCampaign
Get items
Authorizations:
query Parameters
size | integer <int64> Default: 50 Amount of items returned per pagination page |
page | integer <int64> Default: 0 Pagination page starting from 0 |
sort | string Example: sort=createDate,desc Sort list results Format: entity_field_name,order. Format entity collection: entity_sub_object_name.sub_field_name,order. |
customerId | string Example: customerId=431b946a-92ea-430a-984d-c3cd65d2bb77 Filter results by customerId |
name | string Filter results by campaign name |
status | string Example: status=ENABLED Filter result by status |
startDate | integer <uint64> Example: startDate=1593583200000< Search campaign which starts at specific period. In example filter campaign which starts after/or at Wed Jul 01 2020 06:00:00 |
endDate | integer <uint64> Example: endDate=<1596261600000 Search campaign which ends at specific period. In example filter campaign which ends before/or at Wed Aug 01 2020 06:00:00 |
products.id | string <uuid4> Filter results by product or variant id |
products.matchMode | string Example: products.matchMode=variant Filter results by product match mode (filter mode) |
Responses
Response samples
- 200
- 401
- 403
- 500
{- "format": "short",
- "items": [
- {
- "createDate": 1593683684789,
- "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
- "dbVersion": 0,
- "description": "Christman 2002 special cart, 10% off on most of products",
- "endDate": 1596261600000,
- "id": "d87e0973-980a-4485-a39d-682184a8988a",
- "mandatoryProducts": [
- {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "variant"
}, - {
- "id": "7af99959-5ac4-4b15-a880-78e5f2ebc595",
- "matchMode": "variant"
}
], - "name": "my_mkt_name_example",
- "products": [
- {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "variant"
}, - {
- "id": "7af99959-5ac4-4b15-a880-78e5f2ebc595",
- "matchMode": "variant"
}
], - "startDate": 1593583200000,
- "status": "string",
- "updateDate": 1593685645385
}
], - "last": false,
- "number": 41,
- "size": 10,
- "totalItems": 100523,
- "totalPages": 10053
}
createCampaign
Create an item
Authorizations:
Request Body schema: application/json
customerId | string Associates entity to certain customer. |
description | string Marketing description. Describe marketing campaign operation. |
endDate | integer <uint64> When the marketing campaign ends. Timestamp in milliseconds. Must be greater than startDate. When omitted campaign is infinite. |
Array of objects (CampaignProduct) DEPRECATED. Use LinkedProducts instead. Products mandatory in cart (if not, marketing campaign will be DISABLED) | |
name required | string Marketing campaign name. Must be unique along with customerId (composed unique key). Name is used in URL query parameter "mktop" to create campaign cart. |
Array of objects (CampaignProduct) Campaign products filter. | |
startDate required | integer <uint64> When the marketing campaign starts. Timestamp in milliseconds. |
status required | string (CampaignStatus) Status of marketing campaign Has two values: ENABLED, DISABLED |
Responses
Request samples
- Payload
{- "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
- "description": "Christman 2002 special cart, 10% off on most of products",
- "endDate": 1596261600000,
- "mandatoryProducts": [
- {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "variant"
}, - {
- "id": "7af99959-5ac4-4b15-a880-78e5f2ebc595",
- "matchMode": "variant"
}
], - "name": "my_mkt_name_example",
- "products": [
- {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "variant"
}, - {
- "id": "7af99959-5ac4-4b15-a880-78e5f2ebc595",
- "matchMode": "variant"
}
], - "startDate": 1593583200000,
- "status": "string"
}
Response samples
- 400
- 401
- 403
- 500
{- "error": "Bad Request",
- "message": "error: field can't be empty",
- "path": "/service-name/resource/36a6d3ac-207f-4b64-be01-664c1edbd38b",
- "status": 400,
- "timestamp": 1593769514607
}
getCampaign
Get item
Authorizations:
path Parameters
id required | string Entity id generated and returned in "Location" header upon creation (POST). |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
{- "createDate": 1593683684789,
- "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
- "dbVersion": 0,
- "description": "Christman 2002 special cart, 10% off on most of products",
- "endDate": 1596261600000,
- "id": "d87e0973-980a-4485-a39d-682184a8988a",
- "mandatoryProducts": [
- {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "variant"
}, - {
- "id": "7af99959-5ac4-4b15-a880-78e5f2ebc595",
- "matchMode": "variant"
}
], - "name": "my_mkt_name_example",
- "products": [
- {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "variant"
}, - {
- "id": "7af99959-5ac4-4b15-a880-78e5f2ebc595",
- "matchMode": "variant"
}
], - "startDate": 1593583200000,
- "status": "string",
- "updateDate": 1593685645385
}
updateCampaign
Update item
Authorizations:
path Parameters
id required | string Entity id generated and returned in "Location" header upon creation (POST). |
Request Body schema: application/json
createDate | integer <int64> Entity creation time. Value is auto generated upon creation and read only. Timestamp in milliseconds. |
customerId | string Associates entity to certain customer. |
dbVersion | integer <int64> Concurrent operations check mechanism. Used in update actions. Value is auto generated upon creation/update and read only. Prevent for any issue during concurrent update transaction done by parallel applications. Upon spotted dbVersion incorrectness a 412 retry error is returned. Let's consider a scenario where two application are trying update same entity: App 1: GET entity request at 00:00:00.000 Received dbVersion=0 change entity data PUT entity request at 00:00:00.009 updated automatically dbVersion=1 App 2: GET entity request with at 00:00:00.005 Received dbVersion=0 because update of App 1 haven't occurred yet change entity data update entity at 00:00:00.014 412 Error, because dbVersion=1 after update of App 1 |
description | string Marketing description. Describe marketing campaign operation. |
endDate | integer <uint64> When the marketing campaign ends. Timestamp in milliseconds. Must be greater than startDate. When omitted campaign is infinite. |
id | string Entity id. Value is auto generated upon creation and read only. |
Array of objects (CampaignProduct) DEPRECATED. Use LinkedProducts instead. Products mandatory in cart (if not, marketing campaign will be DISABLED) | |
name required | string Marketing campaign name. Must be unique along with customerId (composed unique key). Name is used in URL query parameter "mktop" to create campaign cart. |
Array of objects (CampaignProduct) Campaign products filter. | |
startDate required | integer <uint64> When the marketing campaign starts. Timestamp in milliseconds. |
status required | string (CampaignStatus) Status of marketing campaign Has two values: ENABLED, DISABLED |
updateDate | integer <int64> Entity update time. Value is auto generated upon creation/update and read only. Timestamp in milliseconds. |
Responses
Request samples
- Payload
{- "createDate": 1593683684789,
- "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
- "dbVersion": 0,
- "description": "Christman 2002 special cart, 10% off on most of products",
- "endDate": 1596261600000,
- "id": "d87e0973-980a-4485-a39d-682184a8988a",
- "mandatoryProducts": [
- {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "variant"
}, - {
- "id": "7af99959-5ac4-4b15-a880-78e5f2ebc595",
- "matchMode": "variant"
}
], - "name": "my_mkt_name_example",
- "products": [
- {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "variant"
}, - {
- "id": "7af99959-5ac4-4b15-a880-78e5f2ebc595",
- "matchMode": "variant"
}
], - "startDate": 1593583200000,
- "status": "string",
- "updateDate": 1593685645385
}
Response samples
- 200
- 400
- 401
- 403
- 500
{- "createDate": 1593683684789,
- "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
- "dbVersion": 0,
- "description": "Christman 2002 special cart, 10% off on most of products",
- "endDate": 1596261600000,
- "id": "d87e0973-980a-4485-a39d-682184a8988a",
- "mandatoryProducts": [
- {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "variant"
}, - {
- "id": "7af99959-5ac4-4b15-a880-78e5f2ebc595",
- "matchMode": "variant"
}
], - "name": "my_mkt_name_example",
- "products": [
- {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "variant"
}, - {
- "id": "7af99959-5ac4-4b15-a880-78e5f2ebc595",
- "matchMode": "variant"
}
], - "startDate": 1593583200000,
- "status": "string",
- "updateDate": 1593685645385
}
deleteCampaign
Delete item
Authorizations:
path Parameters
id required | string Entity id generated and returned in "Location" header upon creation (POST). |
Responses
Response samples
- 401
- 403
- 404
- 500
{- "error": "Unauthorized",
- "message": "Unauthorized",
- "path": "/service-name/resource/36a6d3ac-207f-4b64-be01-664c1edbd38b",
- "status": 401,
- "timestamp": 1593769514607
}
listLinkedProducts
Get items
Authorizations:
query Parameters
size | integer <int64> Default: 50 Amount of items returned per pagination page |
page | integer <int64> Default: 0 Pagination page starting from 0 |
sort | string Example: sort=createDate,desc Sort list results Format: entity_field_name,order. Format entity collection: entity_sub_object_name.sub_field_name,order. |
customerId | string Example: customerId=431b946a-92ea-430a-984d-c3cd65d2bb77 Filter results by customerId |
marketingCampaignId | string <uuid4> Filter results by marketing campaign id |
baseProduct.id | string <uuid4> Filter results by base product id |
baseProduct.matchMode | string Example: baseProduct.matchMode=variant Filter results by base product match mode (filter mode) |
linkedProduct.id | string <uuid4> Filter results by linked product id |
linkedProduct.quantitySelector | string Example: linkedProduct.quantitySelector=alignedLessOrEqual Filter results by linked product quantity selector |
Responses
Response samples
- 200
- 401
- 403
- 500
{- "format": "short",
- "items": [
- {
- "baseProduct": {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "string"
}, - "createDate": 1593683684789,
- "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
- "dbVersion": 0,
- "id": "d87e0973-980a-4485-a39d-682184a8988a",
- "linkedProduct": {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "quantitySelector": "string"
}, - "marketingCampaignId": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "updateDate": 1593685645385
}
], - "last": false,
- "number": 41,
- "size": 10,
- "totalItems": 100523,
- "totalPages": 10053
}
createLinkedProducts
Create an item
Authorizations:
Request Body schema: application/json
required | object (BaseProduct) Defines a mandatory product in the cart |
customerId | string Associates entity to certain customer. |
required | object (LinkedProduct) Defines a dependant product (product removed if base product not present in the cart) |
marketingCampaignId required | string Marketing Campaign id. Links to unique campaign |
Responses
Request samples
- Payload
{- "baseProduct": {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "string"
}, - "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
- "linkedProduct": {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "quantitySelector": "string"
}, - "marketingCampaignId": "bda56683-4641-4d8a-af46-28a73394a2ae"
}
Response samples
- 400
- 401
- 403
- 500
{- "error": "Bad Request",
- "message": "error: field can't be empty",
- "path": "/service-name/resource/36a6d3ac-207f-4b64-be01-664c1edbd38b",
- "status": 400,
- "timestamp": 1593769514607
}
getLinkedProducts
Get item
Authorizations:
path Parameters
id required | string Entity id generated and returned in "Location" header upon creation (POST). |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
{- "baseProduct": {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "string"
}, - "createDate": 1593683684789,
- "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
- "dbVersion": 0,
- "id": "d87e0973-980a-4485-a39d-682184a8988a",
- "linkedProduct": {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "quantitySelector": "string"
}, - "marketingCampaignId": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "updateDate": 1593685645385
}
updateLinkedProducts
Update item
Authorizations:
path Parameters
id required | string Entity id generated and returned in "Location" header upon creation (POST). |
Request Body schema: application/json
required | object (BaseProduct) Defines a mandatory product in the cart |
createDate | integer <int64> Entity creation time. Value is auto generated upon creation and read only. Timestamp in milliseconds. |
customerId | string Associates entity to certain customer. |
dbVersion | integer <int64> Concurrent operations check mechanism. Used in update actions. Value is auto generated upon creation/update and read only. Prevent for any issue during concurrent update transaction done by parallel applications. Upon spotted dbVersion incorrectness a 412 retry error is returned. Let's consider a scenario where two application are trying update same entity: App 1: GET entity request at 00:00:00.000 Received dbVersion=0 change entity data PUT entity request at 00:00:00.009 updated automatically dbVersion=1 App 2: GET entity request with at 00:00:00.005 Received dbVersion=0 because update of App 1 haven't occurred yet change entity data update entity at 00:00:00.014 412 Error, because dbVersion=1 after update of App 1 |
id | string Entity id. Value is auto generated upon creation and read only. |
required | object (LinkedProduct) Defines a dependant product (product removed if base product not present in the cart) |
marketingCampaignId required | string Marketing Campaign id. Links to unique campaign |
updateDate | integer <int64> Entity update time. Value is auto generated upon creation/update and read only. Timestamp in milliseconds. |
Responses
Request samples
- Payload
{- "baseProduct": {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "string"
}, - "createDate": 1593683684789,
- "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
- "dbVersion": 0,
- "id": "d87e0973-980a-4485-a39d-682184a8988a",
- "linkedProduct": {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "quantitySelector": "string"
}, - "marketingCampaignId": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "updateDate": 1593685645385
}
Response samples
- 200
- 400
- 401
- 403
- 500
{- "baseProduct": {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "matchMode": "string"
}, - "createDate": 1593683684789,
- "customerId": "e0436791-5866-406d-b0c8-3ba32ead438a",
- "dbVersion": 0,
- "id": "d87e0973-980a-4485-a39d-682184a8988a",
- "linkedProduct": {
- "id": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "quantitySelector": "string"
}, - "marketingCampaignId": "bda56683-4641-4d8a-af46-28a73394a2ae",
- "updateDate": 1593685645385
}
deleteLinkedProducts
Delete item
Authorizations:
path Parameters
id required | string Entity id generated and returned in "Location" header upon creation (POST). |
Responses
Response samples
- 401
- 403
- 404
- 500
{- "error": "Unauthorized",
- "message": "Unauthorized",
- "path": "/service-name/resource/36a6d3ac-207f-4b64-be01-664c1edbd38b",
- "status": 401,
- "timestamp": 1593769514607
}