Validate Receipts

Validate a receipt against the settings for an existing campaign. You can submit a receipt as a file upload or as a public HTTPS URL.

API Reference

Endpoints

Input typeEndpoint
File uploadPOST https://api.taggun.io/api/validation/v1/campaign/receipt-validation/file
URLPOST https://api.taggun.io/api/validation/v1/campaign/receipt-validation/url

Access

Receipt validation requires Campaign Validation access. See Setting Up Purchase Validation Campaigns.

File Upload Request

Send this endpoint as multipart/form-data.

FieldTypeDescriptionRequired
filefileReceipt file under 20 MB. Accepted file types: PDF, JPG, PNG, GIF, HEIC.Yes
campaignIdstringThe campaign ID to validate the receipt against. Maximum 50 characters.Yes
referenceIdstringYour receipt reference. Use the same referenceId for resubmissions of the same receipt; submissions with the same referenceId are not picked up by duplicate checks. Maximum 50 characters.No
userIdstringYour end-user identifier. This helps duplicate checks compare receipts for the same user. Maximum 50 characters.No
subAccountIdstringOptional sub-account identifier for reporting or billing segmentation. Maximum 100 characters.No
incognitobooleanSet to true to avoid saving the receipt in storage. Defaults to false.No
ipAddressstringIPv4 or IPv6 address of the end user.No
nearstringGeographic hint for merchant search, typically city, state, country.No
languagestringTwo-letter language hint. Leave empty for auto-detection.No

URL Request

Send this endpoint as JSON.

FieldTypeDescriptionRequired
urlstringPublic HTTPS URL containing the receipt file. Only HTTPS URLs are accepted.Yes
headersobjectOptional headers to forward while downloading the receipt URL.No
campaignIdstringThe campaign ID to validate the receipt against. Maximum 50 characters.Yes
referenceIdstringYour receipt reference. Use the same referenceId for resubmissions of the same receipt; submissions with the same referenceId are not picked up by duplicate checks. Maximum 50 characters.No
userIdstringYour end-user identifier. This helps duplicate checks compare receipts for the same user. Maximum 50 characters.No
subAccountIdstringOptional sub-account identifier for reporting or billing segmentation. Maximum 100 characters.No
incognitobooleanSet to true to avoid saving the receipt in storage. Defaults to false.No
ipAddressstringIPv4 or IPv6 address of the end user.No
nearstringGeographic hint for merchant search, typically city, state, country.No
languagestringTwo-letter language hint. Leave empty for auto-detection.No

URL Request Example

{
  "url": "https://example.com/receipts/receipt-123.png",
  "campaignId": "coffee-june-2026",
  "referenceId": "receipt-123",
  "userId": "customer-456",
  "incognito": false
}

Response

The validation response contains the receipt extraction result and campaign validation result in one object.

FieldTypeDescription
successfulbooleantrue when all enabled validation checks passed. false when one or more checks failed.
failedValidationsstring[]Validation keys that failed.
passedValidationsstring[]Validation keys that passed.
productLineItemsobject[]Product line items found on the receipt when line item extraction is enabled for the campaign or account.
matchedProductLineItemsobject[]Product line items that matched the campaign rules.
datestring | nullReceipt transaction date, when detected.
merchantNamestring | nullMerchant name, when detected.
merchantAddressstring | nullMerchant address, when detected.
merchantCitystring | nullMerchant city, when detected.
merchantPostalCodestring | nullMerchant postal code, when detected.
merchantStatestring | nullMerchant state, when detected.
merchantCountryCodestring | nullMerchant country code, when detected.
productCodesstring[]Product codes detected or validated for the campaign.
balanceAmountnumber | nullBalance owing detected on the receipt.
smartValidateobjectSmart Validate prompt results, when Smart Validate prompts are configured.
totalAmountnumber | nullReceipt total amount, when detected.
currencyCodestring | nullCurrency code for the total amount, when detected.
receiptNumberstring | nullReceipt number, when detected.
invoiceNumberstring | nullInvoice number, when detected.
similarReceiptsobject[]Similar receipt matches when similarity checking is enabled.
tamperDetectionobject | nullTamper detection result when tamper detection is enabled.
digitalDetectionobject | nullDigital receipt detection result when digital detection is enabled.
trackingIdstringTaggun tracking ID for this validation request.

Product Line Item Object

FieldTypeDescription
namestringProduct or service name.
unitPricenumberUnit price, when detected.
totalPricenumberTotal line price, when detected.
quantitynumberQuantity, when detected.

Validation Keys

These keys can appear in failedValidations or passedValidations, depending on the campaign settings and receipt result.

KeyMeaning
date_validatedReceipt date was checked against the campaign date window.
merchant_name_validatedMerchant name was checked against the campaign merchant rules.
product_code_validatedProduct codes were checked against the campaign product code rules.
product_line_items_validatedProduct line items were checked against the campaign line item rules.
balance_amount_validatedBalance owing was checked against the campaign maximum balance owing.
fraud_detection_unique_receipt_validatedReceipt similarity or duplicate checking was evaluated.
fraud_detection_genuine_receipt_validatedTamper detection was evaluated.
fraud_detection_complete_receipt_validatedReceipt completeness was evaluated for non-receipt or incomplete receipt detection.
Smart Validate output keyIf a Smart Validate prompt has skip set to false, its output key can appear as a validation key. For example, is_credit_card.

Example Response

{
  "successful": false,
  "failedValidations": ["product_code_validated"],
  "passedValidations": ["date_validated", "merchant_name_validated"],
  "productLineItems": [
    {
      "name": "Coffee Beans",
      "unitPrice": 12.5,
      "totalPrice": 25,
      "quantity": 2
    }
  ],
  "matchedProductLineItems": [],
  "date": "2026-06-12T00:00:00.000Z",
  "merchantName": "Fresh Market",
  "merchantAddress": "1 Market Street",
  "merchantCity": "Auckland",
  "merchantPostalCode": "1010",
  "merchantState": null,
  "merchantCountryCode": "NZ",
  "productCodes": [],
  "balanceAmount": 0,
  "smartValidate": {
    "is_credit_card": true
  },
  "totalAmount": 25,
  "currencyCode": "NZD",
  "receiptNumber": "R12345",
  "invoiceNumber": null,
  "similarReceipts": [],
  "tamperDetection": null,
  "digitalDetection": null,
  "trackingId": "7f64b9e0-0000-0000-0000-000000000000"
}

Managing Settings

To retrieve, update, list, or delete campaign settings, see Manage Campaign Settings.