Example - Create Campaign Settings

Complete example request body for creating campaign validation settings.

This page shows a complete example request for Create Campaign Settings — open the parent page to send it from the interactive playground.

Example Request

curl --request POST \
     --url https://api.taggun.io/api/validation/v1/campaign/settings/create/october-cola-24 \
     --header 'accept: application/json' \
     --header 'apikey: YOUR_API_KEY' \
     --header 'content-type: application/json' \
     --data '
{
  "date": {
    "start": "2024-10-01T00:00:00.000Z",
    "end": "2024-10-31T23:59:59.000Z"
  },
  "merchantNames": {
    "skip": false,
    "allowList": [
      "Walmart",
      "Target"
    ],
    "blockList": [
      "Costco"
    ]
  },
  "productLineItems": {
    "skip": false,
    "totalPrice": {
      "min": 0,
      "max": 100
    },
    "quantity": {
      "min": 1,
      "max": 100
    },
    "names": [
      "Coca Cola",
      "Sprite"
    ]
  },
  "balanceOwing": {
    "skip": true,
    "max": 0
  },
  "fraudDetection": {
    "allowSimilarityCheck": true,
    "allowTamperDetection": true,
    "allowDigitalDetection": true
  }
}
'

Request Breakdown

  • date — the campaign period, here 1–31 October 2024.
  • merchantNames — the merchants the campaign applies to. allowList names participating merchants (Walmart and Target); blockList explicitly excludes merchants (Costco).
  • productLineItems — validation rules for products: Coca Cola and Sprite, a total-price range of $0–$100, and a quantity between 1 and 100.
  • balanceOwing — skipped here, so an empty balance is not validated. max remains required whenever the section is supplied.
  • fraudDetection — enables similarity checks, tamper detection, and digital-signal detection on each submission.

The campaignId in the path (october-cola-24) is any unique ID you choose, up to 50 characters.

Example JSON Response

{
  "result": "Successfully created campaign settings",
  "statusCode": 201
}

Understand the Request