Campaign products

The Campaign products are sets of products that are offered to Customers under special conditions, with different type of benefits. It can be used like a catalogue of discounted products on a special web site/e-shop or a set of special offers distributed to households as leaflet or direct mail. All this kind of campaign product types can be managed in CRM CareCloud directly or via CareCloud API.

Available methods

All available methods for resource campaign-products.

HTTP method Endpoint Description
[badge-blue GET] /campaign-products Get information about all campaign products
[badge-blue GET] /campaign-products/{campaign_product_id} Get information about a campaign product
[badge-green POST] /campaign-products Create a new campaign product

Collection of campaign products

Get information about all available campaign products
[badge-blue GET] /campaign-products

Query string

Parameter name Type Description Mandatory (Yes/No)
count integer The number of records to return.
Default value is 100.
No
offset integer The number of records from a collection to skip.
Default value is 0.
No
sort_field string One of the query string parameters for sorting.
Response is sorted by the specified field.
No
sort_direction string Direction of sorting the response list.
Possible values are: ASC / DESC
No
name string Name of the product No
code string Code of the product No
display_in string Place to display campaign product.
Possible values are: web / cash desk / api
No
type_id array Type of the customer for a campaign product. No
value_type_id integer Type of value.
Possible values are: 1 - percentage discount value / 2 - final price
No
is_valid boolean Filter for valid campaign products.
Possible values: true - all campaign products valid in the moment / false - all campaign products not valid in the moment / no value - all campaign products
No
valid_from string Date and time from where is campaign products valid already. (YYYY-MM-DD HH:MM:SS) No
valid_to string Date and time to where is campaign products valid still. (YYYY-MM-DD HH:MM:SS) No

Response

Status code: 200 OK
Output structure : object

Parameter name Type Description
campaign_products CampaignProduct[] List of the campaign products
total_items integer Count of all found campaign products

Example request

GET <projectURL>/rest-api/customer-interface/v1.0/campaign-products
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic PEF1dGhvcml6YXRpb24gc3RyaW5nICB3aXRoIHRva2VuIGlkPg==

Example response

HTTP/1.1 200 OK
Date: Mon, 22 Jul 2019 12:23:01 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "camping_products": [
      {
        "campaign_product_id": "8bed991c68a470e7aaeff",
        "product_id": "80bfce6e94829c8df40",
        "currency_id": "86e05affc7a7abefc",
        "value": 100,
        "value_type_id": 2,
        "valid_from": "2018-11-19 00:00:00",
        "valid_to": "2020-01-05 23:59:59",
        "presentation_data": {
          "name": "Snickers",
          "subtitle": "",
          "note": "",
          "description": "",
          "image_url": ""
        },
        "last_change": null
      },
      {
        "campaign_product_id": "81eaeea13b8984a169c",
        "product_id": "81ae89621be2acefce7f",
        "currency_id": "86e05affc7a7abefcd51",
        "value": 1,
        "value_type_id": 1,
        "valid_from": "2019-04-05 00:00:00",
        "valid_to": "2019-05-05 23:59:59",
        "presentation_data": {
          "name": "Mars",
          "subtitle": null,
          "note": null,
          "description": "",
          "image_url": ""
        },
        "last_change": null
      }
    ],
    "total_items": 2
  }
}


Detail of a specific campaign product

Get information about all details of a specific campaign product
[badge-blue GET] /campaign-products/{campaign_product_id}

Path parameters

Parameter name Type Description
campaign_product_id string The unique id for the campaign product in CareCloud

Response

Status code: 200 OK
Output structure : CampaignProduct

Example request

GET <projectURL>/rest-api/customer-interface/v1.0/campaign-products/81eaeea13b8984a169c
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic PEF1dGhvcml6YXRpb24gc3RyaW5nICB3aXRoIHRva2VuIGlkPg==

Example response

HTTP/1.1 200 OK
Date: Mon, 22 Jul 2019 12:23:01 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "campaign_product_id": "81eaeea13b8984a169c",
    "product_id": "81ae89621be2acefce7",
    "currency_id": "86e05affc7a7abefcd5",
    "value": 1,
    "value_type_id": 1,
    "valid_from": "2019-04-05 00:00:00",
    "valid_to": "2019-05-05 23:59:59",
    "presentation_data": {
      "name": "Mars",
      "subtitle": null,
      "note": null,
      "description": "1",
      "image_url": ""
    },
    "last_change": null
  }
}


Create a campaign product

Add a new campaign product
[badge-green POST] /campaign-products

Request

Parameter name Type Description Mandatory (Yes/No)
campaign_product CampaignProduct Campaign product resource Yes

Response

Status code: 201 Created
Output structure : object

Parameter name Type Description
campaign_product_id string The unique id of the campaign product

Example request

POST <projectURL>/rest-api/enterprise-interface/v1.0/campaign-products
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZWgEmEyZGFjZ3NmUzNDljNGYyMzlkOWQ0NA==

{
   "campaign_product" : {
     "product_id": "8eb4decc8818d85f9c7038e7fb",
     "currency_id": "86e05affc7a7abefcd513ab400",
     "campaign_id": "8bed991c68a470e7aaeffbf048",
     "value": 20,
     "value_type_id": 2,
     "valid_from": "2020-08-01 00:00:00",
     "valid_to": "2020-09-01 23:59:59",
     "display_in": [
       "cash_desk",
       "web"
     ],
     "type_id": "81eaeea13b8984a169c490a325",
     "presentation_data": {
       "name": "produkt jedna",
       "note": "poznamka",
       "description": "popis"
     }
   }
}

Example response

HTTP/1.1 200 OK
Date: Tue, 04 Aug 2020 10:38:51 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "campaign_product_id": "86ce801b45f59aaad0854ba948"
  }
}