Create Campaign Settings

Create campaign settings before validating receipts. The settings define which receipt fields Taggun should check and which values are accepted for a campaign.

API Reference

Endpoint: POST https://api.taggun.io/api/validation/v1/campaign/settings/create/{campaignId}

Access

Campaign settings require Campaign Validation access. See Setting Up Purchase Validation Campaigns.

Path Parameters

FieldTypeDescriptionRequired
campaignIdstringThe ID of the campaign to create settings for. Maximum 50 characters.Yes

Request Body

All request body sections are optional, but a campaign with no validation sections will not perform useful validation. Include only the sections you want Taggun to evaluate.

FieldTypeDescription
dateobjectOptional receipt date window. If supplied, both date.start and date.end are required.
merchantNamesobjectOptional merchant name allow and block rules.
productCodesobjectOptional product code extraction and validation rules.
productLineItemsobjectOptional product line item matching rules.
balanceOwingobjectOptional maximum allowed balance owing.
fraudDetectionobjectOptional duplicate, tamper, and digital receipt detection controls.
smartValidateobjectOptional custom true/false validation prompts.

date

FieldTypeDescriptionRequired
date.startstringCampaign start date in UTC ISO format, for example 2026-06-01T00:00:00.000Z.Yes, when date is supplied
date.endstringCampaign end date in UTC ISO format, for example 2026-06-30T23:59:59.999Z.Yes, when date is supplied

merchantNames

Use merchant name rules to accept or reject receipts based on the detected merchant.

FieldTypeDescriptionRequired
merchantNames.skipbooleanWhen true, merchant data can still be returned but merchant name validation is not added to passedValidations or failedValidations. Defaults to false.No
merchantNames.returnFromTheListbooleanWhen true, Taggun returns the matched merchant from your supplied list when there is a match. Defaults to false.No
merchantNames.allowListstring[]Merchant names that are accepted for the campaign.No
merchantNames.blockListstring[]Merchant names that are rejected for the campaign.No
merchantNames.liststring[]Accepted merchant names. Prefer allowList for new integrations.No

productCodes

Use product code rules when eligibility depends on SKUs, barcodes, serial-like product identifiers, or other product code evidence on the receipt.

productCodes.list is best when you already know the exact codes that are valid for the campaign. productCodes.description is useful when the code pattern or location is variable and you need Taggun to look for product-code evidence described in natural language.

If both description and list are supplied, Taggun uses the description to find candidate product codes and then checks those candidates against the list.

FieldTypeDescriptionRequired
productCodes.skipbooleanWhen true, product codes can still be returned but product code validation is not added to passedValidations or failedValidations. Defaults to false.No
productCodes.descriptionstring | nullNatural-language instruction for finding relevant product codes, for example Find product codes for Test Product.No
productCodes.liststring[]Exact product codes accepted by the campaign.No

productLineItems

Use product line item rules when validation depends on the receipt item name, item quantity, or item total price.

FieldTypeDescriptionRequired
productLineItems.skipbooleanWhen true, line items can still be returned but line item validation is not added to passedValidations or failedValidations. Defaults to false.No
productLineItems.namesstring[]Product names to match against receipt line items.No
productLineItems.totalPrice.minnumberMinimum accepted line item total price.Yes, when totalPrice is supplied
productLineItems.totalPrice.maxnumberMaximum accepted line item total price.Yes, when totalPrice is supplied
productLineItems.quantity.minnumberMinimum accepted line item quantity.Yes, when quantity is supplied
productLineItems.quantity.maxnumberMaximum accepted line item quantity.Yes, when quantity is supplied
productLineItems.shouldMatchAbbreviationsbooleanWhen true, product name matching also considers abbreviations. Defaults to false.No

balanceOwing

FieldTypeDescriptionRequired
balanceOwing.skipbooleanWhen true, balance owing can still be returned but balance owing validation is not added to passedValidations or failedValidations. Defaults to false.No
balanceOwing.maxnumberMaximum accepted amount owing on the receipt.Yes, when balanceOwing is supplied

fraudDetection

Use these fields to enable fraud-related validation checks for a campaign. For more detail, see Fraud Detection and Prevention.

FieldTypeDescriptionRequired
fraudDetection.skipbooleanWhen true, fraud signals can still be returned but fraud validation checks are not added to passedValidations or failedValidations. Defaults to false.No
fraudDetection.allowSimilarityCheckbooleanEnables duplicate and similarity checks for submitted receipts.No
fraudDetection.allowTamperDetectionbooleanEnables tamper detection checks.No
fraudDetection.allowDigitalDetectionbooleanEnables digital receipt detection output.No

smartValidate

Smart Validate prompts let you ask custom true/false questions about the receipt. For implementation guidance, see SmartValidate Implementation.

FieldTypeDescriptionRequired
smartValidate.promptsobject[]One to three prompts.No
smartValidate.prompts[].questionstringThe question Taggun should answer from the receipt.Yes
smartValidate.prompts[].exampleobjectA single expected boolean output key and value, for example { "is_credit_card": true }.Yes
smartValidate.prompts[].skipbooleanWhen true, the prompt result can still be returned but is not added as a validation check. Defaults to false.No

Example Request

{
  "date": {
    "start": "2026-06-01T00:00:00.000Z",
    "end": "2026-06-30T23:59:59.999Z"
  },
  "merchantNames": {
    "allowList": ["Fresh Market"],
    "blockList": ["Fresh Market Wholesale"]
  },
  "productCodes": {
    "description": "Find product codes printed beside eligible coffee products",
    "list": ["COF-250", "COF-500"]
  },
  "productLineItems": {
    "names": ["Coffee Beans"],
    "quantity": {
      "min": 1,
      "max": 5
    },
    "totalPrice": {
      "min": 5,
      "max": 80
    }
  },
  "balanceOwing": {
    "max": 0
  },
  "fraudDetection": {
    "allowSimilarityCheck": true
  },
  "smartValidate": {
    "prompts": [
      {
        "question": "Was this paid by credit card?",
        "example": {
          "is_credit_card": true
        }
      }
    ]
  }
}

Response

Successful creation returns HTTP 201.

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

If the campaign ID already exists, the API returns a 400 response with the message Campaign id already exists.

Next Step

After creating settings, submit receipts with Validate Receipts.