Campaign Settings Reference

Every rule you can define for a validation campaign: dates, merchants, products, balance owing, fraud checks, and SmartValidate prompts.

Campaign settings define what a valid receipt looks like for your campaign. You create them once per campaignId with the Create Campaign Settings endpoint, then every receipt submitted against that campaign is checked against these rules.

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

Availability

📘

Availability: Receipt validation is included on the Advanced plan and above. Enable Campaign Validation in your account Feature Settings when it is available on your plan. See Plans & Feature Access and Setting Up 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
dateobjectReceipt date window. If supplied, both date.start and date.end are required.
merchantNamesobjectMerchant name allow and block rules.
productCodesobjectProduct code extraction and validation rules.
productLineItemsobjectProduct line item matching rules.
balanceOwingobjectExtract balance owing and optionally validate it against a maximum. balanceOwing.max remains required whenever this section is supplied, including when skip is true.
fraudDetectionobjectDuplicate, tamper, and digital receipt detection controls.
smartValidateobjectOne to three prompt-based rules for narrowly scoped, receipt-visible yes/no criteria.
📘

merchantNames, productCodes, productLineItems, balanceOwing, and fraudDetection support a section-level skip flag. smartValidate uses prompts[].skip. The date section has no skip field. When a supported skip value is true, data can still be returned, but the check is not added to passedValidations or failedValidations.

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

Accept or reject receipts based on the detected merchant. Pairs well with Merchant Intelligence name standardisation.

FieldTypeDescriptionRequired
merchantNames.skipbooleanWhen true, merchant data can still be returned but merchant name validation is not added to the validation keys. 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.No

Do not combine list fields unless your confirmed campaign contract defines their interaction.

productCodes

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

productCodes.description supplies a natural-language instruction; productCodes.list supplies exact accepted codes. The public contract does not currently define their evaluation order when both are supplied. Use one at a time unless API Engineering confirms the combined behavior for your integration.

FieldTypeDescriptionRequired
productCodes.skipbooleanWhen true, product codes can still be returned but are not added to the validation keys. 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 line item rules when validation depends on the item name, quantity, or total price.

FieldTypeDescriptionRequired
productLineItems.skipbooleanWhen true, line items can still be returned but are not added to the validation keys. 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

Reject receipts that still show an amount owing — for example, lay-by or partially paid orders.

FieldTypeDescriptionRequired
balanceOwing.skipbooleanOptional; defaults to false. Set to true to extract and return balanceAmount without adding balance_amount_validated to passedValidations or failedValidations. It does not replace balanceOwing.max.No
balanceOwing.maxnumberMaximum accepted amount owing on the receipt. It is required whenever balanceOwing is supplied, even when skip is true. Use a value greater than zero; the current runtime does not perform the comparison when max is 0.Yes, when balanceOwing is supplied

fraudDetection

Enable fraud-related validation checks for the campaign. For how each check works, see the Fraud Detection Suite.

FieldTypeDescriptionRequired
fraudDetection.skipbooleanWhen true, fraud signals can still be returned but fraud checks are not added to the validation keys. 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

Duplicate and similarity checks compare against eligible stored receipts. See Duplicate & Similarity Detection for matching behaviour and Security, Privacy & Data Residency for storage and retention.

smartValidate

SmartValidate is a current prompt-based Campaign Validation rule type for one narrow, receipt-visible yes/no criterion that the structured sections do not cover. Use the structured fields above when they directly represent the requirement. For positioning, boundaries, and the approved generic credit-card-payment illustration, see SmartValidate.

FieldTypeDescriptionRequired
smartValidate.promptsobject[]One to three prompts.No
smartValidate.prompts[].questionstringOne natural-language yes/no question that can be answered from the receipt.Yes
smartValidate.prompts[].exampleobjectExpected boolean-valued output object, for example { "is_credit_card": true }. Use one clearly named key.Yes
smartValidate.prompts[].skipbooleanWhen true, the prompt result can still be returned but is not added as a validation check. Defaults to false.No

Worked Example

Create settings for a June campaign that accepts Fresh Market receipts for qualifying coffee products, requires nothing owing, runs duplicate checks, and includes one generic SmartValidate prompt:

curl --request POST \
     --url https://api.taggun.io/api/validation/v1/campaign/settings/create/coffee-june-2026 \
     --header 'accept: application/json' \
     --header 'apikey: YOUR_API_KEY' \
     --header 'content-type: application/json' \
     --data '
{
  "date": {
    "start": "2026-06-01T00:00:00.000Z",
    "end": "2026-06-30T23:59:59.999Z"
  },
  "merchantNames": {
    "allowList": ["Fresh Market"]
  },
  "productCodes": {
    "list": ["COF-250", "COF-500"]
  },
  "productLineItems": {
    "names": ["Coffee Beans"],
    "quantity": { "min": 1, "max": 5 },
    "totalPrice": { "min": 5, "max": 80 }
  },
  "balanceOwing": { "max": 0.01 },
  "fraudDetection": { "allowSimilarityCheck": true },
  "smartValidate": {
    "prompts": [
      {
        "question": "Does this receipt show payment by credit card?",
        "example": { "is_credit_card": true },
        "skip": false
      }
    ]
  }
}
'

Request breakdown:

  • date — receipts must be dated within June 2026.
  • merchantNames — receipts matching the configured Fresh Market allow list qualify under this rule.
  • productCodes — receipts must contain one of the exact accepted codes COF-250 or COF-500.
  • productLineItems — a line item must match "Coffee Beans", with quantity 1–5 and total price 5–80.
  • balanceOwing — the detected balance owing must not exceed 0.01. A value greater than zero is used because the current runtime does not perform the comparison when max is 0.
  • fraudDetection — duplicate and similarity checking is on.
  • smartValidate — adds the generic is_credit_card yes/no check. This illustrates the request shape; it does not describe a particular customer's production use case.

Response

Successful creation returns HTTP 201:

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

Status codes

CodeMeaning
201Campaign settings created.
400The request body is invalid.
401The apikey header is missing.
403Authentication credentials are invalid. Campaign Settings list/get/update/delete use an operation-specific 400 when Campaign Validation is unavailable.

For general error handling, see Error Handling & Status Codes.

Key Notes

  • campaignId is yours to choose (max 50 characters) — use a stable, descriptive ID like coffee-june-2026.
  • To change rules after creation, use Update Campaign Settings — the update replaces the stored settings, so include every section that should remain active.
  • Next step: submit receipts with Validating Receipts.

Need something not covered here? Contact [email protected] — see Contacting Support.


Did this page help you?