Definitions for Validate Receipts
This API is used to validate a receipt against a campaign's predefined settings
Endpoint: POST https://api.taggun.io/api/validation/v1/campaign/receipt-validation/file
Request Definitions
Field | Type | Description | Required |
---|---|---|---|
file | file | The receipt or invoice file for validation. | Yes |
campaignId | string | The campaignId of the campaign you've set up and now validating against. | Yes |
referenceId | string | A unique reference for tracking purposes. | No |
Response Definitions
Field | Type | Description |
---|---|---|
successful | boolean | true if the receipt passed validation, false if it failed. |
failedValidations | string[] | A list of validation checks that did not pass. |
passedValidations | string[] | A list of validation checks that passed successfully. |
productLineItems | object[] | All product items found on the receipt (name, price, quantity). |
matchedProductLineItems | object[] | Product items that matched the campaign’s rules. |
date | string | The transaction date on the receipt (in ISO 8601 format). |
merchantName | string | The name of the store or merchant. |
merchantAddress | string | The address of the store or merchant. |
merchantCity | string | The city of the store or merchant. |
merchantPostalCode | string | The postal code of the store or merchant. |
merchantState | string | The state of the store or merchant. |
merchantCountryCode | string | The country code of the store or merchant. |
productCodes | string[] | A list of product codes found on the receipt (if applicable). |
balanceAmount | number | null | The remaining balance on the receipt (if applicable). |
totalAmount | number | The total amount of the receipt. |
receiptNumber | string | null | The receipt number (if available). |
invoiceNumber | string | null | The invoice number (if available). |
similarReceipts | any[] | A list of receipts that are similar (used for fraud detection). |
trackingId | string | A unique ID to track this validation request. |
targetRotation | number | The degree of rotation applied to the receipt image during processing. |
Product Line Item Object
Field | Type | Description |
---|---|---|
name | string | The name of the product or service. |
unitPrice | number | The price of a single unit of the product. |
totalPrice | number | The total price for this product (unit price × quantity). |
quantity | number | The number of units purchased. |
List of possiblefailedValiations
or passedValidations
reasons
failedValiations
or passedValidations
reasonsreason | Description |
---|---|
date_validated | the receipt date falls outside the allowed date range |
merchant_name_validated | the merchant name on the receipt does not match the expected store or is invalid |
product_code_validated | the product codes/SKUs on the receipt are invalid or do not match the expected description and values |
matched_product_line_items | the products on the receipt do not match with the expected product name in the campaign settings |
balance_amount | the balance amount or amount due on the receipt is more than the allowed value |
fraud_detection_unique_receipt_validated | the receipt has been previously submitted or appears to be a duplicate |
Updated 13 days ago