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
| Field | Type | Description | Required |
|---|---|---|---|
campaignId | string | The 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.
| Field | Type | Description |
|---|---|---|
date | object | Receipt date window. If supplied, both date.start and date.end are required. |
merchantNames | object | Merchant name allow and block rules. |
productCodes | object | Product code extraction and validation rules. |
productLineItems | object | Product line item matching rules. |
balanceOwing | object | Extract balance owing and optionally validate it against a maximum. balanceOwing.max remains required whenever this section is supplied, including when skip is true. |
fraudDetection | object | Duplicate, tamper, and digital receipt detection controls. |
smartValidate | object | One to three prompt-based rules for narrowly scoped, receipt-visible yes/no criteria. |
merchantNames,productCodes,productLineItems,balanceOwing, andfraudDetectionsupport a section-levelskipflag.smartValidateusesprompts[].skip. Thedatesection has noskipfield. When a supportedskipvalue istrue, data can still be returned, but the check is not added topassedValidationsorfailedValidations.
date
date| Field | Type | Description | Required |
|---|---|---|---|
date.start | string | Campaign start date in UTC ISO format, for example 2026-06-01T00:00:00.000Z. | Yes, when date is supplied |
date.end | string | Campaign end date in UTC ISO format, for example 2026-06-30T23:59:59.999Z. | Yes, when date is supplied |
merchantNames
merchantNamesAccept or reject receipts based on the detected merchant. Pairs well with Merchant Intelligence name standardisation.
| Field | Type | Description | Required |
|---|---|---|---|
merchantNames.skip | boolean | When true, merchant data can still be returned but merchant name validation is not added to the validation keys. Defaults to false. | No |
merchantNames.allowList | string[] | Merchant names that are accepted for the campaign. | No |
merchantNames.blockList | string[] | Merchant names that are rejected for the campaign. | No |
merchantNames.list | string[] | Accepted merchant names. | No |
Do not combine list fields unless your confirmed campaign contract defines their interaction.
productCodes
productCodesUse 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.
| Field | Type | Description | Required |
|---|---|---|---|
productCodes.skip | boolean | When true, product codes can still be returned but are not added to the validation keys. Defaults to false. | No |
productCodes.description | string | null | Natural-language instruction for finding relevant product codes, for example Find product codes for Test Product. | No |
productCodes.list | string[] | Exact product codes accepted by the campaign. | No |
productLineItems
productLineItemsUse line item rules when validation depends on the item name, quantity, or total price.
| Field | Type | Description | Required |
|---|---|---|---|
productLineItems.skip | boolean | When true, line items can still be returned but are not added to the validation keys. Defaults to false. | No |
productLineItems.names | string[] | Product names to match against receipt line items. | No |
productLineItems.totalPrice.min | number | Minimum accepted line item total price. | Yes, when totalPrice is supplied |
productLineItems.totalPrice.max | number | Maximum accepted line item total price. | Yes, when totalPrice is supplied |
productLineItems.quantity.min | number | Minimum accepted line item quantity. | Yes, when quantity is supplied |
productLineItems.quantity.max | number | Maximum accepted line item quantity. | Yes, when quantity is supplied |
productLineItems.shouldMatchAbbreviations | boolean | When true, product name matching also considers abbreviations. Defaults to false. | No |
balanceOwing
balanceOwingReject receipts that still show an amount owing — for example, lay-by or partially paid orders.
| Field | Type | Description | Required |
|---|---|---|---|
balanceOwing.skip | boolean | Optional; 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.max | number | Maximum 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
fraudDetectionEnable fraud-related validation checks for the campaign. For how each check works, see the Fraud Detection Suite.
| Field | Type | Description | Required |
|---|---|---|---|
fraudDetection.skip | boolean | When true, fraud signals can still be returned but fraud checks are not added to the validation keys. Defaults to false. | No |
fraudDetection.allowSimilarityCheck | boolean | Enables duplicate and similarity checks for submitted receipts. | No |
fraudDetection.allowTamperDetection | boolean | Enables tamper detection checks. | No |
fraudDetection.allowDigitalDetection | boolean | Enables 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
smartValidateSmartValidate 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.
| Field | Type | Description | Required |
|---|---|---|---|
smartValidate.prompts | object[] | One to three prompts. | No |
smartValidate.prompts[].question | string | One natural-language yes/no question that can be answered from the receipt. | Yes |
smartValidate.prompts[].example | object | Expected boolean-valued output object, for example { "is_credit_card": true }. Use one clearly named key. | Yes |
smartValidate.prompts[].skip | boolean | When 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 codesCOF-250orCOF-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 whenmaxis0.fraudDetection— duplicate and similarity checking is on.smartValidate— adds the genericis_credit_cardyes/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
| Code | Meaning |
|---|---|
201 | Campaign settings created. |
400 | The request body is invalid. |
401 | The apikey header is missing. |
403 | Authentication 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
campaignIdis yours to choose (max 50 characters) — use a stable, descriptive ID likecoffee-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.
Updated about 21 hours ago